
/* Python wrapper functions auto-generated by pidl */
#define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
#include "lib/replace/system/python.h"
#include "python/py3compat.h"
#include "includes.h"
#include "python/modules.h"
#include <pytalloc.h>
#include "librpc/rpc/pyrpc.h"
#include "librpc/rpc/pyrpc_util.h"
#include "bin/default/librpc/gen_ndr/ndr_spoolss.h"
#include "bin/default/librpc/gen_ndr/ndr_spoolss_c.h"

/*
 * Suppress compiler warnings if the generated code does not call these
 * functions
 */
#ifndef _MAYBE_UNUSED_
#ifdef __has_attribute
#if __has_attribute(unused)
#define _MAYBE_UNUSED_ __attribute__ ((unused))
#else
#define _MAYBE_UNUSED_
#endif
#endif
#endif
/*
 * These functions are here to ensure they can be optimized out by
 * the compiler based on the constant input values
 */

static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
{
	switch (var_size) {
	case 8:
		return UINT64_MAX;
	case 4:
		return UINT32_MAX;
	case 2:
		return UINT16_MAX;
	case 1:
		return UINT8_MAX;
	}

	return 0;
}

static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
{
	switch (var_size) {
	case 8:
		return INT64_MAX;
	case 4:
		return INT32_MAX;
	case 2:
		return INT16_MAX;
	case 1:
		return INT8_MAX;
	}

	return 0;
}

#include "librpc/gen_ndr/misc.h"
#include "librpc/gen_ndr/security.h"
#include "librpc/gen_ndr/winreg.h"
static PyTypeObject spoolss_Time_Type;
static PyTypeObject spoolss_TimeCtr_Type;
static PyTypeObject spoolss_PrinterInfo0_Type;
static PyTypeObject spoolss_PSDRVEXTRA351_Type;
static PyTypeObject spoolss_PSDRVEXTRA400_Type;
static PyTypeObject spoolss_PSDRVEXTRA500_Type;
static PyTypeObject spoolss_PSDRVEXTRA_Type;
static PyTypeObject spoolss_UNIDRVEXTRA3_4_Type;
static PyTypeObject spoolss_UNIDRVEXTRA500_Type;
static PyTypeObject spoolss_UNIDRVEXTRA_Type;
static PyTypeObject spoolss_JTEXP_Type;
static PyTypeObject spoolss_OEM_DMEXTRA_Type;
static PyTypeObject spoolss_DeviceModeExtraDataPostScript_Type;
static PyTypeObject spoolss_DeviceModeExtraDataUniDriver_Type;
static PyTypeObject spoolss_DeviceMode_Type;
static PyTypeObject spoolss_PrinterInfo1_Type;
static PyTypeObject spoolss_PrinterInfo2_Type;
static PyTypeObject spoolss_PrinterInfo3_Type;
static PyTypeObject spoolss_PrinterInfo4_Type;
static PyTypeObject spoolss_PrinterInfo5_Type;
static PyTypeObject spoolss_PrinterInfo6_Type;
static PyTypeObject spoolss_PrinterInfo7_Type;
static PyTypeObject spoolss_DeviceModeInfo_Type;
static PyTypeObject spoolss_PrinterInfo_Type;
static PyTypeObject spoolss_DevmodeContainer_Type;
static PyTypeObject spoolss_JobInfo1_Type;
static PyTypeObject spoolss_JobInfo2_Type;
static PyTypeObject spoolss_JobInfo3_Type;
static PyTypeObject spoolss_JobInfo4_Type;
static PyTypeObject spoolss_JobInfo_Type;
static PyTypeObject spoolss_SetJobInfo1_Type;
static PyTypeObject spoolss_SetJobInfo2_Type;
static PyTypeObject spoolss_SetJobInfo4_Type;
static PyTypeObject spoolss_SetJobInfo_Type;
static PyTypeObject spoolss_JobInfoContainer_Type;
static PyTypeObject spoolss_SetPrinterInfo0_Type;
static PyTypeObject spoolss_SetPrinterInfo1_Type;
static PyTypeObject spoolss_SetPrinterInfo2_Type;
static PyTypeObject spoolss_SetPrinterInfo3_Type;
static PyTypeObject spoolss_SetPrinterInfo4_Type;
static PyTypeObject spoolss_SetPrinterInfo5_Type;
static PyTypeObject spoolss_SetPrinterInfo6_Type;
static PyTypeObject spoolss_SetPrinterInfo7_Type;
static PyTypeObject spoolss_SetPrinterInfo8_Type;
static PyTypeObject spoolss_SetPrinterInfo9_Type;
static PyTypeObject spoolss_SetPrinterInfo_Type;
static PyTypeObject spoolss_SetPrinterInfoCtr_Type;
static PyTypeObject spoolss_StringArray_Type;
static PyTypeObject spoolss_AddDriverInfo1_Type;
static PyTypeObject spoolss_AddDriverInfo2_Type;
static PyTypeObject spoolss_AddDriverInfo3_Type;
static PyTypeObject spoolss_AddDriverInfo4_Type;
static PyTypeObject spoolss_AddDriverInfo5_Type;
static PyTypeObject spoolss_AddDriverInfo6_Type;
static PyTypeObject spoolss_AddDriverInfo8_Type;
static PyTypeObject spoolss_AddDriverInfo_Type;
static PyTypeObject spoolss_AddDriverInfoCtr_Type;
static PyTypeObject spoolss_DriverInfo1_Type;
static PyTypeObject spoolss_DriverInfo2_Type;
static PyTypeObject spoolss_DriverInfo3_Type;
static PyTypeObject spoolss_DriverInfo4_Type;
static PyTypeObject spoolss_DriverInfo5_Type;
static PyTypeObject spoolss_DriverInfo6_Type;
static PyTypeObject spoolss_DriverInfo7_Type;
static PyTypeObject spoolss_DriverInfo8_Type;
static PyTypeObject spoolss_DriverFileInfo_Type;
static PyTypeObject spoolss_DriverInfo101_Type;
static PyTypeObject spoolss_DriverInfo_Type;
static PyTypeObject spoolss_DriverDirectoryInfo1_Type;
static PyTypeObject spoolss_DriverDirectoryInfo_Type;
static PyTypeObject spoolss_PrintProcessorInfo1_Type;
static PyTypeObject spoolss_PrintProcessorInfo_Type;
static PyTypeObject spoolss_PrintProcessorDirectoryInfo1_Type;
static PyTypeObject spoolss_PrintProcessorDirectoryInfo_Type;
static PyTypeObject spoolss_DocumentInfo1_Type;
static PyTypeObject spoolss_DocumentInfo_Type;
static PyTypeObject spoolss_DocumentInfoCtr_Type;
static PyTypeObject spoolss_OSVersion_Type;
static PyTypeObject spoolss_OSVersionEx_Type;
static PyTypeObject spoolss_PrinterData_Type;
static PyTypeObject spoolss_FormSize_Type;
static PyTypeObject spoolss_FormArea_Type;
static PyTypeObject spoolss_FormInfo1_Type;
static PyTypeObject spoolss_FormInfo2_Type;
static PyTypeObject spoolss_FormInfo_Type;
static PyTypeObject spoolss_AddFormInfo1_Type;
static PyTypeObject spoolss_AddFormInfo2_Type;
static PyTypeObject spoolss_AddFormInfo_Type;
static PyTypeObject spoolss_AddFormInfoCtr_Type;
static PyTypeObject spoolss_PortInfo1_Type;
static PyTypeObject spoolss_PortInfo2_Type;
static PyTypeObject spoolss_PortInfo3_Type;
static PyTypeObject spoolss_PortInfoFF_Type;
static PyTypeObject spoolss_PortInfo_Type;
static PyTypeObject spoolss_MonitorInfo1_Type;
static PyTypeObject spoolss_MonitorInfo2_Type;
static PyTypeObject spoolss_MonitorInfo_Type;
static PyTypeObject spoolss_SetPortInfo1_Type;
static PyTypeObject spoolss_SetPortInfo2_Type;
static PyTypeObject spoolss_SetPortInfo3_Type;
static PyTypeObject spoolss_SetPortInfoFF_Type;
static PyTypeObject spoolss_SetPortInfo_Type;
static PyTypeObject spoolss_SetPortInfoContainer_Type;
static PyTypeObject UNIVERSAL_FONT_ID_Type;
static PyTypeObject UNIVERSAL_FONT_ID_ctr_Type;
static PyTypeObject spoolss_AddMonitorInfo1_Type;
static PyTypeObject spoolss_AddMonitorInfo2_Type;
static PyTypeObject spoolss_AddMonitorInfo_Type;
static PyTypeObject spoolss_MonitorContainer_Type;
static PyTypeObject spoolss_PrintProcDataTypesInfo1_Type;
static PyTypeObject spoolss_PrintProcDataTypesInfo_Type;
static PyTypeObject spoolss_PortVarContainer_Type;
static PyTypeObject spoolss_Field_Type;
static PyTypeObject spoolss_NotifyOptionType_Type;
static PyTypeObject spoolss_NotifyOption_Type;
static PyTypeObject spoolss_NotifyString_Type;
static PyTypeObject spoolss_NotifyData_Type;
static PyTypeObject spoolss_Notify_Type;
static PyTypeObject spoolss_NotifyInfo_Type;
static PyTypeObject spoolss_ReplyPrinterInfo_Type;
static PyTypeObject spoolss_UserLevel1_Type;
static PyTypeObject spoolss_UserLevel2_Type;
static PyTypeObject spoolss_UserLevel3_Type;
static PyTypeObject spoolss_UserLevel_Type;
static PyTypeObject spoolss_UserLevelCtr_Type;
static PyTypeObject spoolss_PrinterEnumValues_Type;
static PyTypeObject spoolss_KeyNames_Type;
static PyTypeObject spoolss_PortData1_Type;
static PyTypeObject spoolss_PortData2_Type;
static PyTypeObject spoolss_MonitorUi_Type;
static PyTypeObject RPC_BINARY_CONTAINER_Type;
static PyTypeObject RPC_BIDI_DATA_u_Type;
static PyTypeObject RPC_BIDI_DATA_Type;
static PyTypeObject RPC_BIDI_REQUEST_DATA_Type;
static PyTypeObject RPC_BIDI_REQUEST_CONTAINER_Type;
static PyTypeObject RPC_BIDI_RESPONSE_DATA_Type;
static PyTypeObject RPC_BIDI_RESPONSE_CONTAINER_Type;
static PyTypeObject spoolss_CorePrinterDriver_Type;
static PyTypeObject propertyBlob_Type;
static PyTypeObject spoolss_PrintPropertyValueUnion_Type;
static PyTypeObject spoolss_PrintPropertyValue_Type;
static PyTypeObject spoolss_PrintNamedProperty_Type;
static PyTypeObject spoolss_BranchOfficeJobDataPrinted_Type;
static PyTypeObject spoolss_BranchOfficeJobDataRendered_Type;
static PyTypeObject spoolss_BranchOfficeJobDataError_Type;
static PyTypeObject spoolss_BranchOfficeJobDataPipelineFailed_Type;
static PyTypeObject spoolss_BranchOfficeLogOfflineFileFull_Type;
static PyTypeObject spoolss_BranchOfficeJobInfo_Type;
static PyTypeObject spoolss_BranchOfficeJobData_Type;
static PyTypeObject spoolss_BranchOfficeJobDataContainer_Type;
static PyTypeObject spoolss_InterfaceType;
static PyTypeObject spoolss_EnumPrinters_Type;
static PyTypeObject spoolss_OpenPrinter_Type;
static PyTypeObject spoolss_SetJob_Type;
static PyTypeObject spoolss_GetJob_Type;
static PyTypeObject spoolss_EnumJobs_Type;
static PyTypeObject spoolss_AddPrinter_Type;
static PyTypeObject spoolss_DeletePrinter_Type;
static PyTypeObject spoolss_SetPrinter_Type;
static PyTypeObject spoolss_GetPrinter_Type;
static PyTypeObject spoolss_AddPrinterDriver_Type;
static PyTypeObject spoolss_EnumPrinterDrivers_Type;
static PyTypeObject spoolss_GetPrinterDriver_Type;
static PyTypeObject spoolss_GetPrinterDriverDirectory_Type;
static PyTypeObject spoolss_DeletePrinterDriver_Type;
static PyTypeObject spoolss_AddPrintProcessor_Type;
static PyTypeObject spoolss_EnumPrintProcessors_Type;
static PyTypeObject spoolss_GetPrintProcessorDirectory_Type;
static PyTypeObject spoolss_StartDocPrinter_Type;
static PyTypeObject spoolss_StartPagePrinter_Type;
static PyTypeObject spoolss_WritePrinter_Type;
static PyTypeObject spoolss_EndPagePrinter_Type;
static PyTypeObject spoolss_AbortPrinter_Type;
static PyTypeObject spoolss_ReadPrinter_Type;
static PyTypeObject spoolss_EndDocPrinter_Type;
static PyTypeObject spoolss_AddJob_Type;
static PyTypeObject spoolss_ScheduleJob_Type;
static PyTypeObject spoolss_GetPrinterData_Type;
static PyTypeObject spoolss_SetPrinterData_Type;
static PyTypeObject spoolss_ClosePrinter_Type;
static PyTypeObject spoolss_AddForm_Type;
static PyTypeObject spoolss_DeleteForm_Type;
static PyTypeObject spoolss_GetForm_Type;
static PyTypeObject spoolss_SetForm_Type;
static PyTypeObject spoolss_EnumForms_Type;
static PyTypeObject spoolss_EnumPorts_Type;
static PyTypeObject spoolss_EnumMonitors_Type;
static PyTypeObject spoolss_AddPort_Type;
static PyTypeObject spoolss_DeletePort_Type;
static PyTypeObject spoolss_CreatePrinterIC_Type;
static PyTypeObject spoolss_PlayGDIScriptOnPrinterIC_Type;
static PyTypeObject spoolss_DeletePrinterIC_Type;
static PyTypeObject spoolss_DeletePrintProcessor_Type;
static PyTypeObject spoolss_EnumPrintProcessorDataTypes_Type;
static PyTypeObject spoolss_ResetPrinter_Type;
static PyTypeObject spoolss_GetPrinterDriver2_Type;
static PyTypeObject spoolss_FindClosePrinterNotify_Type;
static PyTypeObject spoolss_ReplyOpenPrinter_Type;
static PyTypeObject spoolss_RouterReplyPrinter_Type;
static PyTypeObject spoolss_ReplyClosePrinter_Type;
static PyTypeObject spoolss_AddPortEx_Type;
static PyTypeObject spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type;
static PyTypeObject spoolss_RouterReplyPrinterEx_Type;
static PyTypeObject spoolss_RouterRefreshPrinterChangeNotify_Type;
static PyTypeObject spoolss_OpenPrinterEx_Type;
static PyTypeObject spoolss_AddPrinterEx_Type;
static PyTypeObject spoolss_SetPort_Type;
static PyTypeObject spoolss_EnumPrinterData_Type;
static PyTypeObject spoolss_DeletePrinterData_Type;
static PyTypeObject spoolss_SetPrinterDataEx_Type;
static PyTypeObject spoolss_GetPrinterDataEx_Type;
static PyTypeObject spoolss_EnumPrinterDataEx_Type;
static PyTypeObject spoolss_EnumPrinterKey_Type;
static PyTypeObject spoolss_DeletePrinterDataEx_Type;
static PyTypeObject spoolss_DeletePrinterKey_Type;
static PyTypeObject spoolss_DeletePrinterDriverEx_Type;
static PyTypeObject spoolss_AddPerMachineConnection_Type;
static PyTypeObject spoolss_DeletePerMachineConnection_Type;
static PyTypeObject spoolss_EnumPerMachineConnections_Type;
static PyTypeObject spoolss_XcvData_Type;
static PyTypeObject spoolss_AddPrinterDriverEx_Type;
static PyTypeObject spoolss_SendRecvBidiData_Type;
static PyTypeObject spoolss_GetCorePrinterDrivers_Type;
static PyTypeObject spoolss_GetPrinterDriverPackagePath_Type;
static PyTypeObject spoolss_GetJobNamedPropertyValue_Type;
static PyTypeObject spoolss_SetJobNamedProperty_Type;
static PyTypeObject spoolss_DeleteJobNamedProperty_Type;
static PyTypeObject spoolss_EnumJobNamedProperties_Type;
static PyTypeObject spoolss_LogJobInfoForBranchOffice_Type;

static PyTypeObject *BaseObject_Type;
static PyTypeObject *security_descriptor_Type;
static PyTypeObject *sec_desc_buf_Type;
static PyTypeObject *GUID_Type;
static PyTypeObject *policy_handle_Type;
static PyTypeObject *ClientConnection_Type;
static PyTypeObject *ndr_syntax_id_Type;

static PyObject *py_spoolss_Time_get_year(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_year;
	py_year = PyLong_FromLong((uint16_t)(object->year));
	return py_year;
}

static int py_spoolss_Time_set_year(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->year");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->year));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->year = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_month(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_month;
	py_month = PyLong_FromLong((uint16_t)(object->month));
	return py_month;
}

static int py_spoolss_Time_set_month(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->month");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->month));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->month = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_day_of_week(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_day_of_week;
	py_day_of_week = PyLong_FromLong((uint16_t)(object->day_of_week));
	return py_day_of_week;
}

static int py_spoolss_Time_set_day_of_week(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->day_of_week");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->day_of_week));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->day_of_week = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_day(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_day;
	py_day = PyLong_FromLong((uint16_t)(object->day));
	return py_day;
}

static int py_spoolss_Time_set_day(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->day");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->day));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->day = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_hour(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_hour;
	py_hour = PyLong_FromLong((uint16_t)(object->hour));
	return py_hour;
}

static int py_spoolss_Time_set_hour(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hour");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->hour));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->hour = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_minute(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_minute;
	py_minute = PyLong_FromLong((uint16_t)(object->minute));
	return py_minute;
}

static int py_spoolss_Time_set_minute(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minute");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minute));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->minute = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_second(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_second;
	py_second = PyLong_FromLong((uint16_t)(object->second));
	return py_second;
}

static int py_spoolss_Time_set_second(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->second");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->second));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->second = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Time_get_millisecond(PyObject *obj, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(obj);
	PyObject *py_millisecond;
	py_millisecond = PyLong_FromLong((uint16_t)(object->millisecond));
	return py_millisecond;
}

static int py_spoolss_Time_set_millisecond(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Time *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->millisecond");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->millisecond));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->millisecond = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_Time_getsetters[] = {
	{
		.name = discard_const_p(char, "year"),
		.get = py_spoolss_Time_get_year,
		.set = py_spoolss_Time_set_year,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "month"),
		.get = py_spoolss_Time_get_month,
		.set = py_spoolss_Time_set_month,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "day_of_week"),
		.get = py_spoolss_Time_get_day_of_week,
		.set = py_spoolss_Time_set_day_of_week,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "day"),
		.get = py_spoolss_Time_get_day,
		.set = py_spoolss_Time_set_day,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "hour"),
		.get = py_spoolss_Time_get_hour,
		.set = py_spoolss_Time_set_hour,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "minute"),
		.get = py_spoolss_Time_get_minute,
		.set = py_spoolss_Time_set_minute,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "second"),
		.get = py_spoolss_Time_get_second,
		.set = py_spoolss_Time_set_second,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "millisecond"),
		.get = py_spoolss_Time_get_millisecond,
		.set = py_spoolss_Time_set_millisecond,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_Time_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_Time, type);
}


static PyTypeObject spoolss_Time_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.Time",
	.tp_getset = py_spoolss_Time_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_Time_new,
};


static PyObject *py_spoolss_TimeCtr_get_size(PyObject *obj, void *closure)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_TimeCtr_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_TimeCtr_get_time(PyObject *obj, void *closure)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	if (object->time == NULL) {
		Py_RETURN_NONE;
	}
	if (object->time == NULL) {
		py_time = Py_None;
		Py_INCREF(py_time);
	} else {
		py_time = pytalloc_reference_ex(&spoolss_Time_Type, object->time, object->time);
	}
	return py_time;
}

static int py_spoolss_TimeCtr_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->time));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	if (value == Py_None) {
		object->time = NULL;
	} else {
		object->time = NULL;
		PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->time = (struct spoolss_Time *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_TimeCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_TimeCtr_get_size,
		.set = py_spoolss_TimeCtr_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_TimeCtr_get_time,
		.set = py_spoolss_TimeCtr_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_TimeCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_TimeCtr, type);
}

static PyObject *py_spoolss_TimeCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_TimeCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_TimeCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_TimeCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_TimeCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_TimeCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_TimeCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_TimeCtr, "spoolss_TimeCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_TimeCtr, "spoolss_TimeCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_TimeCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_TimeCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_TimeCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_TimeCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_TimeCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.TimeCtr",
	.tp_getset = py_spoolss_TimeCtr_getsetters,
	.tp_methods = py_spoolss_TimeCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_TimeCtr_new,
};


static PyObject *py_spoolss_PrinterInfo0_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyString_FromStringOrNULL(object->printername);
	}
	return py_printername;
}

static int py_spoolss_PrinterInfo0_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		py_servername = PyString_FromStringOrNULL(object->servername);
	}
	return py_servername;
}

static int py_spoolss_PrinterInfo0_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_cjobs(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_cjobs;
	py_cjobs = PyLong_FromUnsignedLongLong((uint32_t)(object->cjobs));
	return py_cjobs;
}

static int py_spoolss_PrinterInfo0_set_cjobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cjobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cjobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_total_jobs(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_jobs;
	py_total_jobs = PyLong_FromUnsignedLongLong((uint32_t)(object->total_jobs));
	return py_total_jobs;
}

static int py_spoolss_PrinterInfo0_set_total_jobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_jobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_jobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_jobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_total_bytes(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_bytes;
	py_total_bytes = PyLong_FromUnsignedLongLong((uint32_t)(object->total_bytes));
	return py_total_bytes;
}

static int py_spoolss_PrinterInfo0_set_total_bytes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_bytes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_bytes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_bytes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_time(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->time);
	return py_time;
}

static int py_spoolss_PrinterInfo0_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->time = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_global_counter(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_global_counter;
	py_global_counter = PyLong_FromUnsignedLongLong((uint32_t)(object->global_counter));
	return py_global_counter;
}

static int py_spoolss_PrinterInfo0_set_global_counter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->global_counter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->global_counter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->global_counter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_PrinterInfo0_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_version(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_PrinterInfo0_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_free_build(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_free_build;
	py_free_build = PyLong_FromUnsignedLongLong((uint32_t)(object->free_build));
	return py_free_build;
}

static int py_spoolss_PrinterInfo0_set_free_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->free_build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->free_build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->free_build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_spooling(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_spooling;
	py_spooling = PyLong_FromUnsignedLongLong((uint32_t)(object->spooling));
	return py_spooling;
}

static int py_spoolss_PrinterInfo0_set_spooling(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->spooling");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->spooling));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->spooling = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_max_spooling(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_max_spooling;
	py_max_spooling = PyLong_FromUnsignedLongLong((uint32_t)(object->max_spooling));
	return py_max_spooling;
}

static int py_spoolss_PrinterInfo0_set_max_spooling(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_spooling");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_spooling));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->max_spooling = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_session_counter(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_session_counter;
	py_session_counter = PyLong_FromUnsignedLongLong((uint32_t)(object->session_counter));
	return py_session_counter;
}

static int py_spoolss_PrinterInfo0_set_session_counter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->session_counter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_counter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->session_counter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_num_error_out_of_paper(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_num_error_out_of_paper;
	py_num_error_out_of_paper = PyLong_FromUnsignedLongLong((uint32_t)(object->num_error_out_of_paper));
	return py_num_error_out_of_paper;
}

static int py_spoolss_PrinterInfo0_set_num_error_out_of_paper(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_error_out_of_paper");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_error_out_of_paper));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->num_error_out_of_paper = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_num_error_not_ready(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_num_error_not_ready;
	py_num_error_not_ready = PyLong_FromUnsignedLongLong((uint32_t)(object->num_error_not_ready));
	return py_num_error_not_ready;
}

static int py_spoolss_PrinterInfo0_set_num_error_not_ready(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_error_not_ready");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_error_not_ready));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->num_error_not_ready = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_job_error(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_error;
	py_job_error = PyLong_FromUnsignedLongLong((uint32_t)(object->job_error));
	return py_job_error;
}

static int py_spoolss_PrinterInfo0_set_job_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_error");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_error));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_error = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_number_of_processors(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_number_of_processors;
	py_number_of_processors = PyLong_FromUnsignedLongLong((uint32_t)(object->number_of_processors));
	return py_number_of_processors;
}

static int py_spoolss_PrinterInfo0_set_number_of_processors(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_of_processors");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_processors));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->number_of_processors = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_processor_type(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_type;
	py_processor_type = PyLong_FromUnsignedLongLong((uint32_t)(object->processor_type));
	return py_processor_type;
}

static int py_spoolss_PrinterInfo0_set_processor_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_high_part_total_bytes(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_high_part_total_bytes;
	py_high_part_total_bytes = PyLong_FromUnsignedLongLong((uint32_t)(object->high_part_total_bytes));
	return py_high_part_total_bytes;
}

static int py_spoolss_PrinterInfo0_set_high_part_total_bytes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->high_part_total_bytes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high_part_total_bytes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->high_part_total_bytes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_change_id(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_change_id;
	py_change_id = PyLong_FromUnsignedLongLong((uint32_t)(object->change_id));
	return py_change_id;
}

static int py_spoolss_PrinterInfo0_set_change_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->change_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->change_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->change_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_last_error(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_last_error;
	py_last_error = PyErr_FromWERROR(object->last_error);
	return py_last_error;
}

static int py_spoolss_PrinterInfo0_set_last_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->last_error");
		return -1;
	}
	object->last_error = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_status(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_PrinterInfo0_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_enumerate_network_printers(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_enumerate_network_printers;
	py_enumerate_network_printers = PyLong_FromUnsignedLongLong((uint32_t)(object->enumerate_network_printers));
	return py_enumerate_network_printers;
}

static int py_spoolss_PrinterInfo0_set_enumerate_network_printers(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->enumerate_network_printers");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enumerate_network_printers));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->enumerate_network_printers = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_c_setprinter(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_c_setprinter;
	py_c_setprinter = PyLong_FromUnsignedLongLong((uint32_t)(object->c_setprinter));
	return py_c_setprinter;
}

static int py_spoolss_PrinterInfo0_set_c_setprinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->c_setprinter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->c_setprinter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->c_setprinter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_processor_architecture(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_architecture;
	py_processor_architecture = PyLong_FromLong((uint16_t)(object->processor_architecture));
	return py_processor_architecture;
}

static int py_spoolss_PrinterInfo0_set_processor_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_architecture");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_architecture));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_architecture = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_processor_level(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_level;
	py_processor_level = PyLong_FromLong((uint16_t)(object->processor_level));
	return py_processor_level;
}

static int py_spoolss_PrinterInfo0_set_processor_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_ref_ic(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_ref_ic;
	py_ref_ic = PyLong_FromUnsignedLongLong((uint32_t)(object->ref_ic));
	return py_ref_ic;
}

static int py_spoolss_PrinterInfo0_set_ref_ic(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ref_ic");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ref_ic));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ref_ic = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_reserved2(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved2;
	py_reserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved2));
	return py_reserved2;
}

static int py_spoolss_PrinterInfo0_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo0_get_reserved3(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved3;
	py_reserved3 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved3));
	return py_reserved3;
}

static int py_spoolss_PrinterInfo0_set_reserved3(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved3");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved3));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved3 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo0_getsetters[] = {
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_PrinterInfo0_get_printername,
		.set = py_spoolss_PrinterInfo0_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_PrinterInfo0_get_servername,
		.set = py_spoolss_PrinterInfo0_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "cjobs"),
		.get = py_spoolss_PrinterInfo0_get_cjobs,
		.set = py_spoolss_PrinterInfo0_set_cjobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_jobs"),
		.get = py_spoolss_PrinterInfo0_get_total_jobs,
		.set = py_spoolss_PrinterInfo0_set_total_jobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_bytes"),
		.get = py_spoolss_PrinterInfo0_get_total_bytes,
		.set = py_spoolss_PrinterInfo0_set_total_bytes,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_PrinterInfo0_get_time,
		.set = py_spoolss_PrinterInfo0_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "global_counter"),
		.get = py_spoolss_PrinterInfo0_get_global_counter,
		.set = py_spoolss_PrinterInfo0_set_global_counter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_PrinterInfo0_get_total_pages,
		.set = py_spoolss_PrinterInfo0_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_PrinterInfo0_get_version,
		.set = py_spoolss_PrinterInfo0_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "free_build"),
		.get = py_spoolss_PrinterInfo0_get_free_build,
		.set = py_spoolss_PrinterInfo0_set_free_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Build")
	},
	{
		.name = discard_const_p(char, "spooling"),
		.get = py_spoolss_PrinterInfo0_get_spooling,
		.set = py_spoolss_PrinterInfo0_set_spooling,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "max_spooling"),
		.get = py_spoolss_PrinterInfo0_get_max_spooling,
		.set = py_spoolss_PrinterInfo0_set_max_spooling,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "session_counter"),
		.get = py_spoolss_PrinterInfo0_get_session_counter,
		.set = py_spoolss_PrinterInfo0_set_session_counter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "num_error_out_of_paper"),
		.get = py_spoolss_PrinterInfo0_get_num_error_out_of_paper,
		.set = py_spoolss_PrinterInfo0_set_num_error_out_of_paper,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "num_error_not_ready"),
		.get = py_spoolss_PrinterInfo0_get_num_error_not_ready,
		.set = py_spoolss_PrinterInfo0_set_num_error_not_ready,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "job_error"),
		.get = py_spoolss_PrinterInfo0_get_job_error,
		.set = py_spoolss_PrinterInfo0_set_job_error,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "number_of_processors"),
		.get = py_spoolss_PrinterInfo0_get_number_of_processors,
		.set = py_spoolss_PrinterInfo0_set_number_of_processors,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "processor_type"),
		.get = py_spoolss_PrinterInfo0_get_processor_type,
		.set = py_spoolss_PrinterInfo0_set_processor_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorType")
	},
	{
		.name = discard_const_p(char, "high_part_total_bytes"),
		.get = py_spoolss_PrinterInfo0_get_high_part_total_bytes,
		.set = py_spoolss_PrinterInfo0_set_high_part_total_bytes,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "change_id"),
		.get = py_spoolss_PrinterInfo0_get_change_id,
		.set = py_spoolss_PrinterInfo0_set_change_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "last_error"),
		.get = py_spoolss_PrinterInfo0_get_last_error,
		.set = py_spoolss_PrinterInfo0_set_last_error,
		.doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_PrinterInfo0_get_status,
		.set = py_spoolss_PrinterInfo0_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{
		.name = discard_const_p(char, "enumerate_network_printers"),
		.get = py_spoolss_PrinterInfo0_get_enumerate_network_printers,
		.set = py_spoolss_PrinterInfo0_set_enumerate_network_printers,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "c_setprinter"),
		.get = py_spoolss_PrinterInfo0_get_c_setprinter,
		.set = py_spoolss_PrinterInfo0_set_c_setprinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "processor_architecture"),
		.get = py_spoolss_PrinterInfo0_get_processor_architecture,
		.set = py_spoolss_PrinterInfo0_set_processor_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorArchitecture")
	},
	{
		.name = discard_const_p(char, "processor_level"),
		.get = py_spoolss_PrinterInfo0_get_processor_level,
		.set = py_spoolss_PrinterInfo0_set_processor_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ref_ic"),
		.get = py_spoolss_PrinterInfo0_get_ref_ic,
		.set = py_spoolss_PrinterInfo0_set_ref_ic,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved2"),
		.get = py_spoolss_PrinterInfo0_get_reserved2,
		.set = py_spoolss_PrinterInfo0_set_reserved2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved3"),
		.get = py_spoolss_PrinterInfo0_get_reserved3,
		.set = py_spoolss_PrinterInfo0_set_reserved3,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo0, type);
}

static PyObject *py_spoolss_PrinterInfo0_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo0);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo0_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo0);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo0);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo0_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo0, "spoolss_PrinterInfo0", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo0, "spoolss_PrinterInfo0", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo0_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo0_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo0_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo0_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo0_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo0",
	.tp_getset = py_spoolss_PrinterInfo0_getsetters,
	.tp_methods = py_spoolss_PrinterInfo0_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo0_new,
};


static PyObject *py_spoolss_PSDRVEXTRA351_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_PSDRVEXTRA351_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_PSDRVEXTRA351_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_wchEPSFile(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_wchEPSFile;
	py_wchEPSFile = PyList_New(12);
	if (py_wchEPSFile == NULL) {
		return NULL;
	}
	{
		int wchEPSFile_cntr_0;
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < (12); wchEPSFile_cntr_0++) {
			PyObject *py_wchEPSFile_0;
			py_wchEPSFile_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->wchEPSFile)[wchEPSFile_cntr_0]));
			PyList_SetItem(py_wchEPSFile, wchEPSFile_cntr_0, py_wchEPSFile_0);
		}
	}
	return py_wchEPSFile;
}

static int py_spoolss_PSDRVEXTRA351_set_wchEPSFile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wchEPSFile");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wchEPSFile_cntr_0;
		if (ARRAY_SIZE(object->wchEPSFile) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wchEPSFile),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < PyList_GET_SIZE(value); wchEPSFile_cntr_0++) {
			if (PyList_GET_ITEM(value, wchEPSFile_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wchEPSFile)[wchEPSFile_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wchEPSFile)[wchEPSFile_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wchEPSFile_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wchEPSFile_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wchEPSFile)[wchEPSFile_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caSize;
	py_caSize = PyLong_FromLong((uint16_t)(object->caSize));
	return py_caSize;
}

static int py_spoolss_PSDRVEXTRA351_set_caSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caFlags;
	py_caFlags = PyLong_FromLong((uint16_t)(object->caFlags));
	return py_caFlags;
}

static int py_spoolss_PSDRVEXTRA351_set_caFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caIlluminantIndex(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caIlluminantIndex;
	py_caIlluminantIndex = PyLong_FromLong((uint16_t)(object->caIlluminantIndex));
	return py_caIlluminantIndex;
}

static int py_spoolss_PSDRVEXTRA351_set_caIlluminantIndex(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caIlluminantIndex");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caIlluminantIndex));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caIlluminantIndex = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caRedGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGamma;
	py_caRedGamma = PyLong_FromLong((uint16_t)(object->caRedGamma));
	return py_caRedGamma;
}

static int py_spoolss_PSDRVEXTRA351_set_caRedGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caGreenGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caGreenGamma;
	py_caGreenGamma = PyLong_FromLong((uint16_t)(object->caGreenGamma));
	return py_caGreenGamma;
}

static int py_spoolss_PSDRVEXTRA351_set_caGreenGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caGreenGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caGreenGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caGreenGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caBlueGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBlueGamma;
	py_caBlueGamma = PyLong_FromLong((uint16_t)(object->caBlueGamma));
	return py_caBlueGamma;
}

static int py_spoolss_PSDRVEXTRA351_set_caBlueGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBlueGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBlueGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBlueGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caReferenceBlack(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceBlack;
	py_caReferenceBlack = PyLong_FromLong((uint16_t)(object->caReferenceBlack));
	return py_caReferenceBlack;
}

static int py_spoolss_PSDRVEXTRA351_set_caReferenceBlack(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceBlack");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceBlack));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceBlack = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caReferenceWhite(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceWhite;
	py_caReferenceWhite = PyLong_FromLong((uint16_t)(object->caReferenceWhite));
	return py_caReferenceWhite;
}

static int py_spoolss_PSDRVEXTRA351_set_caReferenceWhite(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceWhite");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceWhite));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceWhite = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caContrast(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caContrast;
	py_caContrast = PyLong_FromLong((uint16_t)(object->caContrast));
	return py_caContrast;
}

static int py_spoolss_PSDRVEXTRA351_set_caContrast(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caContrast");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caContrast));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caContrast = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caBrightness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBrightness;
	py_caBrightness = PyLong_FromLong((uint16_t)(object->caBrightness));
	return py_caBrightness;
}

static int py_spoolss_PSDRVEXTRA351_set_caBrightness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBrightness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBrightness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBrightness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caColorfulness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caColorfulness;
	py_caColorfulness = PyLong_FromLong((uint16_t)(object->caColorfulness));
	return py_caColorfulness;
}

static int py_spoolss_PSDRVEXTRA351_set_caColorfulness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caColorfulness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caColorfulness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caColorfulness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA351_get_caRedGreenTint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGreenTint;
	py_caRedGreenTint = PyLong_FromLong((uint16_t)(object->caRedGreenTint));
	return py_caRedGreenTint;
}

static int py_spoolss_PSDRVEXTRA351_set_caRedGreenTint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA351 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGreenTint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGreenTint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGreenTint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PSDRVEXTRA351_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_PSDRVEXTRA351_get_dwSignature,
		.set = py_spoolss_PSDRVEXTRA351_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_PSDRVEXTRA351_get_dwFlags,
		.set = py_spoolss_PSDRVEXTRA351_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Flags")
	},
	{
		.name = discard_const_p(char, "wchEPSFile"),
		.get = py_spoolss_PSDRVEXTRA351_get_wchEPSFile,
		.set = py_spoolss_PSDRVEXTRA351_set_wchEPSFile,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "caSize"),
		.get = py_spoolss_PSDRVEXTRA351_get_caSize,
		.set = py_spoolss_PSDRVEXTRA351_set_caSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caFlags"),
		.get = py_spoolss_PSDRVEXTRA351_get_caFlags,
		.set = py_spoolss_PSDRVEXTRA351_set_caFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caIlluminantIndex"),
		.get = py_spoolss_PSDRVEXTRA351_get_caIlluminantIndex,
		.set = py_spoolss_PSDRVEXTRA351_set_caIlluminantIndex,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGamma"),
		.get = py_spoolss_PSDRVEXTRA351_get_caRedGamma,
		.set = py_spoolss_PSDRVEXTRA351_set_caRedGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caGreenGamma"),
		.get = py_spoolss_PSDRVEXTRA351_get_caGreenGamma,
		.set = py_spoolss_PSDRVEXTRA351_set_caGreenGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBlueGamma"),
		.get = py_spoolss_PSDRVEXTRA351_get_caBlueGamma,
		.set = py_spoolss_PSDRVEXTRA351_set_caBlueGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceBlack"),
		.get = py_spoolss_PSDRVEXTRA351_get_caReferenceBlack,
		.set = py_spoolss_PSDRVEXTRA351_set_caReferenceBlack,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceWhite"),
		.get = py_spoolss_PSDRVEXTRA351_get_caReferenceWhite,
		.set = py_spoolss_PSDRVEXTRA351_set_caReferenceWhite,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caContrast"),
		.get = py_spoolss_PSDRVEXTRA351_get_caContrast,
		.set = py_spoolss_PSDRVEXTRA351_set_caContrast,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBrightness"),
		.get = py_spoolss_PSDRVEXTRA351_get_caBrightness,
		.set = py_spoolss_PSDRVEXTRA351_set_caBrightness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caColorfulness"),
		.get = py_spoolss_PSDRVEXTRA351_get_caColorfulness,
		.set = py_spoolss_PSDRVEXTRA351_set_caColorfulness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGreenTint"),
		.get = py_spoolss_PSDRVEXTRA351_get_caRedGreenTint,
		.set = py_spoolss_PSDRVEXTRA351_set_caRedGreenTint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PSDRVEXTRA351_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PSDRVEXTRA351, type);
}


static PyTypeObject spoolss_PSDRVEXTRA351_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PSDRVEXTRA351",
	.tp_getset = py_spoolss_PSDRVEXTRA351_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PSDRVEXTRA351_new,
};


static PyObject *py_spoolss_PSDRVEXTRA400_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_PSDRVEXTRA400_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_PSDRVEXTRA400_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_wchEPSFile(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_wchEPSFile;
	py_wchEPSFile = PyList_New(12);
	if (py_wchEPSFile == NULL) {
		return NULL;
	}
	{
		int wchEPSFile_cntr_0;
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < (12); wchEPSFile_cntr_0++) {
			PyObject *py_wchEPSFile_0;
			py_wchEPSFile_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->wchEPSFile)[wchEPSFile_cntr_0]));
			PyList_SetItem(py_wchEPSFile, wchEPSFile_cntr_0, py_wchEPSFile_0);
		}
	}
	return py_wchEPSFile;
}

static int py_spoolss_PSDRVEXTRA400_set_wchEPSFile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wchEPSFile");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wchEPSFile_cntr_0;
		if (ARRAY_SIZE(object->wchEPSFile) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wchEPSFile),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < PyList_GET_SIZE(value); wchEPSFile_cntr_0++) {
			if (PyList_GET_ITEM(value, wchEPSFile_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wchEPSFile)[wchEPSFile_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wchEPSFile)[wchEPSFile_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wchEPSFile_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wchEPSFile_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wchEPSFile)[wchEPSFile_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caSize;
	py_caSize = PyLong_FromLong((uint16_t)(object->caSize));
	return py_caSize;
}

static int py_spoolss_PSDRVEXTRA400_set_caSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caFlags;
	py_caFlags = PyLong_FromLong((uint16_t)(object->caFlags));
	return py_caFlags;
}

static int py_spoolss_PSDRVEXTRA400_set_caFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caIlluminantIndex(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caIlluminantIndex;
	py_caIlluminantIndex = PyLong_FromLong((uint16_t)(object->caIlluminantIndex));
	return py_caIlluminantIndex;
}

static int py_spoolss_PSDRVEXTRA400_set_caIlluminantIndex(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caIlluminantIndex");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caIlluminantIndex));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caIlluminantIndex = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caRedGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGamma;
	py_caRedGamma = PyLong_FromLong((uint16_t)(object->caRedGamma));
	return py_caRedGamma;
}

static int py_spoolss_PSDRVEXTRA400_set_caRedGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caGreenGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caGreenGamma;
	py_caGreenGamma = PyLong_FromLong((uint16_t)(object->caGreenGamma));
	return py_caGreenGamma;
}

static int py_spoolss_PSDRVEXTRA400_set_caGreenGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caGreenGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caGreenGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caGreenGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caBlueGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBlueGamma;
	py_caBlueGamma = PyLong_FromLong((uint16_t)(object->caBlueGamma));
	return py_caBlueGamma;
}

static int py_spoolss_PSDRVEXTRA400_set_caBlueGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBlueGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBlueGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBlueGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caReferenceBlack(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceBlack;
	py_caReferenceBlack = PyLong_FromLong((uint16_t)(object->caReferenceBlack));
	return py_caReferenceBlack;
}

static int py_spoolss_PSDRVEXTRA400_set_caReferenceBlack(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceBlack");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceBlack));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceBlack = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caReferenceWhite(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceWhite;
	py_caReferenceWhite = PyLong_FromLong((uint16_t)(object->caReferenceWhite));
	return py_caReferenceWhite;
}

static int py_spoolss_PSDRVEXTRA400_set_caReferenceWhite(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceWhite");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceWhite));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceWhite = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caContrast(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caContrast;
	py_caContrast = PyLong_FromLong((uint16_t)(object->caContrast));
	return py_caContrast;
}

static int py_spoolss_PSDRVEXTRA400_set_caContrast(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caContrast");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caContrast));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caContrast = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caBrightness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBrightness;
	py_caBrightness = PyLong_FromLong((uint16_t)(object->caBrightness));
	return py_caBrightness;
}

static int py_spoolss_PSDRVEXTRA400_set_caBrightness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBrightness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBrightness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBrightness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caColorfulness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caColorfulness;
	py_caColorfulness = PyLong_FromLong((uint16_t)(object->caColorfulness));
	return py_caColorfulness;
}

static int py_spoolss_PSDRVEXTRA400_set_caColorfulness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caColorfulness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caColorfulness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caColorfulness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_caRedGreenTint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGreenTint;
	py_caRedGreenTint = PyLong_FromLong((uint16_t)(object->caRedGreenTint));
	return py_caRedGreenTint;
}

static int py_spoolss_PSDRVEXTRA400_set_caRedGreenTint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGreenTint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGreenTint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGreenTint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_wChecksum(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_wChecksum;
	py_wChecksum = PyLong_FromLong((uint16_t)(object->wChecksum));
	return py_wChecksum;
}

static int py_spoolss_PSDRVEXTRA400_set_wChecksum(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wChecksum");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wChecksum));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wChecksum = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_wOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_wOptions;
	py_wOptions = PyLong_FromLong((uint16_t)(object->wOptions));
	return py_wOptions;
}

static int py_spoolss_PSDRVEXTRA400_set_wOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wOptions");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wOptions));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wOptions = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA400_get_aubOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(obj);
	PyObject *py_aubOptions;
	py_aubOptions = PyList_New(8);
	if (py_aubOptions == NULL) {
		return NULL;
	}
	{
		int aubOptions_cntr_0;
		for (aubOptions_cntr_0 = 0; aubOptions_cntr_0 < (8); aubOptions_cntr_0++) {
			PyObject *py_aubOptions_0;
			py_aubOptions_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->aubOptions)[aubOptions_cntr_0]));
			PyList_SetItem(py_aubOptions, aubOptions_cntr_0, py_aubOptions_0);
		}
	}
	return py_aubOptions;
}

static int py_spoolss_PSDRVEXTRA400_set_aubOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA400 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aubOptions");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aubOptions_cntr_0;
		if (ARRAY_SIZE(object->aubOptions) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->aubOptions),  PyList_GET_SIZE(value));
			return -1;
		}
		for (aubOptions_cntr_0 = 0; aubOptions_cntr_0 < PyList_GET_SIZE(value); aubOptions_cntr_0++) {
			if (PyList_GET_ITEM(value, aubOptions_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aubOptions)[aubOptions_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->aubOptions)[aubOptions_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, aubOptions_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, aubOptions_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->aubOptions)[aubOptions_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PSDRVEXTRA400_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_PSDRVEXTRA400_get_dwSignature,
		.set = py_spoolss_PSDRVEXTRA400_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_PSDRVEXTRA400_get_dwFlags,
		.set = py_spoolss_PSDRVEXTRA400_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Flags")
	},
	{
		.name = discard_const_p(char, "wchEPSFile"),
		.get = py_spoolss_PSDRVEXTRA400_get_wchEPSFile,
		.set = py_spoolss_PSDRVEXTRA400_set_wchEPSFile,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "caSize"),
		.get = py_spoolss_PSDRVEXTRA400_get_caSize,
		.set = py_spoolss_PSDRVEXTRA400_set_caSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caFlags"),
		.get = py_spoolss_PSDRVEXTRA400_get_caFlags,
		.set = py_spoolss_PSDRVEXTRA400_set_caFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caIlluminantIndex"),
		.get = py_spoolss_PSDRVEXTRA400_get_caIlluminantIndex,
		.set = py_spoolss_PSDRVEXTRA400_set_caIlluminantIndex,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGamma"),
		.get = py_spoolss_PSDRVEXTRA400_get_caRedGamma,
		.set = py_spoolss_PSDRVEXTRA400_set_caRedGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caGreenGamma"),
		.get = py_spoolss_PSDRVEXTRA400_get_caGreenGamma,
		.set = py_spoolss_PSDRVEXTRA400_set_caGreenGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBlueGamma"),
		.get = py_spoolss_PSDRVEXTRA400_get_caBlueGamma,
		.set = py_spoolss_PSDRVEXTRA400_set_caBlueGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceBlack"),
		.get = py_spoolss_PSDRVEXTRA400_get_caReferenceBlack,
		.set = py_spoolss_PSDRVEXTRA400_set_caReferenceBlack,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceWhite"),
		.get = py_spoolss_PSDRVEXTRA400_get_caReferenceWhite,
		.set = py_spoolss_PSDRVEXTRA400_set_caReferenceWhite,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caContrast"),
		.get = py_spoolss_PSDRVEXTRA400_get_caContrast,
		.set = py_spoolss_PSDRVEXTRA400_set_caContrast,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBrightness"),
		.get = py_spoolss_PSDRVEXTRA400_get_caBrightness,
		.set = py_spoolss_PSDRVEXTRA400_set_caBrightness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caColorfulness"),
		.get = py_spoolss_PSDRVEXTRA400_get_caColorfulness,
		.set = py_spoolss_PSDRVEXTRA400_set_caColorfulness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGreenTint"),
		.get = py_spoolss_PSDRVEXTRA400_get_caRedGreenTint,
		.set = py_spoolss_PSDRVEXTRA400_set_caRedGreenTint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wChecksum"),
		.get = py_spoolss_PSDRVEXTRA400_get_wChecksum,
		.set = py_spoolss_PSDRVEXTRA400_set_wChecksum,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wOptions"),
		.get = py_spoolss_PSDRVEXTRA400_get_wOptions,
		.set = py_spoolss_PSDRVEXTRA400_set_wOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "aubOptions"),
		.get = py_spoolss_PSDRVEXTRA400_get_aubOptions,
		.set = py_spoolss_PSDRVEXTRA400_set_aubOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PSDRVEXTRA400_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PSDRVEXTRA400, type);
}


static PyTypeObject spoolss_PSDRVEXTRA400_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PSDRVEXTRA400",
	.tp_getset = py_spoolss_PSDRVEXTRA400_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PSDRVEXTRA400_new,
};


static PyObject *py_spoolss_PSDRVEXTRA500_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_PSDRVEXTRA500_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_PSDRVEXTRA500_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wchEPSFile(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wchEPSFile;
	py_wchEPSFile = PyList_New(12);
	if (py_wchEPSFile == NULL) {
		return NULL;
	}
	{
		int wchEPSFile_cntr_0;
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < (12); wchEPSFile_cntr_0++) {
			PyObject *py_wchEPSFile_0;
			py_wchEPSFile_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->wchEPSFile)[wchEPSFile_cntr_0]));
			PyList_SetItem(py_wchEPSFile, wchEPSFile_cntr_0, py_wchEPSFile_0);
		}
	}
	return py_wchEPSFile;
}

static int py_spoolss_PSDRVEXTRA500_set_wchEPSFile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wchEPSFile");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wchEPSFile_cntr_0;
		if (ARRAY_SIZE(object->wchEPSFile) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wchEPSFile),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < PyList_GET_SIZE(value); wchEPSFile_cntr_0++) {
			if (PyList_GET_ITEM(value, wchEPSFile_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wchEPSFile)[wchEPSFile_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wchEPSFile)[wchEPSFile_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wchEPSFile_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wchEPSFile_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wchEPSFile)[wchEPSFile_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caSize;
	py_caSize = PyLong_FromLong((uint16_t)(object->caSize));
	return py_caSize;
}

static int py_spoolss_PSDRVEXTRA500_set_caSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caFlags;
	py_caFlags = PyLong_FromLong((uint16_t)(object->caFlags));
	return py_caFlags;
}

static int py_spoolss_PSDRVEXTRA500_set_caFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caIlluminantIndex(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caIlluminantIndex;
	py_caIlluminantIndex = PyLong_FromLong((uint16_t)(object->caIlluminantIndex));
	return py_caIlluminantIndex;
}

static int py_spoolss_PSDRVEXTRA500_set_caIlluminantIndex(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caIlluminantIndex");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caIlluminantIndex));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caIlluminantIndex = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caRedGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGamma;
	py_caRedGamma = PyLong_FromLong((uint16_t)(object->caRedGamma));
	return py_caRedGamma;
}

static int py_spoolss_PSDRVEXTRA500_set_caRedGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caGreenGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caGreenGamma;
	py_caGreenGamma = PyLong_FromLong((uint16_t)(object->caGreenGamma));
	return py_caGreenGamma;
}

static int py_spoolss_PSDRVEXTRA500_set_caGreenGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caGreenGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caGreenGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caGreenGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caBlueGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBlueGamma;
	py_caBlueGamma = PyLong_FromLong((uint16_t)(object->caBlueGamma));
	return py_caBlueGamma;
}

static int py_spoolss_PSDRVEXTRA500_set_caBlueGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBlueGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBlueGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBlueGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caReferenceBlack(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceBlack;
	py_caReferenceBlack = PyLong_FromLong((uint16_t)(object->caReferenceBlack));
	return py_caReferenceBlack;
}

static int py_spoolss_PSDRVEXTRA500_set_caReferenceBlack(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceBlack");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceBlack));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceBlack = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caReferenceWhite(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceWhite;
	py_caReferenceWhite = PyLong_FromLong((uint16_t)(object->caReferenceWhite));
	return py_caReferenceWhite;
}

static int py_spoolss_PSDRVEXTRA500_set_caReferenceWhite(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceWhite");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceWhite));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceWhite = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caContrast(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caContrast;
	py_caContrast = PyLong_FromLong((uint16_t)(object->caContrast));
	return py_caContrast;
}

static int py_spoolss_PSDRVEXTRA500_set_caContrast(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caContrast");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caContrast));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caContrast = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caBrightness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caBrightness;
	py_caBrightness = PyLong_FromLong((uint16_t)(object->caBrightness));
	return py_caBrightness;
}

static int py_spoolss_PSDRVEXTRA500_set_caBrightness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBrightness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBrightness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBrightness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caColorfulness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caColorfulness;
	py_caColorfulness = PyLong_FromLong((uint16_t)(object->caColorfulness));
	return py_caColorfulness;
}

static int py_spoolss_PSDRVEXTRA500_set_caColorfulness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caColorfulness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caColorfulness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caColorfulness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_caRedGreenTint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGreenTint;
	py_caRedGreenTint = PyLong_FromLong((uint16_t)(object->caRedGreenTint));
	return py_caRedGreenTint;
}

static int py_spoolss_PSDRVEXTRA500_set_caRedGreenTint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGreenTint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGreenTint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGreenTint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wReserved1(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wReserved1;
	py_wReserved1 = PyLong_FromLong((uint16_t)(object->wReserved1));
	return py_wReserved1;
}

static int py_spoolss_PSDRVEXTRA500_set_wReserved1(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wReserved1");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wReserved1));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wReserved1 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wSize;
	py_wSize = PyLong_FromLong((uint16_t)(object->wSize));
	return py_wSize;
}

static int py_spoolss_PSDRVEXTRA500_set_wSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_fxScrFreq(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_fxScrFreq;
	py_fxScrFreq = PyLong_FromUnsignedLongLong((uint32_t)(object->fxScrFreq));
	return py_fxScrFreq;
}

static int py_spoolss_PSDRVEXTRA500_set_fxScrFreq(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fxScrFreq");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fxScrFreq));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->fxScrFreq = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_fxScrAngle(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_fxScrAngle;
	py_fxScrAngle = PyLong_FromUnsignedLongLong((uint32_t)(object->fxScrAngle));
	return py_fxScrAngle;
}

static int py_spoolss_PSDRVEXTRA500_set_fxScrAngle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fxScrAngle");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fxScrAngle));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->fxScrAngle = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_iDialect(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iDialect;
	py_iDialect = PyLong_FromUnsignedLongLong((uint32_t)(object->iDialect));
	return py_iDialect;
}

static int py_spoolss_PSDRVEXTRA500_set_iDialect(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iDialect");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iDialect));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iDialect = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_iTTDLFmt(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iTTDLFmt;
	py_iTTDLFmt = PyLong_FromUnsignedLongLong((uint32_t)(object->iTTDLFmt));
	return py_iTTDLFmt;
}

static int py_spoolss_PSDRVEXTRA500_set_iTTDLFmt(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iTTDLFmt");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iTTDLFmt));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iTTDLFmt = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_bReversePrint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_bReversePrint;
	py_bReversePrint = PyLong_FromUnsignedLongLong((uint32_t)(object->bReversePrint));
	return py_bReversePrint;
}

static int py_spoolss_PSDRVEXTRA500_set_bReversePrint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bReversePrint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bReversePrint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bReversePrint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_iLayout(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iLayout;
	py_iLayout = PyLong_FromUnsignedLongLong((uint32_t)(object->iLayout));
	return py_iLayout;
}

static int py_spoolss_PSDRVEXTRA500_set_iLayout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iLayout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iLayout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iLayout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_iPSLevel(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iPSLevel;
	py_iPSLevel = PyLong_FromUnsignedLongLong((uint32_t)(object->iPSLevel));
	return py_iPSLevel;
}

static int py_spoolss_PSDRVEXTRA500_set_iPSLevel(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iPSLevel");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iPSLevel));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iPSLevel = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwReserved2(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReserved2;
	py_dwReserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwReserved2));
	return py_dwReserved2;
}

static int py_spoolss_PSDRVEXTRA500_set_dwReserved2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReserved2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReserved2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwReserved2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wOEMExtra(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wOEMExtra;
	py_wOEMExtra = PyLong_FromLong((uint16_t)(object->wOEMExtra));
	return py_wOEMExtra;
}

static int py_spoolss_PSDRVEXTRA500_set_wOEMExtra(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wOEMExtra");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wOEMExtra));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wOEMExtra = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wVer(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wVer;
	py_wVer = PyLong_FromLong((uint16_t)(object->wVer));
	return py_wVer;
}

static int py_spoolss_PSDRVEXTRA500_set_wVer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wVer");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wVer));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wVer = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwX(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwX;
	py_dwX = PyLong_FromUnsignedLongLong((uint32_t)(object->dwX));
	return py_dwX;
}

static int py_spoolss_PSDRVEXTRA500_set_dwX(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwX");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwX));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwX = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwY(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwY;
	py_dwY = PyLong_FromUnsignedLongLong((uint32_t)(object->dwY));
	return py_dwY;
}

static int py_spoolss_PSDRVEXTRA500_set_dwY(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwY");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwY));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwY = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwWidthOffset(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwWidthOffset;
	py_dwWidthOffset = PyLong_FromUnsignedLongLong((uint32_t)(object->dwWidthOffset));
	return py_dwWidthOffset;
}

static int py_spoolss_PSDRVEXTRA500_set_dwWidthOffset(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwWidthOffset");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwWidthOffset));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwWidthOffset = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwHeightOffset(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwHeightOffset;
	py_dwHeightOffset = PyLong_FromUnsignedLongLong((uint32_t)(object->dwHeightOffset));
	return py_dwHeightOffset;
}

static int py_spoolss_PSDRVEXTRA500_set_dwHeightOffset(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwHeightOffset");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwHeightOffset));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwHeightOffset = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wFeedDirection(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wFeedDirection;
	py_wFeedDirection = PyLong_FromLong((uint16_t)(object->wFeedDirection));
	return py_wFeedDirection;
}

static int py_spoolss_PSDRVEXTRA500_set_wFeedDirection(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wFeedDirection");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wFeedDirection));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wFeedDirection = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_wCutSheet(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wCutSheet;
	py_wCutSheet = PyLong_FromLong((uint16_t)(object->wCutSheet));
	return py_wCutSheet;
}

static int py_spoolss_PSDRVEXTRA500_set_wCutSheet(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCutSheet");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCutSheet));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCutSheet = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwReserved3(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReserved3;
	py_dwReserved3 = PyList_New(4);
	if (py_dwReserved3 == NULL) {
		return NULL;
	}
	{
		int dwReserved3_cntr_0;
		for (dwReserved3_cntr_0 = 0; dwReserved3_cntr_0 < (4); dwReserved3_cntr_0++) {
			PyObject *py_dwReserved3_0;
			py_dwReserved3_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->dwReserved3)[dwReserved3_cntr_0]));
			PyList_SetItem(py_dwReserved3, dwReserved3_cntr_0, py_dwReserved3_0);
		}
	}
	return py_dwReserved3;
}

static int py_spoolss_PSDRVEXTRA500_set_dwReserved3(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReserved3");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int dwReserved3_cntr_0;
		if (ARRAY_SIZE(object->dwReserved3) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->dwReserved3),  PyList_GET_SIZE(value));
			return -1;
		}
		for (dwReserved3_cntr_0 = 0; dwReserved3_cntr_0 < PyList_GET_SIZE(value); dwReserved3_cntr_0++) {
			if (PyList_GET_ITEM(value, dwReserved3_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->dwReserved3)[dwReserved3_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->dwReserved3)[dwReserved3_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, dwReserved3_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, dwReserved3_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->dwReserved3)[dwReserved3_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwChecksum32(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwChecksum32;
	py_dwChecksum32 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwChecksum32));
	return py_dwChecksum32;
}

static int py_spoolss_PSDRVEXTRA500_set_dwChecksum32(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwChecksum32");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwChecksum32));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwChecksum32 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_dwOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwOptions;
	py_dwOptions = PyLong_FromUnsignedLongLong((uint32_t)(object->dwOptions));
	return py_dwOptions;
}

static int py_spoolss_PSDRVEXTRA500_set_dwOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwOptions");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwOptions));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwOptions = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA500_get_aOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_aOptions;
	py_aOptions = PyList_New(128);
	if (py_aOptions == NULL) {
		return NULL;
	}
	{
		int aOptions_cntr_0;
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < (128); aOptions_cntr_0++) {
			PyObject *py_aOptions_0;
			py_aOptions_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->aOptions)[aOptions_cntr_0]));
			PyList_SetItem(py_aOptions, aOptions_cntr_0, py_aOptions_0);
		}
	}
	return py_aOptions;
}

static int py_spoolss_PSDRVEXTRA500_set_aOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aOptions");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aOptions_cntr_0;
		if (ARRAY_SIZE(object->aOptions) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->aOptions),  PyList_GET_SIZE(value));
			return -1;
		}
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < PyList_GET_SIZE(value); aOptions_cntr_0++) {
			if (PyList_GET_ITEM(value, aOptions_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aOptions)[aOptions_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->aOptions)[aOptions_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, aOptions_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, aOptions_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->aOptions)[aOptions_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PSDRVEXTRA500_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwSignature,
		.set = py_spoolss_PSDRVEXTRA500_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwFlags,
		.set = py_spoolss_PSDRVEXTRA500_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Flags")
	},
	{
		.name = discard_const_p(char, "wchEPSFile"),
		.get = py_spoolss_PSDRVEXTRA500_get_wchEPSFile,
		.set = py_spoolss_PSDRVEXTRA500_set_wchEPSFile,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "caSize"),
		.get = py_spoolss_PSDRVEXTRA500_get_caSize,
		.set = py_spoolss_PSDRVEXTRA500_set_caSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caFlags"),
		.get = py_spoolss_PSDRVEXTRA500_get_caFlags,
		.set = py_spoolss_PSDRVEXTRA500_set_caFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caIlluminantIndex"),
		.get = py_spoolss_PSDRVEXTRA500_get_caIlluminantIndex,
		.set = py_spoolss_PSDRVEXTRA500_set_caIlluminantIndex,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGamma"),
		.get = py_spoolss_PSDRVEXTRA500_get_caRedGamma,
		.set = py_spoolss_PSDRVEXTRA500_set_caRedGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caGreenGamma"),
		.get = py_spoolss_PSDRVEXTRA500_get_caGreenGamma,
		.set = py_spoolss_PSDRVEXTRA500_set_caGreenGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBlueGamma"),
		.get = py_spoolss_PSDRVEXTRA500_get_caBlueGamma,
		.set = py_spoolss_PSDRVEXTRA500_set_caBlueGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceBlack"),
		.get = py_spoolss_PSDRVEXTRA500_get_caReferenceBlack,
		.set = py_spoolss_PSDRVEXTRA500_set_caReferenceBlack,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceWhite"),
		.get = py_spoolss_PSDRVEXTRA500_get_caReferenceWhite,
		.set = py_spoolss_PSDRVEXTRA500_set_caReferenceWhite,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caContrast"),
		.get = py_spoolss_PSDRVEXTRA500_get_caContrast,
		.set = py_spoolss_PSDRVEXTRA500_set_caContrast,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBrightness"),
		.get = py_spoolss_PSDRVEXTRA500_get_caBrightness,
		.set = py_spoolss_PSDRVEXTRA500_set_caBrightness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caColorfulness"),
		.get = py_spoolss_PSDRVEXTRA500_get_caColorfulness,
		.set = py_spoolss_PSDRVEXTRA500_set_caColorfulness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGreenTint"),
		.get = py_spoolss_PSDRVEXTRA500_get_caRedGreenTint,
		.set = py_spoolss_PSDRVEXTRA500_set_caRedGreenTint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wReserved1"),
		.get = py_spoolss_PSDRVEXTRA500_get_wReserved1,
		.set = py_spoolss_PSDRVEXTRA500_set_wReserved1,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wSize"),
		.get = py_spoolss_PSDRVEXTRA500_get_wSize,
		.set = py_spoolss_PSDRVEXTRA500_set_wSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "fxScrFreq"),
		.get = py_spoolss_PSDRVEXTRA500_get_fxScrFreq,
		.set = py_spoolss_PSDRVEXTRA500_set_fxScrFreq,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "fxScrAngle"),
		.get = py_spoolss_PSDRVEXTRA500_get_fxScrAngle,
		.set = py_spoolss_PSDRVEXTRA500_set_fxScrAngle,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iDialect"),
		.get = py_spoolss_PSDRVEXTRA500_get_iDialect,
		.set = py_spoolss_PSDRVEXTRA500_set_iDialect,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Dialect")
	},
	{
		.name = discard_const_p(char, "iTTDLFmt"),
		.get = py_spoolss_PSDRVEXTRA500_get_iTTDLFmt,
		.set = py_spoolss_PSDRVEXTRA500_set_iTTDLFmt,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_TTDLFmt")
	},
	{
		.name = discard_const_p(char, "bReversePrint"),
		.get = py_spoolss_PSDRVEXTRA500_get_bReversePrint,
		.set = py_spoolss_PSDRVEXTRA500_set_bReversePrint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iLayout"),
		.get = py_spoolss_PSDRVEXTRA500_get_iLayout,
		.set = py_spoolss_PSDRVEXTRA500_set_iLayout,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Layout")
	},
	{
		.name = discard_const_p(char, "iPSLevel"),
		.get = py_spoolss_PSDRVEXTRA500_get_iPSLevel,
		.set = py_spoolss_PSDRVEXTRA500_set_iPSLevel,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_PSLevel")
	},
	{
		.name = discard_const_p(char, "dwReserved2"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwReserved2,
		.set = py_spoolss_PSDRVEXTRA500_set_dwReserved2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "wOEMExtra"),
		.get = py_spoolss_PSDRVEXTRA500_get_wOEMExtra,
		.set = py_spoolss_PSDRVEXTRA500_set_wOEMExtra,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wVer"),
		.get = py_spoolss_PSDRVEXTRA500_get_wVer,
		.set = py_spoolss_PSDRVEXTRA500_set_wVer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwX"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwX,
		.set = py_spoolss_PSDRVEXTRA500_set_dwX,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwY"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwY,
		.set = py_spoolss_PSDRVEXTRA500_set_dwY,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwWidthOffset"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwWidthOffset,
		.set = py_spoolss_PSDRVEXTRA500_set_dwWidthOffset,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwHeightOffset"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwHeightOffset,
		.set = py_spoolss_PSDRVEXTRA500_set_dwHeightOffset,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "wFeedDirection"),
		.get = py_spoolss_PSDRVEXTRA500_get_wFeedDirection,
		.set = py_spoolss_PSDRVEXTRA500_set_wFeedDirection,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_FeedDirection")
	},
	{
		.name = discard_const_p(char, "wCutSheet"),
		.get = py_spoolss_PSDRVEXTRA500_get_wCutSheet,
		.set = py_spoolss_PSDRVEXTRA500_set_wCutSheet,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwReserved3"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwReserved3,
		.set = py_spoolss_PSDRVEXTRA500_set_dwReserved3,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwChecksum32"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwChecksum32,
		.set = py_spoolss_PSDRVEXTRA500_set_dwChecksum32,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwOptions"),
		.get = py_spoolss_PSDRVEXTRA500_get_dwOptions,
		.set = py_spoolss_PSDRVEXTRA500_set_dwOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aOptions"),
		.get = py_spoolss_PSDRVEXTRA500_get_aOptions,
		.set = py_spoolss_PSDRVEXTRA500_set_aOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PSDRVEXTRA500_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PSDRVEXTRA500, type);
}


static PyTypeObject spoolss_PSDRVEXTRA500_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PSDRVEXTRA500",
	.tp_getset = py_spoolss_PSDRVEXTRA500_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PSDRVEXTRA500_new,
};


static PyObject *py_spoolss_PSDRVEXTRA_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_PSDRVEXTRA_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_PSDRVEXTRA_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wchEPSFile(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wchEPSFile;
	py_wchEPSFile = PyList_New(12);
	if (py_wchEPSFile == NULL) {
		return NULL;
	}
	{
		int wchEPSFile_cntr_0;
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < (12); wchEPSFile_cntr_0++) {
			PyObject *py_wchEPSFile_0;
			py_wchEPSFile_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->wchEPSFile)[wchEPSFile_cntr_0]));
			PyList_SetItem(py_wchEPSFile, wchEPSFile_cntr_0, py_wchEPSFile_0);
		}
	}
	return py_wchEPSFile;
}

static int py_spoolss_PSDRVEXTRA_set_wchEPSFile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wchEPSFile");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wchEPSFile_cntr_0;
		if (ARRAY_SIZE(object->wchEPSFile) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wchEPSFile),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wchEPSFile_cntr_0 = 0; wchEPSFile_cntr_0 < PyList_GET_SIZE(value); wchEPSFile_cntr_0++) {
			if (PyList_GET_ITEM(value, wchEPSFile_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wchEPSFile)[wchEPSFile_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wchEPSFile)[wchEPSFile_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wchEPSFile_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wchEPSFile_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wchEPSFile)[wchEPSFile_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caSize;
	py_caSize = PyLong_FromLong((uint16_t)(object->caSize));
	return py_caSize;
}

static int py_spoolss_PSDRVEXTRA_set_caSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caFlags;
	py_caFlags = PyLong_FromLong((uint16_t)(object->caFlags));
	return py_caFlags;
}

static int py_spoolss_PSDRVEXTRA_set_caFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caIlluminantIndex(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caIlluminantIndex;
	py_caIlluminantIndex = PyLong_FromLong((uint16_t)(object->caIlluminantIndex));
	return py_caIlluminantIndex;
}

static int py_spoolss_PSDRVEXTRA_set_caIlluminantIndex(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caIlluminantIndex");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caIlluminantIndex));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caIlluminantIndex = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caRedGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGamma;
	py_caRedGamma = PyLong_FromLong((uint16_t)(object->caRedGamma));
	return py_caRedGamma;
}

static int py_spoolss_PSDRVEXTRA_set_caRedGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caGreenGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caGreenGamma;
	py_caGreenGamma = PyLong_FromLong((uint16_t)(object->caGreenGamma));
	return py_caGreenGamma;
}

static int py_spoolss_PSDRVEXTRA_set_caGreenGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caGreenGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caGreenGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caGreenGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caBlueGamma(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caBlueGamma;
	py_caBlueGamma = PyLong_FromLong((uint16_t)(object->caBlueGamma));
	return py_caBlueGamma;
}

static int py_spoolss_PSDRVEXTRA_set_caBlueGamma(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBlueGamma");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBlueGamma));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBlueGamma = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caReferenceBlack(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceBlack;
	py_caReferenceBlack = PyLong_FromLong((uint16_t)(object->caReferenceBlack));
	return py_caReferenceBlack;
}

static int py_spoolss_PSDRVEXTRA_set_caReferenceBlack(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceBlack");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceBlack));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceBlack = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caReferenceWhite(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caReferenceWhite;
	py_caReferenceWhite = PyLong_FromLong((uint16_t)(object->caReferenceWhite));
	return py_caReferenceWhite;
}

static int py_spoolss_PSDRVEXTRA_set_caReferenceWhite(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caReferenceWhite");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caReferenceWhite));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caReferenceWhite = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caContrast(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caContrast;
	py_caContrast = PyLong_FromLong((uint16_t)(object->caContrast));
	return py_caContrast;
}

static int py_spoolss_PSDRVEXTRA_set_caContrast(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caContrast");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caContrast));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caContrast = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caBrightness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caBrightness;
	py_caBrightness = PyLong_FromLong((uint16_t)(object->caBrightness));
	return py_caBrightness;
}

static int py_spoolss_PSDRVEXTRA_set_caBrightness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caBrightness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caBrightness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caBrightness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caColorfulness(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caColorfulness;
	py_caColorfulness = PyLong_FromLong((uint16_t)(object->caColorfulness));
	return py_caColorfulness;
}

static int py_spoolss_PSDRVEXTRA_set_caColorfulness(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caColorfulness");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caColorfulness));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caColorfulness = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_caRedGreenTint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_caRedGreenTint;
	py_caRedGreenTint = PyLong_FromLong((uint16_t)(object->caRedGreenTint));
	return py_caRedGreenTint;
}

static int py_spoolss_PSDRVEXTRA_set_caRedGreenTint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->caRedGreenTint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->caRedGreenTint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->caRedGreenTint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wCoreJTExpSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wCoreJTExpSize;
	py_wCoreJTExpSize = PyLong_FromLong((uint16_t)(object->wCoreJTExpSize));
	return py_wCoreJTExpSize;
}

static int py_spoolss_PSDRVEXTRA_set_wCoreJTExpSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCoreJTExpSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCoreJTExpSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCoreJTExpSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wCoreFullSize(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wCoreFullSize;
	py_wCoreFullSize = PyLong_FromLong((uint16_t)(object->wCoreFullSize));
	return py_wCoreFullSize;
}

static int py_spoolss_PSDRVEXTRA_set_wCoreFullSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCoreFullSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCoreFullSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCoreFullSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_fxScrFreq(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_fxScrFreq;
	py_fxScrFreq = PyLong_FromUnsignedLongLong((uint32_t)(object->fxScrFreq));
	return py_fxScrFreq;
}

static int py_spoolss_PSDRVEXTRA_set_fxScrFreq(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fxScrFreq");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fxScrFreq));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->fxScrFreq = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_fxScrAngle(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_fxScrAngle;
	py_fxScrAngle = PyLong_FromUnsignedLongLong((uint32_t)(object->fxScrAngle));
	return py_fxScrAngle;
}

static int py_spoolss_PSDRVEXTRA_set_fxScrAngle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fxScrAngle");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fxScrAngle));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->fxScrAngle = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_iDialect(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iDialect;
	py_iDialect = PyLong_FromUnsignedLongLong((uint32_t)(object->iDialect));
	return py_iDialect;
}

static int py_spoolss_PSDRVEXTRA_set_iDialect(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iDialect");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iDialect));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iDialect = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_iTTDLFmt(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iTTDLFmt;
	py_iTTDLFmt = PyLong_FromUnsignedLongLong((uint32_t)(object->iTTDLFmt));
	return py_iTTDLFmt;
}

static int py_spoolss_PSDRVEXTRA_set_iTTDLFmt(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iTTDLFmt");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iTTDLFmt));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iTTDLFmt = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_bReversePrint(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_bReversePrint;
	py_bReversePrint = PyLong_FromUnsignedLongLong((uint32_t)(object->bReversePrint));
	return py_bReversePrint;
}

static int py_spoolss_PSDRVEXTRA_set_bReversePrint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bReversePrint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bReversePrint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bReversePrint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_iLayout(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iLayout;
	py_iLayout = PyLong_FromUnsignedLongLong((uint32_t)(object->iLayout));
	return py_iLayout;
}

static int py_spoolss_PSDRVEXTRA_set_iLayout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iLayout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iLayout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iLayout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_iPSLevel(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iPSLevel;
	py_iPSLevel = PyLong_FromUnsignedLongLong((uint32_t)(object->iPSLevel));
	return py_iPSLevel;
}

static int py_spoolss_PSDRVEXTRA_set_iPSLevel(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iPSLevel");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iPSLevel));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iPSLevel = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwReserved2(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReserved2;
	py_dwReserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwReserved2));
	return py_dwReserved2;
}

static int py_spoolss_PSDRVEXTRA_set_dwReserved2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReserved2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReserved2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwReserved2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wOEMExtra(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wOEMExtra;
	py_wOEMExtra = PyLong_FromLong((uint16_t)(object->wOEMExtra));
	return py_wOEMExtra;
}

static int py_spoolss_PSDRVEXTRA_set_wOEMExtra(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wOEMExtra");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wOEMExtra));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wOEMExtra = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wVer(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wVer;
	py_wVer = PyLong_FromLong((uint16_t)(object->wVer));
	return py_wVer;
}

static int py_spoolss_PSDRVEXTRA_set_wVer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wVer");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wVer));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wVer = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwX(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwX;
	py_dwX = PyLong_FromUnsignedLongLong((uint32_t)(object->dwX));
	return py_dwX;
}

static int py_spoolss_PSDRVEXTRA_set_dwX(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwX");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwX));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwX = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwY(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwY;
	py_dwY = PyLong_FromUnsignedLongLong((uint32_t)(object->dwY));
	return py_dwY;
}

static int py_spoolss_PSDRVEXTRA_set_dwY(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwY");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwY));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwY = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwWidthOffset(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwWidthOffset;
	py_dwWidthOffset = PyLong_FromUnsignedLongLong((uint32_t)(object->dwWidthOffset));
	return py_dwWidthOffset;
}

static int py_spoolss_PSDRVEXTRA_set_dwWidthOffset(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwWidthOffset");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwWidthOffset));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwWidthOffset = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwHeightOffset(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwHeightOffset;
	py_dwHeightOffset = PyLong_FromUnsignedLongLong((uint32_t)(object->dwHeightOffset));
	return py_dwHeightOffset;
}

static int py_spoolss_PSDRVEXTRA_set_dwHeightOffset(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwHeightOffset");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwHeightOffset));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwHeightOffset = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wFeedDirection(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wFeedDirection;
	py_wFeedDirection = PyLong_FromLong((uint16_t)(object->wFeedDirection));
	return py_wFeedDirection;
}

static int py_spoolss_PSDRVEXTRA_set_wFeedDirection(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wFeedDirection");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wFeedDirection));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wFeedDirection = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_wCutSheet(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wCutSheet;
	py_wCutSheet = PyLong_FromLong((uint16_t)(object->wCutSheet));
	return py_wCutSheet;
}

static int py_spoolss_PSDRVEXTRA_set_wCutSheet(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCutSheet");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCutSheet));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCutSheet = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwReserved3(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReserved3;
	py_dwReserved3 = PyList_New(4);
	if (py_dwReserved3 == NULL) {
		return NULL;
	}
	{
		int dwReserved3_cntr_0;
		for (dwReserved3_cntr_0 = 0; dwReserved3_cntr_0 < (4); dwReserved3_cntr_0++) {
			PyObject *py_dwReserved3_0;
			py_dwReserved3_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->dwReserved3)[dwReserved3_cntr_0]));
			PyList_SetItem(py_dwReserved3, dwReserved3_cntr_0, py_dwReserved3_0);
		}
	}
	return py_dwReserved3;
}

static int py_spoolss_PSDRVEXTRA_set_dwReserved3(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReserved3");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int dwReserved3_cntr_0;
		if (ARRAY_SIZE(object->dwReserved3) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->dwReserved3),  PyList_GET_SIZE(value));
			return -1;
		}
		for (dwReserved3_cntr_0 = 0; dwReserved3_cntr_0 < PyList_GET_SIZE(value); dwReserved3_cntr_0++) {
			if (PyList_GET_ITEM(value, dwReserved3_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->dwReserved3)[dwReserved3_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->dwReserved3)[dwReserved3_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, dwReserved3_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, dwReserved3_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->dwReserved3)[dwReserved3_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwChecksum32(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwChecksum32;
	py_dwChecksum32 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwChecksum32));
	return py_dwChecksum32;
}

static int py_spoolss_PSDRVEXTRA_set_dwChecksum32(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwChecksum32");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwChecksum32));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwChecksum32 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwOptions;
	py_dwOptions = PyLong_FromUnsignedLongLong((uint32_t)(object->dwOptions));
	return py_dwOptions;
}

static int py_spoolss_PSDRVEXTRA_set_dwOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwOptions");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwOptions));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwOptions = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_aOptions(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_aOptions;
	py_aOptions = PyList_New(128);
	if (py_aOptions == NULL) {
		return NULL;
	}
	{
		int aOptions_cntr_0;
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < (128); aOptions_cntr_0++) {
			PyObject *py_aOptions_0;
			py_aOptions_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->aOptions)[aOptions_cntr_0]));
			PyList_SetItem(py_aOptions, aOptions_cntr_0, py_aOptions_0);
		}
	}
	return py_aOptions;
}

static int py_spoolss_PSDRVEXTRA_set_aOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aOptions");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aOptions_cntr_0;
		if (ARRAY_SIZE(object->aOptions) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->aOptions),  PyList_GET_SIZE(value));
			return -1;
		}
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < PyList_GET_SIZE(value); aOptions_cntr_0++) {
			if (PyList_GET_ITEM(value, aOptions_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aOptions)[aOptions_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->aOptions)[aOptions_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, aOptions_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, aOptions_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->aOptions)[aOptions_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwNupDirection(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwNupDirection;
	py_dwNupDirection = PyLong_FromUnsignedLongLong((uint32_t)(object->dwNupDirection));
	return py_dwNupDirection;
}

static int py_spoolss_PSDRVEXTRA_set_dwNupDirection(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwNupDirection");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNupDirection));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwNupDirection = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwNupBorderFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwNupBorderFlags;
	py_dwNupBorderFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwNupBorderFlags));
	return py_dwNupBorderFlags;
}

static int py_spoolss_PSDRVEXTRA_set_dwNupBorderFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwNupBorderFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNupBorderFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwNupBorderFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwBookletFlags(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwBookletFlags;
	py_dwBookletFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwBookletFlags));
	return py_dwBookletFlags;
}

static int py_spoolss_PSDRVEXTRA_set_dwBookletFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwBookletFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwBookletFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwBookletFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PSDRVEXTRA_get_dwPadding(PyObject *obj, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwPadding;
	py_dwPadding = PyLong_FromUnsignedLongLong((uint32_t)(object->dwPadding));
	return py_dwPadding;
}

static int py_spoolss_PSDRVEXTRA_set_dwPadding(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PSDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwPadding");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwPadding));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwPadding = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PSDRVEXTRA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_PSDRVEXTRA_get_dwSignature,
		.set = py_spoolss_PSDRVEXTRA_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_PSDRVEXTRA_get_dwFlags,
		.set = py_spoolss_PSDRVEXTRA_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Flags")
	},
	{
		.name = discard_const_p(char, "wchEPSFile"),
		.get = py_spoolss_PSDRVEXTRA_get_wchEPSFile,
		.set = py_spoolss_PSDRVEXTRA_set_wchEPSFile,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "caSize"),
		.get = py_spoolss_PSDRVEXTRA_get_caSize,
		.set = py_spoolss_PSDRVEXTRA_set_caSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caFlags"),
		.get = py_spoolss_PSDRVEXTRA_get_caFlags,
		.set = py_spoolss_PSDRVEXTRA_set_caFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caIlluminantIndex"),
		.get = py_spoolss_PSDRVEXTRA_get_caIlluminantIndex,
		.set = py_spoolss_PSDRVEXTRA_set_caIlluminantIndex,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGamma"),
		.get = py_spoolss_PSDRVEXTRA_get_caRedGamma,
		.set = py_spoolss_PSDRVEXTRA_set_caRedGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caGreenGamma"),
		.get = py_spoolss_PSDRVEXTRA_get_caGreenGamma,
		.set = py_spoolss_PSDRVEXTRA_set_caGreenGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBlueGamma"),
		.get = py_spoolss_PSDRVEXTRA_get_caBlueGamma,
		.set = py_spoolss_PSDRVEXTRA_set_caBlueGamma,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceBlack"),
		.get = py_spoolss_PSDRVEXTRA_get_caReferenceBlack,
		.set = py_spoolss_PSDRVEXTRA_set_caReferenceBlack,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caReferenceWhite"),
		.get = py_spoolss_PSDRVEXTRA_get_caReferenceWhite,
		.set = py_spoolss_PSDRVEXTRA_set_caReferenceWhite,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caContrast"),
		.get = py_spoolss_PSDRVEXTRA_get_caContrast,
		.set = py_spoolss_PSDRVEXTRA_set_caContrast,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caBrightness"),
		.get = py_spoolss_PSDRVEXTRA_get_caBrightness,
		.set = py_spoolss_PSDRVEXTRA_set_caBrightness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caColorfulness"),
		.get = py_spoolss_PSDRVEXTRA_get_caColorfulness,
		.set = py_spoolss_PSDRVEXTRA_set_caColorfulness,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "caRedGreenTint"),
		.get = py_spoolss_PSDRVEXTRA_get_caRedGreenTint,
		.set = py_spoolss_PSDRVEXTRA_set_caRedGreenTint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wCoreJTExpSize"),
		.get = py_spoolss_PSDRVEXTRA_get_wCoreJTExpSize,
		.set = py_spoolss_PSDRVEXTRA_set_wCoreJTExpSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wCoreFullSize"),
		.get = py_spoolss_PSDRVEXTRA_get_wCoreFullSize,
		.set = py_spoolss_PSDRVEXTRA_set_wCoreFullSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "fxScrFreq"),
		.get = py_spoolss_PSDRVEXTRA_get_fxScrFreq,
		.set = py_spoolss_PSDRVEXTRA_set_fxScrFreq,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "fxScrAngle"),
		.get = py_spoolss_PSDRVEXTRA_get_fxScrAngle,
		.set = py_spoolss_PSDRVEXTRA_set_fxScrAngle,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iDialect"),
		.get = py_spoolss_PSDRVEXTRA_get_iDialect,
		.set = py_spoolss_PSDRVEXTRA_set_iDialect,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_Dialect")
	},
	{
		.name = discard_const_p(char, "iTTDLFmt"),
		.get = py_spoolss_PSDRVEXTRA_get_iTTDLFmt,
		.set = py_spoolss_PSDRVEXTRA_set_iTTDLFmt,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_TTDLFmt")
	},
	{
		.name = discard_const_p(char, "bReversePrint"),
		.get = py_spoolss_PSDRVEXTRA_get_bReversePrint,
		.set = py_spoolss_PSDRVEXTRA_set_bReversePrint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iLayout"),
		.get = py_spoolss_PSDRVEXTRA_get_iLayout,
		.set = py_spoolss_PSDRVEXTRA_set_iLayout,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Layout")
	},
	{
		.name = discard_const_p(char, "iPSLevel"),
		.get = py_spoolss_PSDRVEXTRA_get_iPSLevel,
		.set = py_spoolss_PSDRVEXTRA_set_iPSLevel,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_PSLevel")
	},
	{
		.name = discard_const_p(char, "dwReserved2"),
		.get = py_spoolss_PSDRVEXTRA_get_dwReserved2,
		.set = py_spoolss_PSDRVEXTRA_set_dwReserved2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "wOEMExtra"),
		.get = py_spoolss_PSDRVEXTRA_get_wOEMExtra,
		.set = py_spoolss_PSDRVEXTRA_set_wOEMExtra,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wVer"),
		.get = py_spoolss_PSDRVEXTRA_get_wVer,
		.set = py_spoolss_PSDRVEXTRA_set_wVer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwX"),
		.get = py_spoolss_PSDRVEXTRA_get_dwX,
		.set = py_spoolss_PSDRVEXTRA_set_dwX,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwY"),
		.get = py_spoolss_PSDRVEXTRA_get_dwY,
		.set = py_spoolss_PSDRVEXTRA_set_dwY,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwWidthOffset"),
		.get = py_spoolss_PSDRVEXTRA_get_dwWidthOffset,
		.set = py_spoolss_PSDRVEXTRA_set_dwWidthOffset,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwHeightOffset"),
		.get = py_spoolss_PSDRVEXTRA_get_dwHeightOffset,
		.set = py_spoolss_PSDRVEXTRA_set_dwHeightOffset,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "wFeedDirection"),
		.get = py_spoolss_PSDRVEXTRA_get_wFeedDirection,
		.set = py_spoolss_PSDRVEXTRA_set_wFeedDirection,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMPS_FeedDirection")
	},
	{
		.name = discard_const_p(char, "wCutSheet"),
		.get = py_spoolss_PSDRVEXTRA_get_wCutSheet,
		.set = py_spoolss_PSDRVEXTRA_set_wCutSheet,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwReserved3"),
		.get = py_spoolss_PSDRVEXTRA_get_dwReserved3,
		.set = py_spoolss_PSDRVEXTRA_set_dwReserved3,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwChecksum32"),
		.get = py_spoolss_PSDRVEXTRA_get_dwChecksum32,
		.set = py_spoolss_PSDRVEXTRA_set_dwChecksum32,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwOptions"),
		.get = py_spoolss_PSDRVEXTRA_get_dwOptions,
		.set = py_spoolss_PSDRVEXTRA_set_dwOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aOptions"),
		.get = py_spoolss_PSDRVEXTRA_get_aOptions,
		.set = py_spoolss_PSDRVEXTRA_set_aOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwNupDirection"),
		.get = py_spoolss_PSDRVEXTRA_get_dwNupDirection,
		.set = py_spoolss_PSDRVEXTRA_set_dwNupDirection,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_NupDirection")
	},
	{
		.name = discard_const_p(char, "dwNupBorderFlags"),
		.get = py_spoolss_PSDRVEXTRA_get_dwNupBorderFlags,
		.set = py_spoolss_PSDRVEXTRA_set_dwNupBorderFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_NupBorderFlags")
	},
	{
		.name = discard_const_p(char, "dwBookletFlags"),
		.get = py_spoolss_PSDRVEXTRA_get_dwBookletFlags,
		.set = py_spoolss_PSDRVEXTRA_set_dwBookletFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_BookletFlags")
	},
	{
		.name = discard_const_p(char, "dwPadding"),
		.get = py_spoolss_PSDRVEXTRA_get_dwPadding,
		.set = py_spoolss_PSDRVEXTRA_set_dwPadding,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PSDRVEXTRA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PSDRVEXTRA, type);
}


static PyTypeObject spoolss_PSDRVEXTRA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PSDRVEXTRA",
	.tp_getset = py_spoolss_PSDRVEXTRA_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PSDRVEXTRA_new,
};


static PyObject *py_spoolss_UNIDRVEXTRA3_4_get_wReserved(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA3_4 *object = pytalloc_get_ptr(obj);
	PyObject *py_wReserved;
	py_wReserved = PyList_New(56);
	if (py_wReserved == NULL) {
		return NULL;
	}
	{
		int wReserved_cntr_0;
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < (56); wReserved_cntr_0++) {
			PyObject *py_wReserved_0;
			py_wReserved_0 = PyLong_FromLong((uint16_t)((object->wReserved)[wReserved_cntr_0]));
			PyList_SetItem(py_wReserved, wReserved_cntr_0, py_wReserved_0);
		}
	}
	return py_wReserved;
}

static int py_spoolss_UNIDRVEXTRA3_4_set_wReserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA3_4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wReserved");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wReserved_cntr_0;
		if (ARRAY_SIZE(object->wReserved) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wReserved),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < PyList_GET_SIZE(value); wReserved_cntr_0++) {
			if (PyList_GET_ITEM(value, wReserved_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wReserved)[wReserved_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wReserved)[wReserved_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wReserved_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wReserved_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wReserved)[wReserved_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UNIDRVEXTRA3_4_getsetters[] = {
	{
		.name = discard_const_p(char, "wReserved"),
		.get = py_spoolss_UNIDRVEXTRA3_4_get_wReserved,
		.set = py_spoolss_UNIDRVEXTRA3_4_set_wReserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UNIDRVEXTRA3_4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UNIDRVEXTRA3_4, type);
}


static PyTypeObject spoolss_UNIDRVEXTRA3_4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UNIDRVEXTRA3_4",
	.tp_getset = py_spoolss_UNIDRVEXTRA3_4_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UNIDRVEXTRA3_4_new,
};


static PyObject *py_spoolss_UNIDRVEXTRA500_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_UNIDRVEXTRA500_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_wVer(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wVer;
	py_wVer = PyLong_FromLong((uint16_t)(object->wVer));
	return py_wVer;
}

static int py_spoolss_UNIDRVEXTRA500_set_wVer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wVer");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wVer));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wVer = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_sPadding(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_sPadding;
	py_sPadding = PyLong_FromLong((uint16_t)(object->sPadding));
	return py_sPadding;
}

static int py_spoolss_UNIDRVEXTRA500_set_sPadding(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sPadding");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sPadding));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->sPadding = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_wSize(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wSize;
	py_wSize = PyLong_FromLong((uint16_t)(object->wSize));
	return py_wSize;
}

static int py_spoolss_UNIDRVEXTRA500_set_wSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_wOEMExtra(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wOEMExtra;
	py_wOEMExtra = PyLong_FromLong((uint16_t)(object->wOEMExtra));
	return py_wOEMExtra;
}

static int py_spoolss_UNIDRVEXTRA500_set_wOEMExtra(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wOEMExtra");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wOEMExtra));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wOEMExtra = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_dwChecksum32(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwChecksum32;
	py_dwChecksum32 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwChecksum32));
	return py_dwChecksum32;
}

static int py_spoolss_UNIDRVEXTRA500_set_dwChecksum32(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwChecksum32");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwChecksum32));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwChecksum32 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_UNIDRVEXTRA500_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_bReversePrint(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_bReversePrint;
	py_bReversePrint = PyLong_FromUnsignedLongLong((uint32_t)(object->bReversePrint));
	return py_bReversePrint;
}

static int py_spoolss_UNIDRVEXTRA500_set_bReversePrint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bReversePrint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bReversePrint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bReversePrint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_iLayout(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iLayout;
	py_iLayout = PyLong_FromUnsignedLongLong((uint32_t)(object->iLayout));
	return py_iLayout;
}

static int py_spoolss_UNIDRVEXTRA500_set_iLayout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iLayout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iLayout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iLayout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_iQuality(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_iQuality;
	py_iQuality = PyLong_FromUnsignedLongLong((uint32_t)(object->iQuality));
	return py_iQuality;
}

static int py_spoolss_UNIDRVEXTRA500_set_iQuality(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iQuality");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iQuality));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iQuality = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_wReserved(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_wReserved;
	py_wReserved = PyList_New(6);
	if (py_wReserved == NULL) {
		return NULL;
	}
	{
		int wReserved_cntr_0;
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < (6); wReserved_cntr_0++) {
			PyObject *py_wReserved_0;
			py_wReserved_0 = PyLong_FromLong((uint16_t)((object->wReserved)[wReserved_cntr_0]));
			PyList_SetItem(py_wReserved, wReserved_cntr_0, py_wReserved_0);
		}
	}
	return py_wReserved;
}

static int py_spoolss_UNIDRVEXTRA500_set_wReserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wReserved");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wReserved_cntr_0;
		if (ARRAY_SIZE(object->wReserved) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wReserved),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < PyList_GET_SIZE(value); wReserved_cntr_0++) {
			if (PyList_GET_ITEM(value, wReserved_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wReserved)[wReserved_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wReserved)[wReserved_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wReserved_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wReserved_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wReserved)[wReserved_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_dwOptions(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_dwOptions;
	py_dwOptions = PyLong_FromUnsignedLongLong((uint32_t)(object->dwOptions));
	return py_dwOptions;
}

static int py_spoolss_UNIDRVEXTRA500_set_dwOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwOptions");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwOptions));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwOptions = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA500_get_aOptions(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(obj);
	PyObject *py_aOptions;
	py_aOptions = PyList_New(128);
	if (py_aOptions == NULL) {
		return NULL;
	}
	{
		int aOptions_cntr_0;
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < (128); aOptions_cntr_0++) {
			PyObject *py_aOptions_0;
			py_aOptions_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->aOptions)[aOptions_cntr_0]));
			PyList_SetItem(py_aOptions, aOptions_cntr_0, py_aOptions_0);
		}
	}
	return py_aOptions;
}

static int py_spoolss_UNIDRVEXTRA500_set_aOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA500 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aOptions");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aOptions_cntr_0;
		if (ARRAY_SIZE(object->aOptions) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->aOptions),  PyList_GET_SIZE(value));
			return -1;
		}
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < PyList_GET_SIZE(value); aOptions_cntr_0++) {
			if (PyList_GET_ITEM(value, aOptions_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aOptions)[aOptions_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->aOptions)[aOptions_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, aOptions_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, aOptions_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->aOptions)[aOptions_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UNIDRVEXTRA500_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_UNIDRVEXTRA500_get_dwSignature,
		.set = py_spoolss_UNIDRVEXTRA500_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "wVer"),
		.get = py_spoolss_UNIDRVEXTRA500_get_wVer,
		.set = py_spoolss_UNIDRVEXTRA500_set_wVer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "sPadding"),
		.get = py_spoolss_UNIDRVEXTRA500_get_sPadding,
		.set = py_spoolss_UNIDRVEXTRA500_set_sPadding,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wSize"),
		.get = py_spoolss_UNIDRVEXTRA500_get_wSize,
		.set = py_spoolss_UNIDRVEXTRA500_set_wSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wOEMExtra"),
		.get = py_spoolss_UNIDRVEXTRA500_get_wOEMExtra,
		.set = py_spoolss_UNIDRVEXTRA500_set_wOEMExtra,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwChecksum32"),
		.get = py_spoolss_UNIDRVEXTRA500_get_dwChecksum32,
		.set = py_spoolss_UNIDRVEXTRA500_set_dwChecksum32,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_UNIDRVEXTRA500_get_dwFlags,
		.set = py_spoolss_UNIDRVEXTRA500_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMUNI_Flags")
	},
	{
		.name = discard_const_p(char, "bReversePrint"),
		.get = py_spoolss_UNIDRVEXTRA500_get_bReversePrint,
		.set = py_spoolss_UNIDRVEXTRA500_set_bReversePrint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iLayout"),
		.get = py_spoolss_UNIDRVEXTRA500_get_iLayout,
		.set = py_spoolss_UNIDRVEXTRA500_set_iLayout,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Layout")
	},
	{
		.name = discard_const_p(char, "iQuality"),
		.get = py_spoolss_UNIDRVEXTRA500_get_iQuality,
		.set = py_spoolss_UNIDRVEXTRA500_set_iQuality,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMUNI_Quality")
	},
	{
		.name = discard_const_p(char, "wReserved"),
		.get = py_spoolss_UNIDRVEXTRA500_get_wReserved,
		.set = py_spoolss_UNIDRVEXTRA500_set_wReserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwOptions"),
		.get = py_spoolss_UNIDRVEXTRA500_get_dwOptions,
		.set = py_spoolss_UNIDRVEXTRA500_set_dwOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aOptions"),
		.get = py_spoolss_UNIDRVEXTRA500_get_aOptions,
		.set = py_spoolss_UNIDRVEXTRA500_set_aOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UNIDRVEXTRA500_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UNIDRVEXTRA500, type);
}


static PyTypeObject spoolss_UNIDRVEXTRA500_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UNIDRVEXTRA500",
	.tp_getset = py_spoolss_UNIDRVEXTRA500_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UNIDRVEXTRA500_new,
};


static PyObject *py_spoolss_UNIDRVEXTRA_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_UNIDRVEXTRA_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_wVer(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wVer;
	py_wVer = PyLong_FromLong((uint16_t)(object->wVer));
	return py_wVer;
}

static int py_spoolss_UNIDRVEXTRA_set_wVer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wVer");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wVer));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wVer = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_wCoreJTExpSize(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wCoreJTExpSize;
	py_wCoreJTExpSize = PyLong_FromLong((uint16_t)(object->wCoreJTExpSize));
	return py_wCoreJTExpSize;
}

static int py_spoolss_UNIDRVEXTRA_set_wCoreJTExpSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCoreJTExpSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCoreJTExpSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCoreJTExpSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_wCoreFullSize(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wCoreFullSize;
	py_wCoreFullSize = PyLong_FromLong((uint16_t)(object->wCoreFullSize));
	return py_wCoreFullSize;
}

static int py_spoolss_UNIDRVEXTRA_set_wCoreFullSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCoreFullSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCoreFullSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCoreFullSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_wOEMExtra(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wOEMExtra;
	py_wOEMExtra = PyLong_FromLong((uint16_t)(object->wOEMExtra));
	return py_wOEMExtra;
}

static int py_spoolss_UNIDRVEXTRA_set_wOEMExtra(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wOEMExtra");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wOEMExtra));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wOEMExtra = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwChecksum32(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwChecksum32;
	py_dwChecksum32 = PyLong_FromUnsignedLongLong((uint32_t)(object->dwChecksum32));
	return py_dwChecksum32;
}

static int py_spoolss_UNIDRVEXTRA_set_dwChecksum32(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwChecksum32");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwChecksum32));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwChecksum32 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwFlags(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwFlags;
	py_dwFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwFlags));
	return py_dwFlags;
}

static int py_spoolss_UNIDRVEXTRA_set_dwFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_bReversePrint(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_bReversePrint;
	py_bReversePrint = PyLong_FromUnsignedLongLong((uint32_t)(object->bReversePrint));
	return py_bReversePrint;
}

static int py_spoolss_UNIDRVEXTRA_set_bReversePrint(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bReversePrint");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bReversePrint));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bReversePrint = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_iLayout(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iLayout;
	py_iLayout = PyLong_FromUnsignedLongLong((uint32_t)(object->iLayout));
	return py_iLayout;
}

static int py_spoolss_UNIDRVEXTRA_set_iLayout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iLayout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iLayout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iLayout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_iQuality(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_iQuality;
	py_iQuality = PyLong_FromUnsignedLongLong((uint32_t)(object->iQuality));
	return py_iQuality;
}

static int py_spoolss_UNIDRVEXTRA_set_iQuality(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->iQuality");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->iQuality));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->iQuality = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_wReserved(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_wReserved;
	py_wReserved = PyList_New(6);
	if (py_wReserved == NULL) {
		return NULL;
	}
	{
		int wReserved_cntr_0;
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < (6); wReserved_cntr_0++) {
			PyObject *py_wReserved_0;
			py_wReserved_0 = PyLong_FromLong((uint16_t)((object->wReserved)[wReserved_cntr_0]));
			PyList_SetItem(py_wReserved, wReserved_cntr_0, py_wReserved_0);
		}
	}
	return py_wReserved;
}

static int py_spoolss_UNIDRVEXTRA_set_wReserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wReserved");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int wReserved_cntr_0;
		if (ARRAY_SIZE(object->wReserved) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->wReserved),  PyList_GET_SIZE(value));
			return -1;
		}
		for (wReserved_cntr_0 = 0; wReserved_cntr_0 < PyList_GET_SIZE(value); wReserved_cntr_0++) {
			if (PyList_GET_ITEM(value, wReserved_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->wReserved)[wReserved_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->wReserved)[wReserved_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, wReserved_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, wReserved_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->wReserved)[wReserved_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwOptions(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwOptions;
	py_dwOptions = PyLong_FromUnsignedLongLong((uint32_t)(object->dwOptions));
	return py_dwOptions;
}

static int py_spoolss_UNIDRVEXTRA_set_dwOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwOptions");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwOptions));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwOptions = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_aOptions(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_aOptions;
	py_aOptions = PyList_New(128);
	if (py_aOptions == NULL) {
		return NULL;
	}
	{
		int aOptions_cntr_0;
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < (128); aOptions_cntr_0++) {
			PyObject *py_aOptions_0;
			py_aOptions_0 = PyLong_FromUnsignedLongLong((uint32_t)((object->aOptions)[aOptions_cntr_0]));
			PyList_SetItem(py_aOptions, aOptions_cntr_0, py_aOptions_0);
		}
	}
	return py_aOptions;
}

static int py_spoolss_UNIDRVEXTRA_set_aOptions(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aOptions");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aOptions_cntr_0;
		if (ARRAY_SIZE(object->aOptions) != PyList_GET_SIZE(value)) {
			PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(value)->tp_name, ARRAY_SIZE(object->aOptions),  PyList_GET_SIZE(value));
			return -1;
		}
		for (aOptions_cntr_0 = 0; aOptions_cntr_0 < PyList_GET_SIZE(value); aOptions_cntr_0++) {
			if (PyList_GET_ITEM(value, aOptions_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aOptions)[aOptions_cntr_0]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->aOptions)[aOptions_cntr_0]));
				if (PyLong_Check(PyList_GET_ITEM(value, aOptions_cntr_0))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, aOptions_cntr_0));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->aOptions)[aOptions_cntr_0] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwNupDirection(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwNupDirection;
	py_dwNupDirection = PyLong_FromUnsignedLongLong((uint32_t)(object->dwNupDirection));
	return py_dwNupDirection;
}

static int py_spoolss_UNIDRVEXTRA_set_dwNupDirection(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwNupDirection");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNupDirection));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwNupDirection = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwNupBorderFlags(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwNupBorderFlags;
	py_dwNupBorderFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwNupBorderFlags));
	return py_dwNupBorderFlags;
}

static int py_spoolss_UNIDRVEXTRA_set_dwNupBorderFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwNupBorderFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwNupBorderFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwNupBorderFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UNIDRVEXTRA_get_dwBookletFlags(PyObject *obj, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwBookletFlags;
	py_dwBookletFlags = PyLong_FromUnsignedLongLong((uint32_t)(object->dwBookletFlags));
	return py_dwBookletFlags;
}

static int py_spoolss_UNIDRVEXTRA_set_dwBookletFlags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwBookletFlags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwBookletFlags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwBookletFlags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UNIDRVEXTRA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwSignature,
		.set = py_spoolss_UNIDRVEXTRA_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "wVer"),
		.get = py_spoolss_UNIDRVEXTRA_get_wVer,
		.set = py_spoolss_UNIDRVEXTRA_set_wVer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wCoreJTExpSize"),
		.get = py_spoolss_UNIDRVEXTRA_get_wCoreJTExpSize,
		.set = py_spoolss_UNIDRVEXTRA_set_wCoreJTExpSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wCoreFullSize"),
		.get = py_spoolss_UNIDRVEXTRA_get_wCoreFullSize,
		.set = py_spoolss_UNIDRVEXTRA_set_wCoreFullSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wOEMExtra"),
		.get = py_spoolss_UNIDRVEXTRA_get_wOEMExtra,
		.set = py_spoolss_UNIDRVEXTRA_set_wOEMExtra,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwChecksum32"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwChecksum32,
		.set = py_spoolss_UNIDRVEXTRA_set_dwChecksum32,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwFlags"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwFlags,
		.set = py_spoolss_UNIDRVEXTRA_set_dwFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMUNI_Flags")
	},
	{
		.name = discard_const_p(char, "bReversePrint"),
		.get = py_spoolss_UNIDRVEXTRA_get_bReversePrint,
		.set = py_spoolss_UNIDRVEXTRA_set_bReversePrint,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "iLayout"),
		.get = py_spoolss_UNIDRVEXTRA_get_iLayout,
		.set = py_spoolss_UNIDRVEXTRA_set_iLayout,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Layout")
	},
	{
		.name = discard_const_p(char, "iQuality"),
		.get = py_spoolss_UNIDRVEXTRA_get_iQuality,
		.set = py_spoolss_UNIDRVEXTRA_set_iQuality,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DMUNI_Quality")
	},
	{
		.name = discard_const_p(char, "wReserved"),
		.get = py_spoolss_UNIDRVEXTRA_get_wReserved,
		.set = py_spoolss_UNIDRVEXTRA_set_wReserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dwOptions"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwOptions,
		.set = py_spoolss_UNIDRVEXTRA_set_dwOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aOptions"),
		.get = py_spoolss_UNIDRVEXTRA_get_aOptions,
		.set = py_spoolss_UNIDRVEXTRA_set_aOptions,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwNupDirection"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwNupDirection,
		.set = py_spoolss_UNIDRVEXTRA_set_dwNupDirection,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_NupDirection")
	},
	{
		.name = discard_const_p(char, "dwNupBorderFlags"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwNupBorderFlags,
		.set = py_spoolss_UNIDRVEXTRA_set_dwNupBorderFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_NupBorderFlags")
	},
	{
		.name = discard_const_p(char, "dwBookletFlags"),
		.get = py_spoolss_UNIDRVEXTRA_get_dwBookletFlags,
		.set = py_spoolss_UNIDRVEXTRA_set_dwBookletFlags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_BookletFlags")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UNIDRVEXTRA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UNIDRVEXTRA, type);
}

static PyObject *py_spoolss_UNIDRVEXTRA_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_UNIDRVEXTRA);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_UNIDRVEXTRA_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_UNIDRVEXTRA);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_UNIDRVEXTRA);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_UNIDRVEXTRA_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_UNIDRVEXTRA *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_UNIDRVEXTRA, "spoolss_UNIDRVEXTRA", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_UNIDRVEXTRA, "spoolss_UNIDRVEXTRA", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_UNIDRVEXTRA_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_UNIDRVEXTRA_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UNIDRVEXTRA_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UNIDRVEXTRA_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_UNIDRVEXTRA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UNIDRVEXTRA",
	.tp_getset = py_spoolss_UNIDRVEXTRA_getsetters,
	.tp_methods = py_spoolss_UNIDRVEXTRA_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UNIDRVEXTRA_new,
};


static PyObject *py_spoolss_JTEXP_get_dwSize(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSize;
	py_dwSize = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSize));
	return py_dwSize;
}

static int py_spoolss_JTEXP_set_dwSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_JTEXP_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_dwVersion(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_dwVersion;
	py_dwVersion = PyLong_FromUnsignedLongLong((uint32_t)(object->dwVersion));
	return py_dwVersion;
}

static int py_spoolss_JTEXP_set_dwVersion(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwVersion");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwVersion));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwVersion = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_wJTHdrSize(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_wJTHdrSize;
	py_wJTHdrSize = PyLong_FromLong((uint16_t)(object->wJTHdrSize));
	return py_wJTHdrSize;
}

static int py_spoolss_JTEXP_set_wJTHdrSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wJTHdrSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wJTHdrSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wJTHdrSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_wCoreMFOSize(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_wCoreMFOSize;
	py_wCoreMFOSize = PyLong_FromLong((uint16_t)(object->wCoreMFOSize));
	return py_wCoreMFOSize;
}

static int py_spoolss_JTEXP_set_wCoreMFOSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->wCoreMFOSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->wCoreMFOSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->wCoreMFOSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_ModelName(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_ModelName;
	py_ModelName = PyString_FromStringOrNULL(object->ModelName);
	return py_ModelName;
}

static int py_spoolss_JTEXP_set_ModelName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ModelName");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->ModelName = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_JTEXP_get_FeatureOptionPairs(PyObject *obj, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(obj);
	PyObject *py_FeatureOptionPairs;
	py_FeatureOptionPairs = pytalloc_GenericObject_reference_ex(pytalloc_get_mem_ctx(obj), object->FeatureOptionPairs);
	return py_FeatureOptionPairs;
}

static int py_spoolss_JTEXP_set_FeatureOptionPairs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JTEXP *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->FeatureOptionPairs");
		return -1;
	}
	object->FeatureOptionPairs = pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_JTEXP_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSize"),
		.get = py_spoolss_JTEXP_get_dwSize,
		.set = py_spoolss_JTEXP_set_dwSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_JTEXP_get_dwSignature,
		.set = py_spoolss_JTEXP_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwVersion"),
		.get = py_spoolss_JTEXP_get_dwVersion,
		.set = py_spoolss_JTEXP_set_dwVersion,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "wJTHdrSize"),
		.get = py_spoolss_JTEXP_get_wJTHdrSize,
		.set = py_spoolss_JTEXP_set_wJTHdrSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "wCoreMFOSize"),
		.get = py_spoolss_JTEXP_get_wCoreMFOSize,
		.set = py_spoolss_JTEXP_set_wCoreMFOSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ModelName"),
		.get = py_spoolss_JTEXP_get_ModelName,
		.set = py_spoolss_JTEXP_set_ModelName,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "FeatureOptionPairs"),
		.get = py_spoolss_JTEXP_get_FeatureOptionPairs,
		.set = py_spoolss_JTEXP_set_FeatureOptionPairs,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JTEXP_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JTEXP, type);
}


static PyTypeObject spoolss_JTEXP_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JTEXP",
	.tp_getset = py_spoolss_JTEXP_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JTEXP_new,
};


static PyObject *py_spoolss_OEM_DMEXTRA_get_dwSize(PyObject *obj, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSize;
	py_dwSize = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSize));
	return py_dwSize;
}

static int py_spoolss_OEM_DMEXTRA_set_dwSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OEM_DMEXTRA_get_dwSignature(PyObject *obj, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwSignature;
	py_dwSignature = PyLong_FromUnsignedLongLong((uint32_t)(object->dwSignature));
	return py_dwSignature;
}

static int py_spoolss_OEM_DMEXTRA_set_dwSignature(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwSignature");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwSignature));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwSignature = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OEM_DMEXTRA_get_dwVersion(PyObject *obj, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwVersion;
	py_dwVersion = PyLong_FromUnsignedLongLong((uint32_t)(object->dwVersion));
	return py_dwVersion;
}

static int py_spoolss_OEM_DMEXTRA_set_dwVersion(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwVersion");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwVersion));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwVersion = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OEM_DMEXTRA_get_Data(PyObject *obj, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(obj);
	PyObject *py_Data;
	py_Data = PyBytes_FromStringAndSize((char *)(object->Data).data, (object->Data).length);
	return py_Data;
}

static int py_spoolss_OEM_DMEXTRA_set_Data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OEM_DMEXTRA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->Data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyGetSetDef py_spoolss_OEM_DMEXTRA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwSize"),
		.get = py_spoolss_OEM_DMEXTRA_get_dwSize,
		.set = py_spoolss_OEM_DMEXTRA_set_dwSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwSignature"),
		.get = py_spoolss_OEM_DMEXTRA_get_dwSignature,
		.set = py_spoolss_OEM_DMEXTRA_set_dwSignature,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DM_Signature")
	},
	{
		.name = discard_const_p(char, "dwVersion"),
		.get = py_spoolss_OEM_DMEXTRA_get_dwVersion,
		.set = py_spoolss_OEM_DMEXTRA_set_dwVersion,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Data"),
		.get = py_spoolss_OEM_DMEXTRA_get_Data,
		.set = py_spoolss_OEM_DMEXTRA_set_Data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_OEM_DMEXTRA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_OEM_DMEXTRA, type);
}


static PyTypeObject spoolss_OEM_DMEXTRA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.OEM_DMEXTRA",
	.tp_getset = py_spoolss_OEM_DMEXTRA_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_OEM_DMEXTRA_new,
};

static PyObject *py_import_spoolss_DeviceModeExtraDataPostScript(TALLOC_CTX *mem_ctx, int level, union spoolss_DeviceModeExtraDataPostScript *in)
{
	PyObject *ret;

	switch (level) {
		case 0x0350:
			ret = pytalloc_reference_ex(&spoolss_PSDRVEXTRA351_Type, mem_ctx, &in->psdrvextra351);
			return ret;

		case 0x0400:
			ret = pytalloc_reference_ex(&spoolss_PSDRVEXTRA400_Type, mem_ctx, &in->psdrvextra400);
			return ret;

		case 0x0501:
			ret = pytalloc_reference_ex(&spoolss_PSDRVEXTRA500_Type, mem_ctx, &in->psdrvextra500);
			return ret;

		case 0x0600:
			ret = pytalloc_reference_ex(&spoolss_PSDRVEXTRA_Type, mem_ctx, &in->psdrvextra);
			return ret;

		default:
			ret = PyBytes_FromStringAndSize((char *)(in->psblob).data, (in->psblob).length);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_DeviceModeExtraDataPostScript *py_export_spoolss_DeviceModeExtraDataPostScript(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_DeviceModeExtraDataPostScript *ret = talloc_zero(mem_ctx, union spoolss_DeviceModeExtraDataPostScript);
	switch (level) {
		case 0x0350:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->psdrvextra351");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PSDRVEXTRA351_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->psdrvextra351 = *(struct spoolss_PSDRVEXTRA351 *)pytalloc_get_ptr(in);
			break;

		case 0x0400:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->psdrvextra400");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PSDRVEXTRA400_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->psdrvextra400 = *(struct spoolss_PSDRVEXTRA400 *)pytalloc_get_ptr(in);
			break;

		case 0x0501:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->psdrvextra500");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PSDRVEXTRA500_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->psdrvextra500 = *(struct spoolss_PSDRVEXTRA500 *)pytalloc_get_ptr(in);
			break;

		case 0x0600:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->psdrvextra");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PSDRVEXTRA_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->psdrvextra = *(struct spoolss_PSDRVEXTRA *)pytalloc_get_ptr(in);
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->psblob");
				talloc_free(ret); return NULL;
			}
			if (!PyBytes_Check(in)) {
				PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(in)->tp_name);
				talloc_free(ret); return NULL;
			}
			ret->psblob = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
			break;

	}

	return ret;
}

static PyObject *py_spoolss_DeviceModeExtraDataPostScript_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_DeviceModeExtraDataPostScript *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_DeviceModeExtraDataPostScript *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_DeviceModeExtraDataPostScript!");
		return NULL;
	}

	return py_import_spoolss_DeviceModeExtraDataPostScript(mem_ctx, level, in);
}

static PyObject *py_spoolss_DeviceModeExtraDataPostScript_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_DeviceModeExtraDataPostScript *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_DeviceModeExtraDataPostScript(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_DeviceModeExtraDataPostScript_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceModeExtraDataPostScript_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceModeExtraDataPostScript_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_DeviceModeExtraDataPostScript_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_DeviceModeExtraDataPostScript_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeviceModeExtraDataPostScript",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_DeviceModeExtraDataPostScript_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeviceModeExtraDataPostScript_new,
};

static PyObject *py_import_spoolss_DeviceModeExtraDataUniDriver(TALLOC_CTX *mem_ctx, int level, union spoolss_DeviceModeExtraDataUniDriver *in)
{
	PyObject *ret;

	switch (level) {
		case 0x0301:
			ret = pytalloc_reference_ex(&spoolss_UNIDRVEXTRA3_4_Type, mem_ctx, &in->unidrvextra3_4);
			return ret;

		case 0x0500:
			ret = pytalloc_reference_ex(&spoolss_UNIDRVEXTRA500_Type, mem_ctx, &in->unidrvextra500);
			return ret;

		case 0x0600:
			ret = pytalloc_reference_ex(&spoolss_UNIDRVEXTRA_Type, mem_ctx, &in->unidrvextra);
			return ret;

		default:
			ret = PyBytes_FromStringAndSize((char *)(in->uniblob).data, (in->uniblob).length);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_DeviceModeExtraDataUniDriver *py_export_spoolss_DeviceModeExtraDataUniDriver(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_DeviceModeExtraDataUniDriver *ret = talloc_zero(mem_ctx, union spoolss_DeviceModeExtraDataUniDriver);
	switch (level) {
		case 0x0301:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->unidrvextra3_4");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_UNIDRVEXTRA3_4_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->unidrvextra3_4 = *(struct spoolss_UNIDRVEXTRA3_4 *)pytalloc_get_ptr(in);
			break;

		case 0x0500:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->unidrvextra500");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_UNIDRVEXTRA500_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->unidrvextra500 = *(struct spoolss_UNIDRVEXTRA500 *)pytalloc_get_ptr(in);
			break;

		case 0x0600:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->unidrvextra");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_UNIDRVEXTRA_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->unidrvextra = *(struct spoolss_UNIDRVEXTRA *)pytalloc_get_ptr(in);
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->uniblob");
				talloc_free(ret); return NULL;
			}
			if (!PyBytes_Check(in)) {
				PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(in)->tp_name);
				talloc_free(ret); return NULL;
			}
			ret->uniblob = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
			break;

	}

	return ret;
}

static PyObject *py_spoolss_DeviceModeExtraDataUniDriver_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_DeviceModeExtraDataUniDriver *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_DeviceModeExtraDataUniDriver *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_DeviceModeExtraDataUniDriver!");
		return NULL;
	}

	return py_import_spoolss_DeviceModeExtraDataUniDriver(mem_ctx, level, in);
}

static PyObject *py_spoolss_DeviceModeExtraDataUniDriver_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_DeviceModeExtraDataUniDriver *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_DeviceModeExtraDataUniDriver(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_DeviceModeExtraDataUniDriver_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceModeExtraDataUniDriver_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceModeExtraDataUniDriver_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_DeviceModeExtraDataUniDriver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_DeviceModeExtraDataUniDriver_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeviceModeExtraDataUniDriver",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_DeviceModeExtraDataUniDriver_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeviceModeExtraDataUniDriver_new,
};


static PyObject *py_spoolss_DeviceMode_get_devicename(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_devicename;
	if (object->devicename == NULL) {
		py_devicename = Py_None;
		Py_INCREF(py_devicename);
	} else {
		py_devicename = PyUnicode_Decode(object->devicename, strlen(object->devicename), "utf-8", "ignore");
	}
	return py_devicename;
}

static int py_spoolss_DeviceMode_set_devicename(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devicename");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devicename = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_specversion(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_specversion;
	py_specversion = PyLong_FromLong((uint16_t)(object->specversion));
	return py_specversion;
}

static int py_spoolss_DeviceMode_set_specversion(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->specversion");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->specversion));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->specversion = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_driverversion(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_driverversion;
	py_driverversion = PyLong_FromLong((uint16_t)(object->driverversion));
	return py_driverversion;
}

static int py_spoolss_DeviceMode_set_driverversion(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driverversion");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driverversion));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driverversion = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_size(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromLong((uint16_t)(object->size));
	return py_size;
}

static int py_spoolss_DeviceMode_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get___driverextra_length(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py___driverextra_length;
	py___driverextra_length = PyLong_FromLong((uint16_t)(object->__driverextra_length));
	return py___driverextra_length;
}

static int py_spoolss_DeviceMode_set___driverextra_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->__driverextra_length");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->__driverextra_length));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->__driverextra_length = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_fields(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_fields;
	py_fields = PyLong_FromUnsignedLongLong((uint32_t)(object->fields));
	return py_fields;
}

static int py_spoolss_DeviceMode_set_fields(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fields");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fields));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->fields = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_orientation(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_orientation;
	py_orientation = PyLong_FromLong((uint16_t)(object->orientation));
	return py_orientation;
}

static int py_spoolss_DeviceMode_set_orientation(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->orientation");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->orientation));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->orientation = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_papersize(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_papersize;
	py_papersize = PyLong_FromLong((uint16_t)(object->papersize));
	return py_papersize;
}

static int py_spoolss_DeviceMode_set_papersize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->papersize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->papersize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->papersize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_paperlength(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_paperlength;
	py_paperlength = PyLong_FromLong((uint16_t)(object->paperlength));
	return py_paperlength;
}

static int py_spoolss_DeviceMode_set_paperlength(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->paperlength");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paperlength));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->paperlength = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_paperwidth(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_paperwidth;
	py_paperwidth = PyLong_FromLong((uint16_t)(object->paperwidth));
	return py_paperwidth;
}

static int py_spoolss_DeviceMode_set_paperwidth(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->paperwidth");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->paperwidth));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->paperwidth = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_scale(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_scale;
	py_scale = PyLong_FromLong((uint16_t)(object->scale));
	return py_scale;
}

static int py_spoolss_DeviceMode_set_scale(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->scale");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->scale));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->scale = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_copies(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_copies;
	py_copies = PyLong_FromLong((uint16_t)(object->copies));
	return py_copies;
}

static int py_spoolss_DeviceMode_set_copies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->copies");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->copies));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->copies = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_defaultsource(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_defaultsource;
	py_defaultsource = PyLong_FromLong((uint16_t)(object->defaultsource));
	return py_defaultsource;
}

static int py_spoolss_DeviceMode_set_defaultsource(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->defaultsource");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->defaultsource));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->defaultsource = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_printquality(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_printquality;
	py_printquality = PyLong_FromLong((uint16_t)(object->printquality));
	return py_printquality;
}

static int py_spoolss_DeviceMode_set_printquality(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printquality");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->printquality));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->printquality = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_color(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_color;
	py_color = PyLong_FromLong((uint16_t)(object->color));
	return py_color;
}

static int py_spoolss_DeviceMode_set_color(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->color");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->color));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->color = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_duplex(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_duplex;
	py_duplex = PyLong_FromLong((uint16_t)(object->duplex));
	return py_duplex;
}

static int py_spoolss_DeviceMode_set_duplex(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->duplex");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->duplex));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->duplex = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_yresolution(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_yresolution;
	py_yresolution = PyLong_FromLong((uint16_t)(object->yresolution));
	return py_yresolution;
}

static int py_spoolss_DeviceMode_set_yresolution(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->yresolution");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->yresolution));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->yresolution = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_ttoption(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_ttoption;
	py_ttoption = PyLong_FromLong((uint16_t)(object->ttoption));
	return py_ttoption;
}

static int py_spoolss_DeviceMode_set_ttoption(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ttoption");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ttoption));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ttoption = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_collate(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_collate;
	py_collate = PyLong_FromLong((uint16_t)(object->collate));
	return py_collate;
}

static int py_spoolss_DeviceMode_set_collate(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->collate");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->collate));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->collate = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_formname(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_formname;
	if (object->formname == NULL) {
		py_formname = Py_None;
		Py_INCREF(py_formname);
	} else {
		py_formname = PyUnicode_Decode(object->formname, strlen(object->formname), "utf-8", "ignore");
	}
	return py_formname;
}

static int py_spoolss_DeviceMode_set_formname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->formname");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->formname = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_logpixels(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_logpixels;
	py_logpixels = PyLong_FromLong((uint16_t)(object->logpixels));
	return py_logpixels;
}

static int py_spoolss_DeviceMode_set_logpixels(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->logpixels");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->logpixels));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->logpixels = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_bitsperpel(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_bitsperpel;
	py_bitsperpel = PyLong_FromUnsignedLongLong((uint32_t)(object->bitsperpel));
	return py_bitsperpel;
}

static int py_spoolss_DeviceMode_set_bitsperpel(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bitsperpel");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bitsperpel));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bitsperpel = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_pelswidth(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_pelswidth;
	py_pelswidth = PyLong_FromUnsignedLongLong((uint32_t)(object->pelswidth));
	return py_pelswidth;
}

static int py_spoolss_DeviceMode_set_pelswidth(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pelswidth");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pelswidth));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pelswidth = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_pelsheight(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_pelsheight;
	py_pelsheight = PyLong_FromUnsignedLongLong((uint32_t)(object->pelsheight));
	return py_pelsheight;
}

static int py_spoolss_DeviceMode_set_pelsheight(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pelsheight");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pelsheight));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pelsheight = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_displayflags(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_displayflags;
	py_displayflags = PyLong_FromUnsignedLongLong((uint32_t)(object->displayflags));
	return py_displayflags;
}

static int py_spoolss_DeviceMode_set_displayflags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->displayflags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->displayflags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->displayflags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_displayfrequency(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_displayfrequency;
	py_displayfrequency = PyLong_FromUnsignedLongLong((uint32_t)(object->displayfrequency));
	return py_displayfrequency;
}

static int py_spoolss_DeviceMode_set_displayfrequency(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->displayfrequency");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->displayfrequency));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->displayfrequency = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_icmmethod(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_icmmethod;
	py_icmmethod = PyLong_FromUnsignedLongLong((uint32_t)(object->icmmethod));
	return py_icmmethod;
}

static int py_spoolss_DeviceMode_set_icmmethod(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->icmmethod");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->icmmethod));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->icmmethod = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_icmintent(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_icmintent;
	py_icmintent = PyLong_FromUnsignedLongLong((uint32_t)(object->icmintent));
	return py_icmintent;
}

static int py_spoolss_DeviceMode_set_icmintent(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->icmintent");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->icmintent));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->icmintent = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_mediatype(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_mediatype;
	py_mediatype = PyLong_FromUnsignedLongLong((uint32_t)(object->mediatype));
	return py_mediatype;
}

static int py_spoolss_DeviceMode_set_mediatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mediatype");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->mediatype));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->mediatype = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_dithertype(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_dithertype;
	py_dithertype = PyLong_FromUnsignedLongLong((uint32_t)(object->dithertype));
	return py_dithertype;
}

static int py_spoolss_DeviceMode_set_dithertype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dithertype");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dithertype));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dithertype = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_reserved1(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved1;
	py_reserved1 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved1));
	return py_reserved1;
}

static int py_spoolss_DeviceMode_set_reserved1(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved1");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved1));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved1 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_reserved2(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved2;
	py_reserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved2));
	return py_reserved2;
}

static int py_spoolss_DeviceMode_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_panningwidth(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_panningwidth;
	py_panningwidth = PyLong_FromUnsignedLongLong((uint32_t)(object->panningwidth));
	return py_panningwidth;
}

static int py_spoolss_DeviceMode_set_panningwidth(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->panningwidth");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->panningwidth));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->panningwidth = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_panningheight(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_panningheight;
	py_panningheight = PyLong_FromUnsignedLongLong((uint32_t)(object->panningheight));
	return py_panningheight;
}

static int py_spoolss_DeviceMode_set_panningheight(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->panningheight");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->panningheight));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->panningheight = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeviceMode_get_driverextra_data(PyObject *obj, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(obj);
	PyObject *py_driverextra_data;
	py_driverextra_data = PyBytes_FromStringAndSize((char *)(object->driverextra_data).data, (object->driverextra_data).length);
	return py_driverextra_data;
}

static int py_spoolss_DeviceMode_set_driverextra_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driverextra_data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->driverextra_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeviceMode_getsetters[] = {
	{
		.name = discard_const_p(char, "devicename"),
		.get = py_spoolss_DeviceMode_get_devicename,
		.set = py_spoolss_DeviceMode_set_devicename,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "specversion"),
		.get = py_spoolss_DeviceMode_get_specversion,
		.set = py_spoolss_DeviceMode_set_specversion,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeSpecVersion")
	},
	{
		.name = discard_const_p(char, "driverversion"),
		.get = py_spoolss_DeviceMode_get_driverversion,
		.set = py_spoolss_DeviceMode_set_driverversion,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_DeviceMode_get_size,
		.set = py_spoolss_DeviceMode_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "__driverextra_length"),
		.get = py_spoolss_DeviceMode_get___driverextra_length,
		.set = py_spoolss_DeviceMode_set___driverextra_length,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "fields"),
		.get = py_spoolss_DeviceMode_get_fields,
		.set = py_spoolss_DeviceMode_set_fields,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeFields")
	},
	{
		.name = discard_const_p(char, "orientation"),
		.get = py_spoolss_DeviceMode_get_orientation,
		.set = py_spoolss_DeviceMode_set_orientation,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeOrientation")
	},
	{
		.name = discard_const_p(char, "papersize"),
		.get = py_spoolss_DeviceMode_get_papersize,
		.set = py_spoolss_DeviceMode_set_papersize,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModePaperSize")
	},
	{
		.name = discard_const_p(char, "paperlength"),
		.get = py_spoolss_DeviceMode_get_paperlength,
		.set = py_spoolss_DeviceMode_set_paperlength,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "paperwidth"),
		.get = py_spoolss_DeviceMode_get_paperwidth,
		.set = py_spoolss_DeviceMode_set_paperwidth,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "scale"),
		.get = py_spoolss_DeviceMode_get_scale,
		.set = py_spoolss_DeviceMode_set_scale,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "copies"),
		.get = py_spoolss_DeviceMode_get_copies,
		.set = py_spoolss_DeviceMode_set_copies,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "defaultsource"),
		.get = py_spoolss_DeviceMode_get_defaultsource,
		.set = py_spoolss_DeviceMode_set_defaultsource,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeDefaultSource")
	},
	{
		.name = discard_const_p(char, "printquality"),
		.get = py_spoolss_DeviceMode_get_printquality,
		.set = py_spoolss_DeviceMode_set_printquality,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModePrintQuality")
	},
	{
		.name = discard_const_p(char, "color"),
		.get = py_spoolss_DeviceMode_get_color,
		.set = py_spoolss_DeviceMode_set_color,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeColor")
	},
	{
		.name = discard_const_p(char, "duplex"),
		.get = py_spoolss_DeviceMode_get_duplex,
		.set = py_spoolss_DeviceMode_set_duplex,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeDuplex")
	},
	{
		.name = discard_const_p(char, "yresolution"),
		.get = py_spoolss_DeviceMode_get_yresolution,
		.set = py_spoolss_DeviceMode_set_yresolution,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ttoption"),
		.get = py_spoolss_DeviceMode_get_ttoption,
		.set = py_spoolss_DeviceMode_set_ttoption,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeTTOption")
	},
	{
		.name = discard_const_p(char, "collate"),
		.get = py_spoolss_DeviceMode_get_collate,
		.set = py_spoolss_DeviceMode_set_collate,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeCollate")
	},
	{
		.name = discard_const_p(char, "formname"),
		.get = py_spoolss_DeviceMode_get_formname,
		.set = py_spoolss_DeviceMode_set_formname,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "logpixels"),
		.get = py_spoolss_DeviceMode_get_logpixels,
		.set = py_spoolss_DeviceMode_set_logpixels,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "bitsperpel"),
		.get = py_spoolss_DeviceMode_get_bitsperpel,
		.set = py_spoolss_DeviceMode_set_bitsperpel,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pelswidth"),
		.get = py_spoolss_DeviceMode_get_pelswidth,
		.set = py_spoolss_DeviceMode_set_pelswidth,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pelsheight"),
		.get = py_spoolss_DeviceMode_get_pelsheight,
		.set = py_spoolss_DeviceMode_set_pelsheight,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "displayflags"),
		.get = py_spoolss_DeviceMode_get_displayflags,
		.set = py_spoolss_DeviceMode_set_displayflags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeNUp")
	},
	{
		.name = discard_const_p(char, "displayfrequency"),
		.get = py_spoolss_DeviceMode_get_displayfrequency,
		.set = py_spoolss_DeviceMode_set_displayfrequency,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "icmmethod"),
		.get = py_spoolss_DeviceMode_get_icmmethod,
		.set = py_spoolss_DeviceMode_set_icmmethod,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeICMMethod")
	},
	{
		.name = discard_const_p(char, "icmintent"),
		.get = py_spoolss_DeviceMode_get_icmintent,
		.set = py_spoolss_DeviceMode_set_icmintent,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeICMIntent")
	},
	{
		.name = discard_const_p(char, "mediatype"),
		.get = py_spoolss_DeviceMode_get_mediatype,
		.set = py_spoolss_DeviceMode_set_mediatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeMediaType")
	},
	{
		.name = discard_const_p(char, "dithertype"),
		.get = py_spoolss_DeviceMode_get_dithertype,
		.set = py_spoolss_DeviceMode_set_dithertype,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceModeDitherType")
	},
	{
		.name = discard_const_p(char, "reserved1"),
		.get = py_spoolss_DeviceMode_get_reserved1,
		.set = py_spoolss_DeviceMode_set_reserved1,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved2"),
		.get = py_spoolss_DeviceMode_get_reserved2,
		.set = py_spoolss_DeviceMode_set_reserved2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "panningwidth"),
		.get = py_spoolss_DeviceMode_get_panningwidth,
		.set = py_spoolss_DeviceMode_set_panningwidth,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "panningheight"),
		.get = py_spoolss_DeviceMode_get_panningheight,
		.set = py_spoolss_DeviceMode_set_panningheight,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "driverextra_data"),
		.get = py_spoolss_DeviceMode_get_driverextra_data,
		.set = py_spoolss_DeviceMode_set_driverextra_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeviceMode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DeviceMode, type);
}

static PyObject *py_spoolss_DeviceMode_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DeviceMode);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DeviceMode_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DeviceMode);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DeviceMode);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeviceMode_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DeviceMode *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DeviceMode, "spoolss_DeviceMode", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DeviceMode, "spoolss_DeviceMode", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DeviceMode_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DeviceMode_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceMode_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeviceMode_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeviceMode_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeviceMode",
	.tp_getset = py_spoolss_DeviceMode_getsetters,
	.tp_methods = py_spoolss_DeviceMode_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeviceMode_new,
};


static PyObject *py_spoolss_PrinterInfo1_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_PrinterInfo1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo1_get_description(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_description;
	if (object->description == NULL) {
		Py_RETURN_NONE;
	}
	if (object->description == NULL) {
		py_description = Py_None;
		Py_INCREF(py_description);
	} else {
		py_description = PyString_FromStringOrNULL(object->description);
	}
	return py_description;
}

static int py_spoolss_PrinterInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->description");
		return -1;
	}
	if (value == Py_None) {
		object->description = NULL;
	} else {
		object->description = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->description = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo1_get_name(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_name;
	if (object->name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->name == NULL) {
		py_name = Py_None;
		Py_INCREF(py_name);
	} else {
		py_name = PyString_FromStringOrNULL(object->name);
	}
	return py_name;
}

static int py_spoolss_PrinterInfo1_set_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
		return -1;
	}
	if (value == Py_None) {
		object->name = NULL;
	} else {
		object->name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo1_get_comment(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_comment;
	if (object->comment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->comment == NULL) {
		py_comment = Py_None;
		Py_INCREF(py_comment);
	} else {
		py_comment = PyString_FromStringOrNULL(object->comment);
	}
	return py_comment;
}

static int py_spoolss_PrinterInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->comment");
		return -1;
	}
	if (value == Py_None) {
		object->comment = NULL;
	} else {
		object->comment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->comment = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_PrinterInfo1_get_flags,
		.set = py_spoolss_PrinterInfo1_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_EnumPrinterFlags")
	},
	{
		.name = discard_const_p(char, "description"),
		.get = py_spoolss_PrinterInfo1_get_description,
		.set = py_spoolss_PrinterInfo1_set_description,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "name"),
		.get = py_spoolss_PrinterInfo1_get_name,
		.set = py_spoolss_PrinterInfo1_set_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "comment"),
		.get = py_spoolss_PrinterInfo1_get_comment,
		.set = py_spoolss_PrinterInfo1_set_comment,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo1, type);
}

static PyObject *py_spoolss_PrinterInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo1, "spoolss_PrinterInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo1, "spoolss_PrinterInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo1",
	.tp_getset = py_spoolss_PrinterInfo1_getsetters,
	.tp_methods = py_spoolss_PrinterInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo1_new,
};


static PyObject *py_spoolss_PrinterInfo2_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		py_servername = PyString_FromStringOrNULL(object->servername);
	}
	return py_servername;
}

static int py_spoolss_PrinterInfo2_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyString_FromStringOrNULL(object->printername);
	}
	return py_printername;
}

static int py_spoolss_PrinterInfo2_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_sharename(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_sharename;
	if (object->sharename == NULL) {
		Py_RETURN_NONE;
	}
	if (object->sharename == NULL) {
		py_sharename = Py_None;
		Py_INCREF(py_sharename);
	} else {
		py_sharename = PyString_FromStringOrNULL(object->sharename);
	}
	return py_sharename;
}

static int py_spoolss_PrinterInfo2_set_sharename(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sharename");
		return -1;
	}
	if (value == Py_None) {
		object->sharename = NULL;
	} else {
		object->sharename = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->sharename = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		Py_RETURN_NONE;
	}
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		py_portname = PyString_FromStringOrNULL(object->portname);
	}
	return py_portname;
}

static int py_spoolss_PrinterInfo2_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	if (value == Py_None) {
		object->portname = NULL;
	} else {
		object->portname = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->portname = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_drivername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_drivername;
	if (object->drivername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->drivername == NULL) {
		py_drivername = Py_None;
		Py_INCREF(py_drivername);
	} else {
		py_drivername = PyString_FromStringOrNULL(object->drivername);
	}
	return py_drivername;
}

static int py_spoolss_PrinterInfo2_set_drivername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->drivername");
		return -1;
	}
	if (value == Py_None) {
		object->drivername = NULL;
	} else {
		object->drivername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->drivername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_comment(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_comment;
	if (object->comment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->comment == NULL) {
		py_comment = Py_None;
		Py_INCREF(py_comment);
	} else {
		py_comment = PyString_FromStringOrNULL(object->comment);
	}
	return py_comment;
}

static int py_spoolss_PrinterInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->comment");
		return -1;
	}
	if (value == Py_None) {
		object->comment = NULL;
	} else {
		object->comment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->comment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_location(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_location;
	if (object->location == NULL) {
		Py_RETURN_NONE;
	}
	if (object->location == NULL) {
		py_location = Py_None;
		Py_INCREF(py_location);
	} else {
		py_location = PyString_FromStringOrNULL(object->location);
	}
	return py_location;
}

static int py_spoolss_PrinterInfo2_set_location(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->location");
		return -1;
	}
	if (value == Py_None) {
		object->location = NULL;
	} else {
		object->location = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->location = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_devmode(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode;
	if (object->devmode == NULL) {
		Py_RETURN_NONE;
	}
	if (object->devmode == NULL) {
		py_devmode = Py_None;
		Py_INCREF(py_devmode);
	} else {
		py_devmode = pytalloc_reference_ex(&spoolss_DeviceMode_Type, object->devmode, object->devmode);
	}
	return py_devmode;
}

static int py_spoolss_PrinterInfo2_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->devmode));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode");
		return -1;
	}
	if (value == Py_None) {
		object->devmode = NULL;
	} else {
		object->devmode = NULL;
		PY_CHECK_TYPE(&spoolss_DeviceMode_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devmode = (struct spoolss_DeviceMode *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_sepfile(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_sepfile;
	if (object->sepfile == NULL) {
		Py_RETURN_NONE;
	}
	if (object->sepfile == NULL) {
		py_sepfile = Py_None;
		Py_INCREF(py_sepfile);
	} else {
		py_sepfile = PyString_FromStringOrNULL(object->sepfile);
	}
	return py_sepfile;
}

static int py_spoolss_PrinterInfo2_set_sepfile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sepfile");
		return -1;
	}
	if (value == Py_None) {
		object->sepfile = NULL;
	} else {
		object->sepfile = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->sepfile = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_printprocessor(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printprocessor;
	if (object->printprocessor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printprocessor == NULL) {
		py_printprocessor = Py_None;
		Py_INCREF(py_printprocessor);
	} else {
		py_printprocessor = PyString_FromStringOrNULL(object->printprocessor);
	}
	return py_printprocessor;
}

static int py_spoolss_PrinterInfo2_set_printprocessor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printprocessor");
		return -1;
	}
	if (value == Py_None) {
		object->printprocessor = NULL;
	} else {
		object->printprocessor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printprocessor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_datatype(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_datatype;
	if (object->datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->datatype == NULL) {
		py_datatype = Py_None;
		Py_INCREF(py_datatype);
	} else {
		py_datatype = PyString_FromStringOrNULL(object->datatype);
	}
	return py_datatype;
}

static int py_spoolss_PrinterInfo2_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->datatype");
		return -1;
	}
	if (value == Py_None) {
		object->datatype = NULL;
	} else {
		object->datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		py_parameters = PyString_FromStringOrNULL(object->parameters);
	}
	return py_parameters;
}

static int py_spoolss_PrinterInfo2_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_secdesc(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc;
	if (object->secdesc == NULL) {
		Py_RETURN_NONE;
	}
	if (object->secdesc == NULL) {
		py_secdesc = Py_None;
		Py_INCREF(py_secdesc);
	} else {
		py_secdesc = pytalloc_reference_ex(security_descriptor_Type, object->secdesc, object->secdesc);
	}
	return py_secdesc;
}

static int py_spoolss_PrinterInfo2_set_secdesc(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->secdesc));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secdesc");
		return -1;
	}
	if (value == Py_None) {
		object->secdesc = NULL;
	} else {
		object->secdesc = NULL;
		PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->secdesc = (struct security_descriptor *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_PrinterInfo2_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_PrinterInfo2_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_defaultpriority(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_defaultpriority;
	py_defaultpriority = PyLong_FromUnsignedLongLong((uint32_t)(object->defaultpriority));
	return py_defaultpriority;
}

static int py_spoolss_PrinterInfo2_set_defaultpriority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->defaultpriority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->defaultpriority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->defaultpriority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_starttime(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_starttime;
	py_starttime = PyLong_FromUnsignedLongLong((uint32_t)(object->starttime));
	return py_starttime;
}

static int py_spoolss_PrinterInfo2_set_starttime(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->starttime");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->starttime));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->starttime = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_untiltime(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_untiltime;
	py_untiltime = PyLong_FromUnsignedLongLong((uint32_t)(object->untiltime));
	return py_untiltime;
}

static int py_spoolss_PrinterInfo2_set_untiltime(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->untiltime");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->untiltime));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->untiltime = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_status(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_PrinterInfo2_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_cjobs(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_cjobs;
	py_cjobs = PyLong_FromUnsignedLongLong((uint32_t)(object->cjobs));
	return py_cjobs;
}

static int py_spoolss_PrinterInfo2_set_cjobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cjobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cjobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo2_get_averageppm(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_averageppm;
	py_averageppm = PyLong_FromUnsignedLongLong((uint32_t)(object->averageppm));
	return py_averageppm;
}

static int py_spoolss_PrinterInfo2_set_averageppm(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->averageppm");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->averageppm));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->averageppm = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_PrinterInfo2_get_servername,
		.set = py_spoolss_PrinterInfo2_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_PrinterInfo2_get_printername,
		.set = py_spoolss_PrinterInfo2_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "sharename"),
		.get = py_spoolss_PrinterInfo2_get_sharename,
		.set = py_spoolss_PrinterInfo2_set_sharename,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_PrinterInfo2_get_portname,
		.set = py_spoolss_PrinterInfo2_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "drivername"),
		.get = py_spoolss_PrinterInfo2_get_drivername,
		.set = py_spoolss_PrinterInfo2_set_drivername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "comment"),
		.get = py_spoolss_PrinterInfo2_get_comment,
		.set = py_spoolss_PrinterInfo2_set_comment,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "location"),
		.get = py_spoolss_PrinterInfo2_get_location,
		.set = py_spoolss_PrinterInfo2_set_location,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "devmode"),
		.get = py_spoolss_PrinterInfo2_get_devmode,
		.set = py_spoolss_PrinterInfo2_set_devmode,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceMode")
	},
	{
		.name = discard_const_p(char, "sepfile"),
		.get = py_spoolss_PrinterInfo2_get_sepfile,
		.set = py_spoolss_PrinterInfo2_set_sepfile,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "printprocessor"),
		.get = py_spoolss_PrinterInfo2_get_printprocessor,
		.set = py_spoolss_PrinterInfo2_set_printprocessor,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "datatype"),
		.get = py_spoolss_PrinterInfo2_get_datatype,
		.set = py_spoolss_PrinterInfo2_set_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_PrinterInfo2_get_parameters,
		.set = py_spoolss_PrinterInfo2_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "secdesc"),
		.get = py_spoolss_PrinterInfo2_get_secdesc,
		.set = py_spoolss_PrinterInfo2_set_secdesc,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_security_descriptor")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_PrinterInfo2_get_attributes,
		.set = py_spoolss_PrinterInfo2_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_PrinterInfo2_get_priority,
		.set = py_spoolss_PrinterInfo2_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "defaultpriority"),
		.get = py_spoolss_PrinterInfo2_get_defaultpriority,
		.set = py_spoolss_PrinterInfo2_set_defaultpriority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "starttime"),
		.get = py_spoolss_PrinterInfo2_get_starttime,
		.set = py_spoolss_PrinterInfo2_set_starttime,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "untiltime"),
		.get = py_spoolss_PrinterInfo2_get_untiltime,
		.set = py_spoolss_PrinterInfo2_set_untiltime,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_PrinterInfo2_get_status,
		.set = py_spoolss_PrinterInfo2_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{
		.name = discard_const_p(char, "cjobs"),
		.get = py_spoolss_PrinterInfo2_get_cjobs,
		.set = py_spoolss_PrinterInfo2_set_cjobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "averageppm"),
		.get = py_spoolss_PrinterInfo2_get_averageppm,
		.set = py_spoolss_PrinterInfo2_set_averageppm,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo2, type);
}

static PyObject *py_spoolss_PrinterInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo2, "spoolss_PrinterInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo2, "spoolss_PrinterInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo2",
	.tp_getset = py_spoolss_PrinterInfo2_getsetters,
	.tp_methods = py_spoolss_PrinterInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo2_new,
};


static PyObject *py_spoolss_PrinterInfo3_get_secdesc(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc;
	if (object->secdesc == NULL) {
		Py_RETURN_NONE;
	}
	if (object->secdesc == NULL) {
		py_secdesc = Py_None;
		Py_INCREF(py_secdesc);
	} else {
		py_secdesc = pytalloc_reference_ex(security_descriptor_Type, object->secdesc, object->secdesc);
	}
	return py_secdesc;
}

static int py_spoolss_PrinterInfo3_set_secdesc(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo3 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->secdesc));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secdesc");
		return -1;
	}
	if (value == Py_None) {
		object->secdesc = NULL;
	} else {
		object->secdesc = NULL;
		PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->secdesc = (struct security_descriptor *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "secdesc"),
		.get = py_spoolss_PrinterInfo3_get_secdesc,
		.set = py_spoolss_PrinterInfo3_set_secdesc,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_security_descriptor")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo3, type);
}

static PyObject *py_spoolss_PrinterInfo3_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo3 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo3);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo3 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo3);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo3);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo3_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo3 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo3, "spoolss_PrinterInfo3", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo3, "spoolss_PrinterInfo3", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo3_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo3_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo3",
	.tp_getset = py_spoolss_PrinterInfo3_getsetters,
	.tp_methods = py_spoolss_PrinterInfo3_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo3_new,
};


static PyObject *py_spoolss_PrinterInfo4_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyString_FromStringOrNULL(object->printername);
	}
	return py_printername;
}

static int py_spoolss_PrinterInfo4_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo4_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		py_servername = PyString_FromStringOrNULL(object->servername);
	}
	return py_servername;
}

static int py_spoolss_PrinterInfo4_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo4_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_PrinterInfo4_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_PrinterInfo4_get_printername,
		.set = py_spoolss_PrinterInfo4_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_PrinterInfo4_get_servername,
		.set = py_spoolss_PrinterInfo4_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_PrinterInfo4_get_attributes,
		.set = py_spoolss_PrinterInfo4_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo4, type);
}

static PyObject *py_spoolss_PrinterInfo4_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo4);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo4_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo4);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo4);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo4_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo4, "spoolss_PrinterInfo4", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo4, "spoolss_PrinterInfo4", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo4_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo4_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo4_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo4_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo4",
	.tp_getset = py_spoolss_PrinterInfo4_getsetters,
	.tp_methods = py_spoolss_PrinterInfo4_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo4_new,
};


static PyObject *py_spoolss_PrinterInfo5_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyString_FromStringOrNULL(object->printername);
	}
	return py_printername;
}

static int py_spoolss_PrinterInfo5_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo5_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		Py_RETURN_NONE;
	}
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		py_portname = PyString_FromStringOrNULL(object->portname);
	}
	return py_portname;
}

static int py_spoolss_PrinterInfo5_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	if (value == Py_None) {
		object->portname = NULL;
	} else {
		object->portname = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->portname = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo5_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_PrinterInfo5_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo5_get_device_not_selected_timeout(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_device_not_selected_timeout;
	py_device_not_selected_timeout = PyLong_FromUnsignedLongLong((uint32_t)(object->device_not_selected_timeout));
	return py_device_not_selected_timeout;
}

static int py_spoolss_PrinterInfo5_set_device_not_selected_timeout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_not_selected_timeout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->device_not_selected_timeout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->device_not_selected_timeout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo5_get_transmission_retry_timeout(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_transmission_retry_timeout;
	py_transmission_retry_timeout = PyLong_FromUnsignedLongLong((uint32_t)(object->transmission_retry_timeout));
	return py_transmission_retry_timeout;
}

static int py_spoolss_PrinterInfo5_set_transmission_retry_timeout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->transmission_retry_timeout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->transmission_retry_timeout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->transmission_retry_timeout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo5_getsetters[] = {
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_PrinterInfo5_get_printername,
		.set = py_spoolss_PrinterInfo5_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_PrinterInfo5_get_portname,
		.set = py_spoolss_PrinterInfo5_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_PrinterInfo5_get_attributes,
		.set = py_spoolss_PrinterInfo5_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{
		.name = discard_const_p(char, "device_not_selected_timeout"),
		.get = py_spoolss_PrinterInfo5_get_device_not_selected_timeout,
		.set = py_spoolss_PrinterInfo5_set_device_not_selected_timeout,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "transmission_retry_timeout"),
		.get = py_spoolss_PrinterInfo5_get_transmission_retry_timeout,
		.set = py_spoolss_PrinterInfo5_set_transmission_retry_timeout,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo5, type);
}

static PyObject *py_spoolss_PrinterInfo5_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo5);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo5_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo5);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo5);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo5_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo5, "spoolss_PrinterInfo5", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo5, "spoolss_PrinterInfo5", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo5_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo5_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo5_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo5_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo5_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo5",
	.tp_getset = py_spoolss_PrinterInfo5_getsetters,
	.tp_methods = py_spoolss_PrinterInfo5_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo5_new,
};


static PyObject *py_spoolss_PrinterInfo6_get_status(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_PrinterInfo6_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo6_getsetters[] = {
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_PrinterInfo6_get_status,
		.set = py_spoolss_PrinterInfo6_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo6, type);
}

static PyObject *py_spoolss_PrinterInfo6_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo6 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo6);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo6_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo6 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo6);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo6);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo6_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo6 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo6, "spoolss_PrinterInfo6", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo6, "spoolss_PrinterInfo6", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo6_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo6_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo6_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo6_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo6_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo6",
	.tp_getset = py_spoolss_PrinterInfo6_getsetters,
	.tp_methods = py_spoolss_PrinterInfo6_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo6_new,
};


static PyObject *py_spoolss_PrinterInfo7_get_guid(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_guid;
	if (object->guid == NULL) {
		Py_RETURN_NONE;
	}
	if (object->guid == NULL) {
		py_guid = Py_None;
		Py_INCREF(py_guid);
	} else {
		py_guid = PyString_FromStringOrNULL(object->guid);
	}
	return py_guid;
}

static int py_spoolss_PrinterInfo7_set_guid(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->guid");
		return -1;
	}
	if (value == Py_None) {
		object->guid = NULL;
	} else {
		object->guid = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->guid = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterInfo7_get_action(PyObject *obj, void *closure)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_action;
	py_action = PyLong_FromUnsignedLongLong((uint32_t)(object->action));
	return py_action;
}

static int py_spoolss_PrinterInfo7_set_action(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->action");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->action));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->action = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterInfo7_getsetters[] = {
	{
		.name = discard_const_p(char, "guid"),
		.get = py_spoolss_PrinterInfo7_get_guid,
		.set = py_spoolss_PrinterInfo7_set_guid,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "action"),
		.get = py_spoolss_PrinterInfo7_get_action,
		.set = py_spoolss_PrinterInfo7_set_action,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DsPrintAction")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterInfo7, type);
}

static PyObject *py_spoolss_PrinterInfo7_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo7);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterInfo7_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo7);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterInfo7);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterInfo7_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo7, "spoolss_PrinterInfo7", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterInfo7, "spoolss_PrinterInfo7", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterInfo7_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterInfo7_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo7_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo7_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterInfo7_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo7",
	.tp_getset = py_spoolss_PrinterInfo7_getsetters,
	.tp_methods = py_spoolss_PrinterInfo7_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo7_new,
};


static PyObject *py_spoolss_DeviceModeInfo_get_devmode(PyObject *obj, void *closure)
{
	struct spoolss_DeviceModeInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode;
	if (object->devmode == NULL) {
		Py_RETURN_NONE;
	}
	if (object->devmode == NULL) {
		py_devmode = Py_None;
		Py_INCREF(py_devmode);
	} else {
		py_devmode = pytalloc_reference_ex(&spoolss_DeviceMode_Type, object->devmode, object->devmode);
	}
	return py_devmode;
}

static int py_spoolss_DeviceModeInfo_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeviceModeInfo *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->devmode));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode");
		return -1;
	}
	if (value == Py_None) {
		object->devmode = NULL;
	} else {
		object->devmode = NULL;
		PY_CHECK_TYPE(&spoolss_DeviceMode_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devmode = (struct spoolss_DeviceMode *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_DeviceModeInfo_getsetters[] = {
	{
		.name = discard_const_p(char, "devmode"),
		.get = py_spoolss_DeviceModeInfo_get_devmode,
		.set = py_spoolss_DeviceModeInfo_set_devmode,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceMode")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeviceModeInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DeviceModeInfo, type);
}


static PyTypeObject spoolss_DeviceModeInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeviceModeInfo",
	.tp_getset = py_spoolss_DeviceModeInfo_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeviceModeInfo_new,
};

static PyObject *py_import_spoolss_PrinterInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_PrinterInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 0:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo0_Type, mem_ctx, &in->info0);
			return ret;

		case 1:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo2_Type, mem_ctx, &in->info2);
			return ret;

		case 3:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo3_Type, mem_ctx, &in->info3);
			return ret;

		case 4:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo4_Type, mem_ctx, &in->info4);
			return ret;

		case 5:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo5_Type, mem_ctx, &in->info5);
			return ret;

		case 6:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo6_Type, mem_ctx, &in->info6);
			return ret;

		case 7:
			ret = pytalloc_reference_ex(&spoolss_PrinterInfo7_Type, mem_ctx, &in->info7);
			return ret;

		case 8:
			ret = pytalloc_reference_ex(&spoolss_DeviceModeInfo_Type, mem_ctx, &in->info8);
			return ret;

		case 9:
			ret = pytalloc_reference_ex(&spoolss_DeviceModeInfo_Type, mem_ctx, &in->info9);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrinterInfo *py_export_spoolss_PrinterInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrinterInfo *ret = talloc_zero(mem_ctx, union spoolss_PrinterInfo);
	switch (level) {
		case 0:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info0");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo0_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info0 = *(struct spoolss_PrinterInfo0 *)pytalloc_get_ptr(in);
			break;

		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PrinterInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_PrinterInfo2 *)pytalloc_get_ptr(in);
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo3_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info3 = *(struct spoolss_PrinterInfo3 *)pytalloc_get_ptr(in);
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo4_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info4 = *(struct spoolss_PrinterInfo4 *)pytalloc_get_ptr(in);
			break;

		case 5:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info5");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo5_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info5 = *(struct spoolss_PrinterInfo5 *)pytalloc_get_ptr(in);
			break;

		case 6:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info6");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo6_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info6 = *(struct spoolss_PrinterInfo6 *)pytalloc_get_ptr(in);
			break;

		case 7:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info7");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrinterInfo7_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info7 = *(struct spoolss_PrinterInfo7 *)pytalloc_get_ptr(in);
			break;

		case 8:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info8");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DeviceModeInfo_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info8 = *(struct spoolss_DeviceModeInfo *)pytalloc_get_ptr(in);
			break;

		case 9:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info9");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DeviceModeInfo_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info9 = *(struct spoolss_DeviceModeInfo *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PrinterInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrinterInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrinterInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrinterInfo!");
		return NULL;
	}

	return py_import_spoolss_PrinterInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrinterInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrinterInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrinterInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrinterInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrinterInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrinterInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrinterInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterInfo_new,
};


static PyObject *py_spoolss_DevmodeContainer_get__ndr_size(PyObject *obj, void *closure)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size;
	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size));
	return py__ndr_size;
}

static int py_spoolss_DevmodeContainer_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DevmodeContainer_get_devmode(PyObject *obj, void *closure)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode;
	if (object->devmode == NULL) {
		Py_RETURN_NONE;
	}
	if (object->devmode == NULL) {
		py_devmode = Py_None;
		Py_INCREF(py_devmode);
	} else {
		py_devmode = pytalloc_reference_ex(&spoolss_DeviceMode_Type, object->devmode, object->devmode);
	}
	return py_devmode;
}

static int py_spoolss_DevmodeContainer_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->devmode));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode");
		return -1;
	}
	if (value == Py_None) {
		object->devmode = NULL;
	} else {
		object->devmode = NULL;
		PY_CHECK_TYPE(&spoolss_DeviceMode_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devmode = (struct spoolss_DeviceMode *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_DevmodeContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "_ndr_size"),
		.get = py_spoolss_DevmodeContainer_get__ndr_size,
		.set = py_spoolss_DevmodeContainer_set__ndr_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "devmode"),
		.get = py_spoolss_DevmodeContainer_get_devmode,
		.set = py_spoolss_DevmodeContainer_set_devmode,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceMode")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DevmodeContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DevmodeContainer, type);
}

static PyObject *py_spoolss_DevmodeContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DevmodeContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DevmodeContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DevmodeContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DevmodeContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DevmodeContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DevmodeContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DevmodeContainer, "spoolss_DevmodeContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DevmodeContainer, "spoolss_DevmodeContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DevmodeContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DevmodeContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DevmodeContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DevmodeContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DevmodeContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DevmodeContainer",
	.tp_getset = py_spoolss_DevmodeContainer_getsetters,
	.tp_methods = py_spoolss_DevmodeContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DevmodeContainer_new,
};


static PyObject *py_spoolss_JobInfo1_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_JobInfo1_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		py_printer_name = PyString_FromStringOrNULL(object->printer_name);
	}
	return py_printer_name;
}

static int py_spoolss_JobInfo1_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		py_server_name = PyString_FromStringOrNULL(object->server_name);
	}
	return py_server_name;
}

static int py_spoolss_JobInfo1_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		py_user_name = PyString_FromStringOrNULL(object->user_name);
	}
	return py_user_name;
}

static int py_spoolss_JobInfo1_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		py_document_name = PyString_FromStringOrNULL(object->document_name);
	}
	return py_document_name;
}

static int py_spoolss_JobInfo1_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		py_data_type = PyString_FromStringOrNULL(object->data_type);
	}
	return py_data_type;
}

static int py_spoolss_JobInfo1_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		py_text_status = PyString_FromStringOrNULL(object->text_status);
	}
	return py_text_status;
}

static int py_spoolss_JobInfo1_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_JobInfo1_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_JobInfo1_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_position(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_JobInfo1_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_JobInfo1_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_JobInfo1_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo1_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_JobInfo1_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_JobInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_JobInfo1_get_job_id,
		.set = py_spoolss_JobInfo1_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_JobInfo1_get_printer_name,
		.set = py_spoolss_JobInfo1_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_JobInfo1_get_server_name,
		.set = py_spoolss_JobInfo1_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_JobInfo1_get_user_name,
		.set = py_spoolss_JobInfo1_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_JobInfo1_get_document_name,
		.set = py_spoolss_JobInfo1_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_JobInfo1_get_data_type,
		.set = py_spoolss_JobInfo1_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_JobInfo1_get_text_status,
		.set = py_spoolss_JobInfo1_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_JobInfo1_get_status,
		.set = py_spoolss_JobInfo1_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_JobInfo1_get_priority,
		.set = py_spoolss_JobInfo1_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_JobInfo1_get_position,
		.set = py_spoolss_JobInfo1_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_JobInfo1_get_total_pages,
		.set = py_spoolss_JobInfo1_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_JobInfo1_get_pages_printed,
		.set = py_spoolss_JobInfo1_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_JobInfo1_get_submitted,
		.set = py_spoolss_JobInfo1_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JobInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JobInfo1, type);
}

static PyObject *py_spoolss_JobInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_JobInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_JobInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo1, "spoolss_JobInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo1, "spoolss_JobInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_JobInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_JobInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_JobInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfo1",
	.tp_getset = py_spoolss_JobInfo1_getsetters,
	.tp_methods = py_spoolss_JobInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfo1_new,
};


static PyObject *py_spoolss_JobInfo2_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_JobInfo2_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		py_printer_name = PyString_FromStringOrNULL(object->printer_name);
	}
	return py_printer_name;
}

static int py_spoolss_JobInfo2_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		py_server_name = PyString_FromStringOrNULL(object->server_name);
	}
	return py_server_name;
}

static int py_spoolss_JobInfo2_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		py_user_name = PyString_FromStringOrNULL(object->user_name);
	}
	return py_user_name;
}

static int py_spoolss_JobInfo2_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		py_document_name = PyString_FromStringOrNULL(object->document_name);
	}
	return py_document_name;
}

static int py_spoolss_JobInfo2_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_notify_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_notify_name;
	if (object->notify_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->notify_name == NULL) {
		py_notify_name = Py_None;
		Py_INCREF(py_notify_name);
	} else {
		py_notify_name = PyString_FromStringOrNULL(object->notify_name);
	}
	return py_notify_name;
}

static int py_spoolss_JobInfo2_set_notify_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->notify_name");
		return -1;
	}
	if (value == Py_None) {
		object->notify_name = NULL;
	} else {
		object->notify_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->notify_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		py_data_type = PyString_FromStringOrNULL(object->data_type);
	}
	return py_data_type;
}

static int py_spoolss_JobInfo2_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		py_print_processor = PyString_FromStringOrNULL(object->print_processor);
	}
	return py_print_processor;
}

static int py_spoolss_JobInfo2_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		py_parameters = PyString_FromStringOrNULL(object->parameters);
	}
	return py_parameters;
}

static int py_spoolss_JobInfo2_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_JobInfo2_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_devmode(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode;
	if (object->devmode == NULL) {
		Py_RETURN_NONE;
	}
	if (object->devmode == NULL) {
		py_devmode = Py_None;
		Py_INCREF(py_devmode);
	} else {
		py_devmode = pytalloc_reference_ex(&spoolss_DeviceMode_Type, object->devmode, object->devmode);
	}
	return py_devmode;
}

static int py_spoolss_JobInfo2_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->devmode));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode");
		return -1;
	}
	if (value == Py_None) {
		object->devmode = NULL;
	} else {
		object->devmode = NULL;
		PY_CHECK_TYPE(&spoolss_DeviceMode_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devmode = (struct spoolss_DeviceMode *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		py_text_status = PyString_FromStringOrNULL(object->text_status);
	}
	return py_text_status;
}

static int py_spoolss_JobInfo2_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_secdesc(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc;
	if (object->secdesc == NULL) {
		Py_RETURN_NONE;
	}
	if (object->secdesc == NULL) {
		py_secdesc = Py_None;
		Py_INCREF(py_secdesc);
	} else {
		py_secdesc = pytalloc_reference_ex(security_descriptor_Type, object->secdesc, object->secdesc);
	}
	return py_secdesc;
}

static int py_spoolss_JobInfo2_set_secdesc(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->secdesc));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secdesc");
		return -1;
	}
	if (value == Py_None) {
		object->secdesc = NULL;
	} else {
		object->secdesc = NULL;
		PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->secdesc = (struct security_descriptor *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_JobInfo2_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_JobInfo2_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_position(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_JobInfo2_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_start_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_start_time;
	py_start_time = PyLong_FromUnsignedLongLong((uint32_t)(object->start_time));
	return py_start_time;
}

static int py_spoolss_JobInfo2_set_start_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->start_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->start_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_until_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_until_time;
	py_until_time = PyLong_FromUnsignedLongLong((uint32_t)(object->until_time));
	return py_until_time;
}

static int py_spoolss_JobInfo2_set_until_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->until_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->until_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->until_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_JobInfo2_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_size(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_JobInfo2_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_JobInfo2_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyLong_FromUnsignedLongLong((uint32_t)(object->time));
	return py_time;
}

static int py_spoolss_JobInfo2_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo2_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_JobInfo2_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_JobInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_JobInfo2_get_job_id,
		.set = py_spoolss_JobInfo2_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_JobInfo2_get_printer_name,
		.set = py_spoolss_JobInfo2_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_JobInfo2_get_server_name,
		.set = py_spoolss_JobInfo2_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_JobInfo2_get_user_name,
		.set = py_spoolss_JobInfo2_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_JobInfo2_get_document_name,
		.set = py_spoolss_JobInfo2_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "notify_name"),
		.get = py_spoolss_JobInfo2_get_notify_name,
		.set = py_spoolss_JobInfo2_set_notify_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_JobInfo2_get_data_type,
		.set = py_spoolss_JobInfo2_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_JobInfo2_get_print_processor,
		.set = py_spoolss_JobInfo2_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_JobInfo2_get_parameters,
		.set = py_spoolss_JobInfo2_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_JobInfo2_get_driver_name,
		.set = py_spoolss_JobInfo2_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "devmode"),
		.get = py_spoolss_JobInfo2_get_devmode,
		.set = py_spoolss_JobInfo2_set_devmode,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceMode")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_JobInfo2_get_text_status,
		.set = py_spoolss_JobInfo2_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "secdesc"),
		.get = py_spoolss_JobInfo2_get_secdesc,
		.set = py_spoolss_JobInfo2_set_secdesc,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_security_descriptor")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_JobInfo2_get_status,
		.set = py_spoolss_JobInfo2_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_JobInfo2_get_priority,
		.set = py_spoolss_JobInfo2_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_JobInfo2_get_position,
		.set = py_spoolss_JobInfo2_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "start_time"),
		.get = py_spoolss_JobInfo2_get_start_time,
		.set = py_spoolss_JobInfo2_set_start_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "until_time"),
		.get = py_spoolss_JobInfo2_get_until_time,
		.set = py_spoolss_JobInfo2_set_until_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_JobInfo2_get_total_pages,
		.set = py_spoolss_JobInfo2_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_JobInfo2_get_size,
		.set = py_spoolss_JobInfo2_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_JobInfo2_get_submitted,
		.set = py_spoolss_JobInfo2_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_JobInfo2_get_time,
		.set = py_spoolss_JobInfo2_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_JobInfo2_get_pages_printed,
		.set = py_spoolss_JobInfo2_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JobInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JobInfo2, type);
}

static PyObject *py_spoolss_JobInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_JobInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_JobInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo2, "spoolss_JobInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo2, "spoolss_JobInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_JobInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_JobInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_JobInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfo2",
	.tp_getset = py_spoolss_JobInfo2_getsetters,
	.tp_methods = py_spoolss_JobInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfo2_new,
};


static PyObject *py_spoolss_JobInfo3_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_JobInfo3_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo3_get_next_job_id(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_next_job_id;
	py_next_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->next_job_id));
	return py_next_job_id;
}

static int py_spoolss_JobInfo3_set_next_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->next_job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->next_job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->next_job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo3_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_JobInfo3_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_JobInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_JobInfo3_get_job_id,
		.set = py_spoolss_JobInfo3_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "next_job_id"),
		.get = py_spoolss_JobInfo3_get_next_job_id,
		.set = py_spoolss_JobInfo3_set_next_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_JobInfo3_get_reserved,
		.set = py_spoolss_JobInfo3_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JobInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JobInfo3, type);
}

static PyObject *py_spoolss_JobInfo3_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo3);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_JobInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo3);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo3);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_JobInfo3_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo3 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo3, "spoolss_JobInfo3", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo3, "spoolss_JobInfo3", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_JobInfo3_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_JobInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo3_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_JobInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfo3",
	.tp_getset = py_spoolss_JobInfo3_getsetters,
	.tp_methods = py_spoolss_JobInfo3_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfo3_new,
};


static PyObject *py_spoolss_JobInfo4_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_JobInfo4_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		py_printer_name = PyString_FromStringOrNULL(object->printer_name);
	}
	return py_printer_name;
}

static int py_spoolss_JobInfo4_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		py_server_name = PyString_FromStringOrNULL(object->server_name);
	}
	return py_server_name;
}

static int py_spoolss_JobInfo4_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		py_user_name = PyString_FromStringOrNULL(object->user_name);
	}
	return py_user_name;
}

static int py_spoolss_JobInfo4_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		py_document_name = PyString_FromStringOrNULL(object->document_name);
	}
	return py_document_name;
}

static int py_spoolss_JobInfo4_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_notify_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_notify_name;
	if (object->notify_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->notify_name == NULL) {
		py_notify_name = Py_None;
		Py_INCREF(py_notify_name);
	} else {
		py_notify_name = PyString_FromStringOrNULL(object->notify_name);
	}
	return py_notify_name;
}

static int py_spoolss_JobInfo4_set_notify_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->notify_name");
		return -1;
	}
	if (value == Py_None) {
		object->notify_name = NULL;
	} else {
		object->notify_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->notify_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		py_data_type = PyString_FromStringOrNULL(object->data_type);
	}
	return py_data_type;
}

static int py_spoolss_JobInfo4_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		py_print_processor = PyString_FromStringOrNULL(object->print_processor);
	}
	return py_print_processor;
}

static int py_spoolss_JobInfo4_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		py_parameters = PyString_FromStringOrNULL(object->parameters);
	}
	return py_parameters;
}

static int py_spoolss_JobInfo4_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_JobInfo4_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_devmode(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode;
	if (object->devmode == NULL) {
		Py_RETURN_NONE;
	}
	if (object->devmode == NULL) {
		py_devmode = Py_None;
		Py_INCREF(py_devmode);
	} else {
		py_devmode = pytalloc_reference_ex(&spoolss_DeviceMode_Type, object->devmode, object->devmode);
	}
	return py_devmode;
}

static int py_spoolss_JobInfo4_set_devmode(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->devmode));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode");
		return -1;
	}
	if (value == Py_None) {
		object->devmode = NULL;
	} else {
		object->devmode = NULL;
		PY_CHECK_TYPE(&spoolss_DeviceMode_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->devmode = (struct spoolss_DeviceMode *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		py_text_status = PyString_FromStringOrNULL(object->text_status);
	}
	return py_text_status;
}

static int py_spoolss_JobInfo4_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_secdesc(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc;
	if (object->secdesc == NULL) {
		Py_RETURN_NONE;
	}
	if (object->secdesc == NULL) {
		py_secdesc = Py_None;
		Py_INCREF(py_secdesc);
	} else {
		py_secdesc = pytalloc_reference_ex(security_descriptor_Type, object->secdesc, object->secdesc);
	}
	return py_secdesc;
}

static int py_spoolss_JobInfo4_set_secdesc(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->secdesc));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secdesc");
		return -1;
	}
	if (value == Py_None) {
		object->secdesc = NULL;
	} else {
		object->secdesc = NULL;
		PY_CHECK_TYPE(security_descriptor_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->secdesc = (struct security_descriptor *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_status(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_JobInfo4_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_JobInfo4_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_position(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_JobInfo4_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_start_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_start_time;
	py_start_time = PyLong_FromUnsignedLongLong((uint32_t)(object->start_time));
	return py_start_time;
}

static int py_spoolss_JobInfo4_set_start_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->start_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->start_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_until_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_until_time;
	py_until_time = PyLong_FromUnsignedLongLong((uint32_t)(object->until_time));
	return py_until_time;
}

static int py_spoolss_JobInfo4_set_until_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->until_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->until_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->until_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_JobInfo4_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_size(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_JobInfo4_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_JobInfo4_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_time(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyLong_FromUnsignedLongLong((uint32_t)(object->time));
	return py_time;
}

static int py_spoolss_JobInfo4_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_JobInfo4_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfo4_get_size_high(PyObject *obj, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_size_high;
	py_size_high = PyLong_FromUnsignedLongLong((uint32_t)(object->size_high));
	return py_size_high;
}

static int py_spoolss_JobInfo4_set_size_high(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size_high");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size_high));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size_high = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_JobInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_JobInfo4_get_job_id,
		.set = py_spoolss_JobInfo4_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_JobInfo4_get_printer_name,
		.set = py_spoolss_JobInfo4_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_JobInfo4_get_server_name,
		.set = py_spoolss_JobInfo4_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_JobInfo4_get_user_name,
		.set = py_spoolss_JobInfo4_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_JobInfo4_get_document_name,
		.set = py_spoolss_JobInfo4_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "notify_name"),
		.get = py_spoolss_JobInfo4_get_notify_name,
		.set = py_spoolss_JobInfo4_set_notify_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_JobInfo4_get_data_type,
		.set = py_spoolss_JobInfo4_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_JobInfo4_get_print_processor,
		.set = py_spoolss_JobInfo4_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_JobInfo4_get_parameters,
		.set = py_spoolss_JobInfo4_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_JobInfo4_get_driver_name,
		.set = py_spoolss_JobInfo4_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "devmode"),
		.get = py_spoolss_JobInfo4_get_devmode,
		.set = py_spoolss_JobInfo4_set_devmode,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeviceMode")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_JobInfo4_get_text_status,
		.set = py_spoolss_JobInfo4_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "secdesc"),
		.get = py_spoolss_JobInfo4_get_secdesc,
		.set = py_spoolss_JobInfo4_set_secdesc,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_security_descriptor")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_JobInfo4_get_status,
		.set = py_spoolss_JobInfo4_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_JobInfo4_get_priority,
		.set = py_spoolss_JobInfo4_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_JobInfo4_get_position,
		.set = py_spoolss_JobInfo4_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "start_time"),
		.get = py_spoolss_JobInfo4_get_start_time,
		.set = py_spoolss_JobInfo4_set_start_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "until_time"),
		.get = py_spoolss_JobInfo4_get_until_time,
		.set = py_spoolss_JobInfo4_set_until_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_JobInfo4_get_total_pages,
		.set = py_spoolss_JobInfo4_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_JobInfo4_get_size,
		.set = py_spoolss_JobInfo4_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_JobInfo4_get_submitted,
		.set = py_spoolss_JobInfo4_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_JobInfo4_get_time,
		.set = py_spoolss_JobInfo4_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_JobInfo4_get_pages_printed,
		.set = py_spoolss_JobInfo4_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size_high"),
		.get = py_spoolss_JobInfo4_get_size_high,
		.set = py_spoolss_JobInfo4_set_size_high,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JobInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JobInfo4, type);
}

static PyObject *py_spoolss_JobInfo4_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo4);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_JobInfo4_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo4);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfo4);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_JobInfo4_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfo4 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo4, "spoolss_JobInfo4", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfo4, "spoolss_JobInfo4", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_JobInfo4_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_JobInfo4_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo4_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo4_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_JobInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfo4",
	.tp_getset = py_spoolss_JobInfo4_getsetters,
	.tp_methods = py_spoolss_JobInfo4_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfo4_new,
};

static PyObject *py_import_spoolss_JobInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_JobInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_JobInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_JobInfo2_Type, mem_ctx, &in->info2);
			return ret;

		case 3:
			ret = pytalloc_reference_ex(&spoolss_JobInfo3_Type, mem_ctx, &in->info3);
			return ret;

		case 4:
			ret = pytalloc_reference_ex(&spoolss_JobInfo4_Type, mem_ctx, &in->info4);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_JobInfo *py_export_spoolss_JobInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_JobInfo *ret = talloc_zero(mem_ctx, union spoolss_JobInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_JobInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_JobInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_JobInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_JobInfo2 *)pytalloc_get_ptr(in);
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_JobInfo3_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info3 = *(struct spoolss_JobInfo3 *)pytalloc_get_ptr(in);
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_JobInfo4_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info4 = *(struct spoolss_JobInfo4 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_JobInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_JobInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_JobInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_JobInfo!");
		return NULL;
	}

	return py_import_spoolss_JobInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_JobInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_JobInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_JobInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_JobInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_JobInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_JobInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_JobInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfo_new,
};


static PyObject *py_spoolss_SetJobInfo1_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_SetJobInfo1_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		if (object->printer_name == NULL) {
			py_printer_name = Py_None;
			Py_INCREF(py_printer_name);
		} else {
			py_printer_name = PyUnicode_Decode(object->printer_name, strlen(object->printer_name), "utf-8", "ignore");
		}
	}
	return py_printer_name;
}

static int py_spoolss_SetJobInfo1_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		if (object->server_name == NULL) {
			py_server_name = Py_None;
			Py_INCREF(py_server_name);
		} else {
			py_server_name = PyUnicode_Decode(object->server_name, strlen(object->server_name), "utf-8", "ignore");
		}
	}
	return py_server_name;
}

static int py_spoolss_SetJobInfo1_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		if (object->user_name == NULL) {
			py_user_name = Py_None;
			Py_INCREF(py_user_name);
		} else {
			py_user_name = PyUnicode_Decode(object->user_name, strlen(object->user_name), "utf-8", "ignore");
		}
	}
	return py_user_name;
}

static int py_spoolss_SetJobInfo1_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		if (object->document_name == NULL) {
			py_document_name = Py_None;
			Py_INCREF(py_document_name);
		} else {
			py_document_name = PyUnicode_Decode(object->document_name, strlen(object->document_name), "utf-8", "ignore");
		}
	}
	return py_document_name;
}

static int py_spoolss_SetJobInfo1_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		if (object->data_type == NULL) {
			py_data_type = Py_None;
			Py_INCREF(py_data_type);
		} else {
			py_data_type = PyUnicode_Decode(object->data_type, strlen(object->data_type), "utf-8", "ignore");
		}
	}
	return py_data_type;
}

static int py_spoolss_SetJobInfo1_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		if (object->text_status == NULL) {
			py_text_status = Py_None;
			Py_INCREF(py_text_status);
		} else {
			py_text_status = PyUnicode_Decode(object->text_status, strlen(object->text_status), "utf-8", "ignore");
		}
	}
	return py_text_status;
}

static int py_spoolss_SetJobInfo1_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetJobInfo1_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_SetJobInfo1_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_position(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_SetJobInfo1_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_SetJobInfo1_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_SetJobInfo1_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo1_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_SetJobInfo1_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_SetJobInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_SetJobInfo1_get_job_id,
		.set = py_spoolss_SetJobInfo1_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_SetJobInfo1_get_printer_name,
		.set = py_spoolss_SetJobInfo1_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_SetJobInfo1_get_server_name,
		.set = py_spoolss_SetJobInfo1_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_SetJobInfo1_get_user_name,
		.set = py_spoolss_SetJobInfo1_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_SetJobInfo1_get_document_name,
		.set = py_spoolss_SetJobInfo1_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_SetJobInfo1_get_data_type,
		.set = py_spoolss_SetJobInfo1_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_SetJobInfo1_get_text_status,
		.set = py_spoolss_SetJobInfo1_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetJobInfo1_get_status,
		.set = py_spoolss_SetJobInfo1_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_SetJobInfo1_get_priority,
		.set = py_spoolss_SetJobInfo1_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_SetJobInfo1_get_position,
		.set = py_spoolss_SetJobInfo1_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_SetJobInfo1_get_total_pages,
		.set = py_spoolss_SetJobInfo1_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_SetJobInfo1_get_pages_printed,
		.set = py_spoolss_SetJobInfo1_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_SetJobInfo1_get_submitted,
		.set = py_spoolss_SetJobInfo1_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetJobInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetJobInfo1, type);
}


static PyTypeObject spoolss_SetJobInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJobInfo1",
	.tp_getset = py_spoolss_SetJobInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJobInfo1_new,
};


static PyObject *py_spoolss_SetJobInfo2_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_SetJobInfo2_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		if (object->printer_name == NULL) {
			py_printer_name = Py_None;
			Py_INCREF(py_printer_name);
		} else {
			py_printer_name = PyUnicode_Decode(object->printer_name, strlen(object->printer_name), "utf-8", "ignore");
		}
	}
	return py_printer_name;
}

static int py_spoolss_SetJobInfo2_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		if (object->server_name == NULL) {
			py_server_name = Py_None;
			Py_INCREF(py_server_name);
		} else {
			py_server_name = PyUnicode_Decode(object->server_name, strlen(object->server_name), "utf-8", "ignore");
		}
	}
	return py_server_name;
}

static int py_spoolss_SetJobInfo2_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		if (object->user_name == NULL) {
			py_user_name = Py_None;
			Py_INCREF(py_user_name);
		} else {
			py_user_name = PyUnicode_Decode(object->user_name, strlen(object->user_name), "utf-8", "ignore");
		}
	}
	return py_user_name;
}

static int py_spoolss_SetJobInfo2_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		if (object->document_name == NULL) {
			py_document_name = Py_None;
			Py_INCREF(py_document_name);
		} else {
			py_document_name = PyUnicode_Decode(object->document_name, strlen(object->document_name), "utf-8", "ignore");
		}
	}
	return py_document_name;
}

static int py_spoolss_SetJobInfo2_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_notify_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_notify_name;
	if (object->notify_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->notify_name == NULL) {
		py_notify_name = Py_None;
		Py_INCREF(py_notify_name);
	} else {
		if (object->notify_name == NULL) {
			py_notify_name = Py_None;
			Py_INCREF(py_notify_name);
		} else {
			py_notify_name = PyUnicode_Decode(object->notify_name, strlen(object->notify_name), "utf-8", "ignore");
		}
	}
	return py_notify_name;
}

static int py_spoolss_SetJobInfo2_set_notify_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->notify_name");
		return -1;
	}
	if (value == Py_None) {
		object->notify_name = NULL;
	} else {
		object->notify_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->notify_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		if (object->data_type == NULL) {
			py_data_type = Py_None;
			Py_INCREF(py_data_type);
		} else {
			py_data_type = PyUnicode_Decode(object->data_type, strlen(object->data_type), "utf-8", "ignore");
		}
	}
	return py_data_type;
}

static int py_spoolss_SetJobInfo2_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		if (object->print_processor == NULL) {
			py_print_processor = Py_None;
			Py_INCREF(py_print_processor);
		} else {
			py_print_processor = PyUnicode_Decode(object->print_processor, strlen(object->print_processor), "utf-8", "ignore");
		}
	}
	return py_print_processor;
}

static int py_spoolss_SetJobInfo2_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		if (object->parameters == NULL) {
			py_parameters = Py_None;
			Py_INCREF(py_parameters);
		} else {
			py_parameters = PyUnicode_Decode(object->parameters, strlen(object->parameters), "utf-8", "ignore");
		}
	}
	return py_parameters;
}

static int py_spoolss_SetJobInfo2_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_SetJobInfo2_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get__devmode_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py__devmode_ptr;
	py__devmode_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->_devmode_ptr));
	return py__devmode_ptr;
}

static int py_spoolss_SetJobInfo2_set__devmode_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_devmode_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_devmode_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_devmode_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		if (object->text_status == NULL) {
			py_text_status = Py_None;
			Py_INCREF(py_text_status);
		} else {
			py_text_status = PyUnicode_Decode(object->text_status, strlen(object->text_status), "utf-8", "ignore");
		}
	}
	return py_text_status;
}

static int py_spoolss_SetJobInfo2_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get__secdesc_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py__secdesc_ptr;
	py__secdesc_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->_secdesc_ptr));
	return py__secdesc_ptr;
}

static int py_spoolss_SetJobInfo2_set__secdesc_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_secdesc_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_secdesc_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_secdesc_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetJobInfo2_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_SetJobInfo2_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_position(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_SetJobInfo2_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_start_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_start_time;
	py_start_time = PyLong_FromUnsignedLongLong((uint32_t)(object->start_time));
	return py_start_time;
}

static int py_spoolss_SetJobInfo2_set_start_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->start_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->start_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_until_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_until_time;
	py_until_time = PyLong_FromUnsignedLongLong((uint32_t)(object->until_time));
	return py_until_time;
}

static int py_spoolss_SetJobInfo2_set_until_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->until_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->until_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->until_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_SetJobInfo2_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_size(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_SetJobInfo2_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_SetJobInfo2_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyLong_FromUnsignedLongLong((uint32_t)(object->time));
	return py_time;
}

static int py_spoolss_SetJobInfo2_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo2_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_SetJobInfo2_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetJobInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_SetJobInfo2_get_job_id,
		.set = py_spoolss_SetJobInfo2_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_SetJobInfo2_get_printer_name,
		.set = py_spoolss_SetJobInfo2_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_SetJobInfo2_get_server_name,
		.set = py_spoolss_SetJobInfo2_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_SetJobInfo2_get_user_name,
		.set = py_spoolss_SetJobInfo2_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_SetJobInfo2_get_document_name,
		.set = py_spoolss_SetJobInfo2_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "notify_name"),
		.get = py_spoolss_SetJobInfo2_get_notify_name,
		.set = py_spoolss_SetJobInfo2_set_notify_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_SetJobInfo2_get_data_type,
		.set = py_spoolss_SetJobInfo2_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_SetJobInfo2_get_print_processor,
		.set = py_spoolss_SetJobInfo2_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_SetJobInfo2_get_parameters,
		.set = py_spoolss_SetJobInfo2_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_SetJobInfo2_get_driver_name,
		.set = py_spoolss_SetJobInfo2_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_devmode_ptr"),
		.get = py_spoolss_SetJobInfo2_get__devmode_ptr,
		.set = py_spoolss_SetJobInfo2_set__devmode_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_SetJobInfo2_get_text_status,
		.set = py_spoolss_SetJobInfo2_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_secdesc_ptr"),
		.get = py_spoolss_SetJobInfo2_get__secdesc_ptr,
		.set = py_spoolss_SetJobInfo2_set__secdesc_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetJobInfo2_get_status,
		.set = py_spoolss_SetJobInfo2_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_SetJobInfo2_get_priority,
		.set = py_spoolss_SetJobInfo2_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_SetJobInfo2_get_position,
		.set = py_spoolss_SetJobInfo2_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "start_time"),
		.get = py_spoolss_SetJobInfo2_get_start_time,
		.set = py_spoolss_SetJobInfo2_set_start_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "until_time"),
		.get = py_spoolss_SetJobInfo2_get_until_time,
		.set = py_spoolss_SetJobInfo2_set_until_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_SetJobInfo2_get_total_pages,
		.set = py_spoolss_SetJobInfo2_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_SetJobInfo2_get_size,
		.set = py_spoolss_SetJobInfo2_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_SetJobInfo2_get_submitted,
		.set = py_spoolss_SetJobInfo2_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_SetJobInfo2_get_time,
		.set = py_spoolss_SetJobInfo2_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_SetJobInfo2_get_pages_printed,
		.set = py_spoolss_SetJobInfo2_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetJobInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetJobInfo2, type);
}


static PyTypeObject spoolss_SetJobInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJobInfo2",
	.tp_getset = py_spoolss_SetJobInfo2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJobInfo2_new,
};


static PyObject *py_spoolss_SetJobInfo4_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_SetJobInfo4_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_printer_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_name;
	if (object->printer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printer_name == NULL) {
		py_printer_name = Py_None;
		Py_INCREF(py_printer_name);
	} else {
		if (object->printer_name == NULL) {
			py_printer_name = Py_None;
			Py_INCREF(py_printer_name);
		} else {
			py_printer_name = PyUnicode_Decode(object->printer_name, strlen(object->printer_name), "utf-8", "ignore");
		}
	}
	return py_printer_name;
}

static int py_spoolss_SetJobInfo4_set_printer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_name");
		return -1;
	}
	if (value == Py_None) {
		object->printer_name = NULL;
	} else {
		object->printer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		if (object->server_name == NULL) {
			py_server_name = Py_None;
			Py_INCREF(py_server_name);
		} else {
			py_server_name = PyUnicode_Decode(object->server_name, strlen(object->server_name), "utf-8", "ignore");
		}
	}
	return py_server_name;
}

static int py_spoolss_SetJobInfo4_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->server_name");
		return -1;
	}
	if (value == Py_None) {
		object->server_name = NULL;
	} else {
		object->server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_user_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_user_name;
	if (object->user_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user_name == NULL) {
		py_user_name = Py_None;
		Py_INCREF(py_user_name);
	} else {
		if (object->user_name == NULL) {
			py_user_name = Py_None;
			Py_INCREF(py_user_name);
		} else {
			py_user_name = PyUnicode_Decode(object->user_name, strlen(object->user_name), "utf-8", "ignore");
		}
	}
	return py_user_name;
}

static int py_spoolss_SetJobInfo4_set_user_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_name");
		return -1;
	}
	if (value == Py_None) {
		object->user_name = NULL;
	} else {
		object->user_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		if (object->document_name == NULL) {
			py_document_name = Py_None;
			Py_INCREF(py_document_name);
		} else {
			py_document_name = PyUnicode_Decode(object->document_name, strlen(object->document_name), "utf-8", "ignore");
		}
	}
	return py_document_name;
}

static int py_spoolss_SetJobInfo4_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_notify_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_notify_name;
	if (object->notify_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->notify_name == NULL) {
		py_notify_name = Py_None;
		Py_INCREF(py_notify_name);
	} else {
		if (object->notify_name == NULL) {
			py_notify_name = Py_None;
			Py_INCREF(py_notify_name);
		} else {
			py_notify_name = PyUnicode_Decode(object->notify_name, strlen(object->notify_name), "utf-8", "ignore");
		}
	}
	return py_notify_name;
}

static int py_spoolss_SetJobInfo4_set_notify_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->notify_name");
		return -1;
	}
	if (value == Py_None) {
		object->notify_name = NULL;
	} else {
		object->notify_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->notify_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		if (object->data_type == NULL) {
			py_data_type = Py_None;
			Py_INCREF(py_data_type);
		} else {
			py_data_type = PyUnicode_Decode(object->data_type, strlen(object->data_type), "utf-8", "ignore");
		}
	}
	return py_data_type;
}

static int py_spoolss_SetJobInfo4_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_type");
		return -1;
	}
	if (value == Py_None) {
		object->data_type = NULL;
	} else {
		object->data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		if (object->print_processor == NULL) {
			py_print_processor = Py_None;
			Py_INCREF(py_print_processor);
		} else {
			py_print_processor = PyUnicode_Decode(object->print_processor, strlen(object->print_processor), "utf-8", "ignore");
		}
	}
	return py_print_processor;
}

static int py_spoolss_SetJobInfo4_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		if (object->parameters == NULL) {
			py_parameters = Py_None;
			Py_INCREF(py_parameters);
		} else {
			py_parameters = PyUnicode_Decode(object->parameters, strlen(object->parameters), "utf-8", "ignore");
		}
	}
	return py_parameters;
}

static int py_spoolss_SetJobInfo4_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_SetJobInfo4_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get__devmode_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py__devmode_ptr;
	py__devmode_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->_devmode_ptr));
	return py__devmode_ptr;
}

static int py_spoolss_SetJobInfo4_set__devmode_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_devmode_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_devmode_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_devmode_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_text_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_text_status;
	if (object->text_status == NULL) {
		Py_RETURN_NONE;
	}
	if (object->text_status == NULL) {
		py_text_status = Py_None;
		Py_INCREF(py_text_status);
	} else {
		if (object->text_status == NULL) {
			py_text_status = Py_None;
			Py_INCREF(py_text_status);
		} else {
			py_text_status = PyUnicode_Decode(object->text_status, strlen(object->text_status), "utf-8", "ignore");
		}
	}
	return py_text_status;
}

static int py_spoolss_SetJobInfo4_set_text_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->text_status");
		return -1;
	}
	if (value == Py_None) {
		object->text_status = NULL;
	} else {
		object->text_status = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->text_status = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get__secdesc_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py__secdesc_ptr;
	py__secdesc_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->_secdesc_ptr));
	return py__secdesc_ptr;
}

static int py_spoolss_SetJobInfo4_set__secdesc_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_secdesc_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_secdesc_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_secdesc_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetJobInfo4_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_SetJobInfo4_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_position(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_position;
	py_position = PyLong_FromUnsignedLongLong((uint32_t)(object->position));
	return py_position;
}

static int py_spoolss_SetJobInfo4_set_position(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->position");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->position));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->position = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_start_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_start_time;
	py_start_time = PyLong_FromUnsignedLongLong((uint32_t)(object->start_time));
	return py_start_time;
}

static int py_spoolss_SetJobInfo4_set_start_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->start_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->start_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->start_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_until_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_until_time;
	py_until_time = PyLong_FromUnsignedLongLong((uint32_t)(object->until_time));
	return py_until_time;
}

static int py_spoolss_SetJobInfo4_set_until_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->until_time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->until_time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->until_time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_SetJobInfo4_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_size(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_SetJobInfo4_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_submitted(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_submitted;
	py_submitted = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->submitted);
	return py_submitted;
}

static int py_spoolss_SetJobInfo4_set_submitted(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->submitted");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->submitted = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_time(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = PyLong_FromUnsignedLongLong((uint32_t)(object->time));
	return py_time;
}

static int py_spoolss_SetJobInfo4_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->time = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_pages_printed(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_pages_printed;
	py_pages_printed = PyLong_FromUnsignedLongLong((uint32_t)(object->pages_printed));
	return py_pages_printed;
}

static int py_spoolss_SetJobInfo4_set_pages_printed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pages_printed");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->pages_printed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->pages_printed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobInfo4_get_size_high(PyObject *obj, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_size_high;
	py_size_high = PyLong_FromUnsignedLongLong((uint32_t)(object->size_high));
	return py_size_high;
}

static int py_spoolss_SetJobInfo4_set_size_high(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size_high");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size_high));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size_high = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetJobInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_SetJobInfo4_get_job_id,
		.set = py_spoolss_SetJobInfo4_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "printer_name"),
		.get = py_spoolss_SetJobInfo4_get_printer_name,
		.set = py_spoolss_SetJobInfo4_set_printer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "server_name"),
		.get = py_spoolss_SetJobInfo4_get_server_name,
		.set = py_spoolss_SetJobInfo4_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "user_name"),
		.get = py_spoolss_SetJobInfo4_get_user_name,
		.set = py_spoolss_SetJobInfo4_set_user_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_SetJobInfo4_get_document_name,
		.set = py_spoolss_SetJobInfo4_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "notify_name"),
		.get = py_spoolss_SetJobInfo4_get_notify_name,
		.set = py_spoolss_SetJobInfo4_set_notify_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_type"),
		.get = py_spoolss_SetJobInfo4_get_data_type,
		.set = py_spoolss_SetJobInfo4_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_SetJobInfo4_get_print_processor,
		.set = py_spoolss_SetJobInfo4_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_SetJobInfo4_get_parameters,
		.set = py_spoolss_SetJobInfo4_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_SetJobInfo4_get_driver_name,
		.set = py_spoolss_SetJobInfo4_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_devmode_ptr"),
		.get = py_spoolss_SetJobInfo4_get__devmode_ptr,
		.set = py_spoolss_SetJobInfo4_set__devmode_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "text_status"),
		.get = py_spoolss_SetJobInfo4_get_text_status,
		.set = py_spoolss_SetJobInfo4_set_text_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_secdesc_ptr"),
		.get = py_spoolss_SetJobInfo4_get__secdesc_ptr,
		.set = py_spoolss_SetJobInfo4_set__secdesc_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetJobInfo4_get_status,
		.set = py_spoolss_SetJobInfo4_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_SetJobInfo4_get_priority,
		.set = py_spoolss_SetJobInfo4_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "position"),
		.get = py_spoolss_SetJobInfo4_get_position,
		.set = py_spoolss_SetJobInfo4_set_position,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "start_time"),
		.get = py_spoolss_SetJobInfo4_get_start_time,
		.set = py_spoolss_SetJobInfo4_set_start_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "until_time"),
		.get = py_spoolss_SetJobInfo4_get_until_time,
		.set = py_spoolss_SetJobInfo4_set_until_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_SetJobInfo4_get_total_pages,
		.set = py_spoolss_SetJobInfo4_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_SetJobInfo4_get_size,
		.set = py_spoolss_SetJobInfo4_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "submitted"),
		.get = py_spoolss_SetJobInfo4_get_submitted,
		.set = py_spoolss_SetJobInfo4_set_submitted,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_SetJobInfo4_get_time,
		.set = py_spoolss_SetJobInfo4_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pages_printed"),
		.get = py_spoolss_SetJobInfo4_get_pages_printed,
		.set = py_spoolss_SetJobInfo4_set_pages_printed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size_high"),
		.get = py_spoolss_SetJobInfo4_get_size_high,
		.set = py_spoolss_SetJobInfo4_set_size_high,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetJobInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetJobInfo4, type);
}


static PyTypeObject spoolss_SetJobInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJobInfo4",
	.tp_getset = py_spoolss_SetJobInfo4_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJobInfo4_new,
};

static PyObject *py_import_spoolss_SetJobInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_SetJobInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetJobInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetJobInfo2_Type, in->info2, in->info2);
			}
			return ret;

		case 3:
			if (in->info3 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_JobInfo3_Type, in->info3, in->info3);
			}
			return ret;

		case 4:
			if (in->info4 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetJobInfo4_Type, in->info4, in->info4);
			}
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_SetJobInfo *py_export_spoolss_SetJobInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_SetJobInfo *ret = talloc_zero(mem_ctx, union spoolss_SetJobInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_SetJobInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_SetJobInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_SetJobInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_SetJobInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info3 = NULL;
			} else {
				ret->info3 = NULL;
				PY_CHECK_TYPE(&spoolss_JobInfo3_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info3 = (struct spoolss_JobInfo3 *)pytalloc_get_ptr(in);
			}
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info4 = NULL;
			} else {
				ret->info4 = NULL;
				PY_CHECK_TYPE(&spoolss_SetJobInfo4_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info4 = (struct spoolss_SetJobInfo4 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_SetJobInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_SetJobInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_SetJobInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_SetJobInfo!");
		return NULL;
	}

	return py_import_spoolss_SetJobInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_SetJobInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_SetJobInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_SetJobInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_SetJobInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_SetJobInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_SetJobInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJobInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_SetJobInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJobInfo_new,
};


static PyObject *py_spoolss_JobInfoContainer_get_level(PyObject *obj, void *closure)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_JobInfoContainer_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_JobInfoContainer_get_info(PyObject *obj, void *closure)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_SetJobInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_SetJobInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_JobInfoContainer_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_SetJobInfo *info_switch_0;
		info_switch_0 = (union spoolss_SetJobInfo *)pyrpc_export_union(&spoolss_SetJobInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_SetJobInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_JobInfoContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_JobInfoContainer_get_level,
		.set = py_spoolss_JobInfoContainer_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_JobInfoContainer_get_info,
		.set = py_spoolss_JobInfoContainer_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetJobInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_JobInfoContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_JobInfoContainer, type);
}

static PyObject *py_spoolss_JobInfoContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfoContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_JobInfoContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfoContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_JobInfoContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_JobInfoContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_JobInfoContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfoContainer, "spoolss_JobInfoContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_JobInfoContainer, "spoolss_JobInfoContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_JobInfoContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_JobInfoContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfoContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_JobInfoContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_JobInfoContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.JobInfoContainer",
	.tp_getset = py_spoolss_JobInfoContainer_getsetters,
	.tp_methods = py_spoolss_JobInfoContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_JobInfoContainer_new,
};


static PyObject *py_spoolss_SetPrinterInfo0_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->servername, strlen(object->servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_SetPrinterInfo0_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->printername, strlen(object->printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_SetPrinterInfo0_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_cjobs(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_cjobs;
	py_cjobs = PyLong_FromUnsignedLongLong((uint32_t)(object->cjobs));
	return py_cjobs;
}

static int py_spoolss_SetPrinterInfo0_set_cjobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cjobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cjobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_total_jobs(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_jobs;
	py_total_jobs = PyLong_FromUnsignedLongLong((uint32_t)(object->total_jobs));
	return py_total_jobs;
}

static int py_spoolss_SetPrinterInfo0_set_total_jobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_jobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_jobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_jobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_total_bytes(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_bytes;
	py_total_bytes = PyLong_FromUnsignedLongLong((uint32_t)(object->total_bytes));
	return py_total_bytes;
}

static int py_spoolss_SetPrinterInfo0_set_total_bytes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_bytes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_bytes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_bytes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_time(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_time;
	py_time = pytalloc_reference_ex(&spoolss_Time_Type, pytalloc_get_mem_ctx(obj), &object->time);
	return py_time;
}

static int py_spoolss_SetPrinterInfo0_set_time(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->time");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_Time_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->time = *(struct spoolss_Time *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_global_counter(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_global_counter;
	py_global_counter = PyLong_FromUnsignedLongLong((uint32_t)(object->global_counter));
	return py_global_counter;
}

static int py_spoolss_SetPrinterInfo0_set_global_counter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->global_counter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->global_counter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->global_counter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_total_pages(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_total_pages;
	py_total_pages = PyLong_FromUnsignedLongLong((uint32_t)(object->total_pages));
	return py_total_pages;
}

static int py_spoolss_SetPrinterInfo0_set_total_pages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->total_pages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->total_pages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->total_pages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_version(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_SetPrinterInfo0_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_free_build(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_free_build;
	py_free_build = PyLong_FromUnsignedLongLong((uint32_t)(object->free_build));
	return py_free_build;
}

static int py_spoolss_SetPrinterInfo0_set_free_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->free_build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->free_build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->free_build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_spooling(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_spooling;
	py_spooling = PyLong_FromUnsignedLongLong((uint32_t)(object->spooling));
	return py_spooling;
}

static int py_spoolss_SetPrinterInfo0_set_spooling(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->spooling");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->spooling));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->spooling = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_max_spooling(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_max_spooling;
	py_max_spooling = PyLong_FromUnsignedLongLong((uint32_t)(object->max_spooling));
	return py_max_spooling;
}

static int py_spoolss_SetPrinterInfo0_set_max_spooling(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->max_spooling");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_spooling));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->max_spooling = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_session_counter(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_session_counter;
	py_session_counter = PyLong_FromUnsignedLongLong((uint32_t)(object->session_counter));
	return py_session_counter;
}

static int py_spoolss_SetPrinterInfo0_set_session_counter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->session_counter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->session_counter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->session_counter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_num_error_out_of_paper(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_num_error_out_of_paper;
	py_num_error_out_of_paper = PyLong_FromUnsignedLongLong((uint32_t)(object->num_error_out_of_paper));
	return py_num_error_out_of_paper;
}

static int py_spoolss_SetPrinterInfo0_set_num_error_out_of_paper(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_error_out_of_paper");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_error_out_of_paper));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->num_error_out_of_paper = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_num_error_not_ready(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_num_error_not_ready;
	py_num_error_not_ready = PyLong_FromUnsignedLongLong((uint32_t)(object->num_error_not_ready));
	return py_num_error_not_ready;
}

static int py_spoolss_SetPrinterInfo0_set_num_error_not_ready(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->num_error_not_ready");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_error_not_ready));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->num_error_not_ready = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_job_error(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_job_error;
	py_job_error = PyLong_FromUnsignedLongLong((uint32_t)(object->job_error));
	return py_job_error;
}

static int py_spoolss_SetPrinterInfo0_set_job_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_error");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_error));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_error = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_number_of_processors(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_number_of_processors;
	py_number_of_processors = PyLong_FromUnsignedLongLong((uint32_t)(object->number_of_processors));
	return py_number_of_processors;
}

static int py_spoolss_SetPrinterInfo0_set_number_of_processors(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->number_of_processors");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->number_of_processors));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->number_of_processors = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_processor_type(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_type;
	py_processor_type = PyLong_FromUnsignedLongLong((uint32_t)(object->processor_type));
	return py_processor_type;
}

static int py_spoolss_SetPrinterInfo0_set_processor_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_high_part_total_bytes(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_high_part_total_bytes;
	py_high_part_total_bytes = PyLong_FromUnsignedLongLong((uint32_t)(object->high_part_total_bytes));
	return py_high_part_total_bytes;
}

static int py_spoolss_SetPrinterInfo0_set_high_part_total_bytes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->high_part_total_bytes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->high_part_total_bytes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->high_part_total_bytes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_change_id(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_change_id;
	py_change_id = PyLong_FromUnsignedLongLong((uint32_t)(object->change_id));
	return py_change_id;
}

static int py_spoolss_SetPrinterInfo0_set_change_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->change_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->change_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->change_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_last_error(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_last_error;
	py_last_error = PyErr_FromWERROR(object->last_error);
	return py_last_error;
}

static int py_spoolss_SetPrinterInfo0_set_last_error(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->last_error");
		return -1;
	}
	object->last_error = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetPrinterInfo0_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_enumerate_network_printers(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_enumerate_network_printers;
	py_enumerate_network_printers = PyLong_FromUnsignedLongLong((uint32_t)(object->enumerate_network_printers));
	return py_enumerate_network_printers;
}

static int py_spoolss_SetPrinterInfo0_set_enumerate_network_printers(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->enumerate_network_printers");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->enumerate_network_printers));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->enumerate_network_printers = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_c_setprinter(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_c_setprinter;
	py_c_setprinter = PyLong_FromUnsignedLongLong((uint32_t)(object->c_setprinter));
	return py_c_setprinter;
}

static int py_spoolss_SetPrinterInfo0_set_c_setprinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->c_setprinter");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->c_setprinter));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->c_setprinter = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_processor_architecture(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_architecture;
	py_processor_architecture = PyLong_FromLong((uint16_t)(object->processor_architecture));
	return py_processor_architecture;
}

static int py_spoolss_SetPrinterInfo0_set_processor_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_architecture");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_architecture));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_architecture = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_processor_level(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor_level;
	py_processor_level = PyLong_FromLong((uint16_t)(object->processor_level));
	return py_processor_level;
}

static int py_spoolss_SetPrinterInfo0_set_processor_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor_level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor_level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor_level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_ref_ic(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_ref_ic;
	py_ref_ic = PyLong_FromUnsignedLongLong((uint32_t)(object->ref_ic));
	return py_ref_ic;
}

static int py_spoolss_SetPrinterInfo0_set_ref_ic(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ref_ic");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ref_ic));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ref_ic = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_reserved2(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved2;
	py_reserved2 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved2));
	return py_reserved2;
}

static int py_spoolss_SetPrinterInfo0_set_reserved2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo0_get_reserved3(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved3;
	py_reserved3 = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved3));
	return py_reserved3;
}

static int py_spoolss_SetPrinterInfo0_set_reserved3(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo0 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved3");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved3));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved3 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo0_getsetters[] = {
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_SetPrinterInfo0_get_servername,
		.set = py_spoolss_SetPrinterInfo0_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_SetPrinterInfo0_get_printername,
		.set = py_spoolss_SetPrinterInfo0_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "cjobs"),
		.get = py_spoolss_SetPrinterInfo0_get_cjobs,
		.set = py_spoolss_SetPrinterInfo0_set_cjobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_jobs"),
		.get = py_spoolss_SetPrinterInfo0_get_total_jobs,
		.set = py_spoolss_SetPrinterInfo0_set_total_jobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_bytes"),
		.get = py_spoolss_SetPrinterInfo0_get_total_bytes,
		.set = py_spoolss_SetPrinterInfo0_set_total_bytes,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "time"),
		.get = py_spoolss_SetPrinterInfo0_get_time,
		.set = py_spoolss_SetPrinterInfo0_set_time,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Time")
	},
	{
		.name = discard_const_p(char, "global_counter"),
		.get = py_spoolss_SetPrinterInfo0_get_global_counter,
		.set = py_spoolss_SetPrinterInfo0_set_global_counter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "total_pages"),
		.get = py_spoolss_SetPrinterInfo0_get_total_pages,
		.set = py_spoolss_SetPrinterInfo0_set_total_pages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_SetPrinterInfo0_get_version,
		.set = py_spoolss_SetPrinterInfo0_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "free_build"),
		.get = py_spoolss_SetPrinterInfo0_get_free_build,
		.set = py_spoolss_SetPrinterInfo0_set_free_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Build")
	},
	{
		.name = discard_const_p(char, "spooling"),
		.get = py_spoolss_SetPrinterInfo0_get_spooling,
		.set = py_spoolss_SetPrinterInfo0_set_spooling,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "max_spooling"),
		.get = py_spoolss_SetPrinterInfo0_get_max_spooling,
		.set = py_spoolss_SetPrinterInfo0_set_max_spooling,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "session_counter"),
		.get = py_spoolss_SetPrinterInfo0_get_session_counter,
		.set = py_spoolss_SetPrinterInfo0_set_session_counter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "num_error_out_of_paper"),
		.get = py_spoolss_SetPrinterInfo0_get_num_error_out_of_paper,
		.set = py_spoolss_SetPrinterInfo0_set_num_error_out_of_paper,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "num_error_not_ready"),
		.get = py_spoolss_SetPrinterInfo0_get_num_error_not_ready,
		.set = py_spoolss_SetPrinterInfo0_set_num_error_not_ready,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "job_error"),
		.get = py_spoolss_SetPrinterInfo0_get_job_error,
		.set = py_spoolss_SetPrinterInfo0_set_job_error,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobStatus")
	},
	{
		.name = discard_const_p(char, "number_of_processors"),
		.get = py_spoolss_SetPrinterInfo0_get_number_of_processors,
		.set = py_spoolss_SetPrinterInfo0_set_number_of_processors,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "processor_type"),
		.get = py_spoolss_SetPrinterInfo0_get_processor_type,
		.set = py_spoolss_SetPrinterInfo0_set_processor_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorType")
	},
	{
		.name = discard_const_p(char, "high_part_total_bytes"),
		.get = py_spoolss_SetPrinterInfo0_get_high_part_total_bytes,
		.set = py_spoolss_SetPrinterInfo0_set_high_part_total_bytes,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "change_id"),
		.get = py_spoolss_SetPrinterInfo0_get_change_id,
		.set = py_spoolss_SetPrinterInfo0_set_change_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "last_error"),
		.get = py_spoolss_SetPrinterInfo0_get_last_error,
		.set = py_spoolss_SetPrinterInfo0_set_last_error,
		.doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetPrinterInfo0_get_status,
		.set = py_spoolss_SetPrinterInfo0_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{
		.name = discard_const_p(char, "enumerate_network_printers"),
		.get = py_spoolss_SetPrinterInfo0_get_enumerate_network_printers,
		.set = py_spoolss_SetPrinterInfo0_set_enumerate_network_printers,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "c_setprinter"),
		.get = py_spoolss_SetPrinterInfo0_get_c_setprinter,
		.set = py_spoolss_SetPrinterInfo0_set_c_setprinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "processor_architecture"),
		.get = py_spoolss_SetPrinterInfo0_get_processor_architecture,
		.set = py_spoolss_SetPrinterInfo0_set_processor_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorArchitecture")
	},
	{
		.name = discard_const_p(char, "processor_level"),
		.get = py_spoolss_SetPrinterInfo0_get_processor_level,
		.set = py_spoolss_SetPrinterInfo0_set_processor_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ref_ic"),
		.get = py_spoolss_SetPrinterInfo0_get_ref_ic,
		.set = py_spoolss_SetPrinterInfo0_set_ref_ic,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved2"),
		.get = py_spoolss_SetPrinterInfo0_get_reserved2,
		.set = py_spoolss_SetPrinterInfo0_set_reserved2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved3"),
		.get = py_spoolss_SetPrinterInfo0_get_reserved3,
		.set = py_spoolss_SetPrinterInfo0_set_reserved3,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo0, type);
}


static PyTypeObject spoolss_SetPrinterInfo0_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo0",
	.tp_getset = py_spoolss_SetPrinterInfo0_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo0_new,
};


static PyObject *py_spoolss_SetPrinterInfo1_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_SetPrinterInfo1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo1_get_description(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_description;
	if (object->description == NULL) {
		Py_RETURN_NONE;
	}
	if (object->description == NULL) {
		py_description = Py_None;
		Py_INCREF(py_description);
	} else {
		if (object->description == NULL) {
			py_description = Py_None;
			Py_INCREF(py_description);
		} else {
			py_description = PyUnicode_Decode(object->description, strlen(object->description), "utf-8", "ignore");
		}
	}
	return py_description;
}

static int py_spoolss_SetPrinterInfo1_set_description(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->description");
		return -1;
	}
	if (value == Py_None) {
		object->description = NULL;
	} else {
		object->description = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->description = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo1_get_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_name;
	if (object->name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->name == NULL) {
		py_name = Py_None;
		Py_INCREF(py_name);
	} else {
		if (object->name == NULL) {
			py_name = Py_None;
			Py_INCREF(py_name);
		} else {
			py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
		}
	}
	return py_name;
}

static int py_spoolss_SetPrinterInfo1_set_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name");
		return -1;
	}
	if (value == Py_None) {
		object->name = NULL;
	} else {
		object->name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo1_get_comment(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_comment;
	if (object->comment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->comment == NULL) {
		py_comment = Py_None;
		Py_INCREF(py_comment);
	} else {
		if (object->comment == NULL) {
			py_comment = Py_None;
			Py_INCREF(py_comment);
		} else {
			py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
		}
	}
	return py_comment;
}

static int py_spoolss_SetPrinterInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->comment");
		return -1;
	}
	if (value == Py_None) {
		object->comment = NULL;
	} else {
		object->comment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->comment = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_SetPrinterInfo1_get_flags,
		.set = py_spoolss_SetPrinterInfo1_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{
		.name = discard_const_p(char, "description"),
		.get = py_spoolss_SetPrinterInfo1_get_description,
		.set = py_spoolss_SetPrinterInfo1_set_description,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "name"),
		.get = py_spoolss_SetPrinterInfo1_get_name,
		.set = py_spoolss_SetPrinterInfo1_set_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "comment"),
		.get = py_spoolss_SetPrinterInfo1_get_comment,
		.set = py_spoolss_SetPrinterInfo1_set_comment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo1, type);
}


static PyTypeObject spoolss_SetPrinterInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo1",
	.tp_getset = py_spoolss_SetPrinterInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo1_new,
};


static PyObject *py_spoolss_SetPrinterInfo2_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->servername, strlen(object->servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_SetPrinterInfo2_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->printername, strlen(object->printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_SetPrinterInfo2_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_sharename(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_sharename;
	if (object->sharename == NULL) {
		Py_RETURN_NONE;
	}
	if (object->sharename == NULL) {
		py_sharename = Py_None;
		Py_INCREF(py_sharename);
	} else {
		if (object->sharename == NULL) {
			py_sharename = Py_None;
			Py_INCREF(py_sharename);
		} else {
			py_sharename = PyUnicode_Decode(object->sharename, strlen(object->sharename), "utf-8", "ignore");
		}
	}
	return py_sharename;
}

static int py_spoolss_SetPrinterInfo2_set_sharename(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sharename");
		return -1;
	}
	if (value == Py_None) {
		object->sharename = NULL;
	} else {
		object->sharename = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->sharename = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		Py_RETURN_NONE;
	}
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		if (object->portname == NULL) {
			py_portname = Py_None;
			Py_INCREF(py_portname);
		} else {
			py_portname = PyUnicode_Decode(object->portname, strlen(object->portname), "utf-8", "ignore");
		}
	}
	return py_portname;
}

static int py_spoolss_SetPrinterInfo2_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	if (value == Py_None) {
		object->portname = NULL;
	} else {
		object->portname = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->portname = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_drivername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_drivername;
	if (object->drivername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->drivername == NULL) {
		py_drivername = Py_None;
		Py_INCREF(py_drivername);
	} else {
		if (object->drivername == NULL) {
			py_drivername = Py_None;
			Py_INCREF(py_drivername);
		} else {
			py_drivername = PyUnicode_Decode(object->drivername, strlen(object->drivername), "utf-8", "ignore");
		}
	}
	return py_drivername;
}

static int py_spoolss_SetPrinterInfo2_set_drivername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->drivername");
		return -1;
	}
	if (value == Py_None) {
		object->drivername = NULL;
	} else {
		object->drivername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->drivername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_comment(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_comment;
	if (object->comment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->comment == NULL) {
		py_comment = Py_None;
		Py_INCREF(py_comment);
	} else {
		if (object->comment == NULL) {
			py_comment = Py_None;
			Py_INCREF(py_comment);
		} else {
			py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
		}
	}
	return py_comment;
}

static int py_spoolss_SetPrinterInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->comment");
		return -1;
	}
	if (value == Py_None) {
		object->comment = NULL;
	} else {
		object->comment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->comment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_location(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_location;
	if (object->location == NULL) {
		Py_RETURN_NONE;
	}
	if (object->location == NULL) {
		py_location = Py_None;
		Py_INCREF(py_location);
	} else {
		if (object->location == NULL) {
			py_location = Py_None;
			Py_INCREF(py_location);
		} else {
			py_location = PyUnicode_Decode(object->location, strlen(object->location), "utf-8", "ignore");
		}
	}
	return py_location;
}

static int py_spoolss_SetPrinterInfo2_set_location(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->location");
		return -1;
	}
	if (value == Py_None) {
		object->location = NULL;
	} else {
		object->location = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->location = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_devmode_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ptr;
	py_devmode_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->devmode_ptr));
	return py_devmode_ptr;
}

static int py_spoolss_SetPrinterInfo2_set_devmode_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->devmode_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->devmode_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_sepfile(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_sepfile;
	if (object->sepfile == NULL) {
		Py_RETURN_NONE;
	}
	if (object->sepfile == NULL) {
		py_sepfile = Py_None;
		Py_INCREF(py_sepfile);
	} else {
		if (object->sepfile == NULL) {
			py_sepfile = Py_None;
			Py_INCREF(py_sepfile);
		} else {
			py_sepfile = PyUnicode_Decode(object->sepfile, strlen(object->sepfile), "utf-8", "ignore");
		}
	}
	return py_sepfile;
}

static int py_spoolss_SetPrinterInfo2_set_sepfile(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sepfile");
		return -1;
	}
	if (value == Py_None) {
		object->sepfile = NULL;
	} else {
		object->sepfile = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->sepfile = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_printprocessor(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_printprocessor;
	if (object->printprocessor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printprocessor == NULL) {
		py_printprocessor = Py_None;
		Py_INCREF(py_printprocessor);
	} else {
		if (object->printprocessor == NULL) {
			py_printprocessor = Py_None;
			Py_INCREF(py_printprocessor);
		} else {
			py_printprocessor = PyUnicode_Decode(object->printprocessor, strlen(object->printprocessor), "utf-8", "ignore");
		}
	}
	return py_printprocessor;
}

static int py_spoolss_SetPrinterInfo2_set_printprocessor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printprocessor");
		return -1;
	}
	if (value == Py_None) {
		object->printprocessor = NULL;
	} else {
		object->printprocessor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printprocessor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_datatype(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_datatype;
	if (object->datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->datatype == NULL) {
		py_datatype = Py_None;
		Py_INCREF(py_datatype);
	} else {
		if (object->datatype == NULL) {
			py_datatype = Py_None;
			Py_INCREF(py_datatype);
		} else {
			py_datatype = PyUnicode_Decode(object->datatype, strlen(object->datatype), "utf-8", "ignore");
		}
	}
	return py_datatype;
}

static int py_spoolss_SetPrinterInfo2_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->datatype");
		return -1;
	}
	if (value == Py_None) {
		object->datatype = NULL;
	} else {
		object->datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_parameters(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_parameters;
	if (object->parameters == NULL) {
		Py_RETURN_NONE;
	}
	if (object->parameters == NULL) {
		py_parameters = Py_None;
		Py_INCREF(py_parameters);
	} else {
		if (object->parameters == NULL) {
			py_parameters = Py_None;
			Py_INCREF(py_parameters);
		} else {
			py_parameters = PyUnicode_Decode(object->parameters, strlen(object->parameters), "utf-8", "ignore");
		}
	}
	return py_parameters;
}

static int py_spoolss_SetPrinterInfo2_set_parameters(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->parameters");
		return -1;
	}
	if (value == Py_None) {
		object->parameters = NULL;
	} else {
		object->parameters = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->parameters = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_secdesc_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc_ptr;
	py_secdesc_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->secdesc_ptr));
	return py_secdesc_ptr;
}

static int py_spoolss_SetPrinterInfo2_set_secdesc_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->secdesc_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->secdesc_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->secdesc_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_SetPrinterInfo2_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_priority(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_priority;
	py_priority = PyLong_FromUnsignedLongLong((uint32_t)(object->priority));
	return py_priority;
}

static int py_spoolss_SetPrinterInfo2_set_priority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->priority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->priority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_defaultpriority(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_defaultpriority;
	py_defaultpriority = PyLong_FromUnsignedLongLong((uint32_t)(object->defaultpriority));
	return py_defaultpriority;
}

static int py_spoolss_SetPrinterInfo2_set_defaultpriority(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->defaultpriority");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->defaultpriority));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->defaultpriority = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_starttime(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_starttime;
	py_starttime = PyLong_FromUnsignedLongLong((uint32_t)(object->starttime));
	return py_starttime;
}

static int py_spoolss_SetPrinterInfo2_set_starttime(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->starttime");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->starttime));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->starttime = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_untiltime(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_untiltime;
	py_untiltime = PyLong_FromUnsignedLongLong((uint32_t)(object->untiltime));
	return py_untiltime;
}

static int py_spoolss_SetPrinterInfo2_set_untiltime(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->untiltime");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->untiltime));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->untiltime = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetPrinterInfo2_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_cjobs(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_cjobs;
	py_cjobs = PyLong_FromUnsignedLongLong((uint32_t)(object->cjobs));
	return py_cjobs;
}

static int py_spoolss_SetPrinterInfo2_set_cjobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cjobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cjobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo2_get_averageppm(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_averageppm;
	py_averageppm = PyLong_FromUnsignedLongLong((uint32_t)(object->averageppm));
	return py_averageppm;
}

static int py_spoolss_SetPrinterInfo2_set_averageppm(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->averageppm");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->averageppm));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->averageppm = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_SetPrinterInfo2_get_servername,
		.set = py_spoolss_SetPrinterInfo2_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_SetPrinterInfo2_get_printername,
		.set = py_spoolss_SetPrinterInfo2_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "sharename"),
		.get = py_spoolss_SetPrinterInfo2_get_sharename,
		.set = py_spoolss_SetPrinterInfo2_set_sharename,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_SetPrinterInfo2_get_portname,
		.set = py_spoolss_SetPrinterInfo2_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "drivername"),
		.get = py_spoolss_SetPrinterInfo2_get_drivername,
		.set = py_spoolss_SetPrinterInfo2_set_drivername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "comment"),
		.get = py_spoolss_SetPrinterInfo2_get_comment,
		.set = py_spoolss_SetPrinterInfo2_set_comment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "location"),
		.get = py_spoolss_SetPrinterInfo2_get_location,
		.set = py_spoolss_SetPrinterInfo2_set_location,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "devmode_ptr"),
		.get = py_spoolss_SetPrinterInfo2_get_devmode_ptr,
		.set = py_spoolss_SetPrinterInfo2_set_devmode_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "sepfile"),
		.get = py_spoolss_SetPrinterInfo2_get_sepfile,
		.set = py_spoolss_SetPrinterInfo2_set_sepfile,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "printprocessor"),
		.get = py_spoolss_SetPrinterInfo2_get_printprocessor,
		.set = py_spoolss_SetPrinterInfo2_set_printprocessor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "datatype"),
		.get = py_spoolss_SetPrinterInfo2_get_datatype,
		.set = py_spoolss_SetPrinterInfo2_set_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "parameters"),
		.get = py_spoolss_SetPrinterInfo2_get_parameters,
		.set = py_spoolss_SetPrinterInfo2_set_parameters,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "secdesc_ptr"),
		.get = py_spoolss_SetPrinterInfo2_get_secdesc_ptr,
		.set = py_spoolss_SetPrinterInfo2_set_secdesc_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_SetPrinterInfo2_get_attributes,
		.set = py_spoolss_SetPrinterInfo2_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{
		.name = discard_const_p(char, "priority"),
		.get = py_spoolss_SetPrinterInfo2_get_priority,
		.set = py_spoolss_SetPrinterInfo2_set_priority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "defaultpriority"),
		.get = py_spoolss_SetPrinterInfo2_get_defaultpriority,
		.set = py_spoolss_SetPrinterInfo2_set_defaultpriority,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "starttime"),
		.get = py_spoolss_SetPrinterInfo2_get_starttime,
		.set = py_spoolss_SetPrinterInfo2_set_starttime,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "untiltime"),
		.get = py_spoolss_SetPrinterInfo2_get_untiltime,
		.set = py_spoolss_SetPrinterInfo2_set_untiltime,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetPrinterInfo2_get_status,
		.set = py_spoolss_SetPrinterInfo2_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{
		.name = discard_const_p(char, "cjobs"),
		.get = py_spoolss_SetPrinterInfo2_get_cjobs,
		.set = py_spoolss_SetPrinterInfo2_set_cjobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "averageppm"),
		.get = py_spoolss_SetPrinterInfo2_get_averageppm,
		.set = py_spoolss_SetPrinterInfo2_set_averageppm,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo2, type);
}


static PyTypeObject spoolss_SetPrinterInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo2",
	.tp_getset = py_spoolss_SetPrinterInfo2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo2_new,
};


static PyObject *py_spoolss_SetPrinterInfo3_get_sec_desc_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_sec_desc_ptr;
	py_sec_desc_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->sec_desc_ptr));
	return py_sec_desc_ptr;
}

static int py_spoolss_SetPrinterInfo3_set_sec_desc_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->sec_desc_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->sec_desc_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->sec_desc_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "sec_desc_ptr"),
		.get = py_spoolss_SetPrinterInfo3_get_sec_desc_ptr,
		.set = py_spoolss_SetPrinterInfo3_set_sec_desc_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo3, type);
}


static PyTypeObject spoolss_SetPrinterInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo3",
	.tp_getset = py_spoolss_SetPrinterInfo3_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo3_new,
};


static PyObject *py_spoolss_SetPrinterInfo4_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->printername, strlen(object->printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_SetPrinterInfo4_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo4_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->servername, strlen(object->servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_SetPrinterInfo4_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->servername");
		return -1;
	}
	if (value == Py_None) {
		object->servername = NULL;
	} else {
		object->servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo4_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_SetPrinterInfo4_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_SetPrinterInfo4_get_printername,
		.set = py_spoolss_SetPrinterInfo4_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "servername"),
		.get = py_spoolss_SetPrinterInfo4_get_servername,
		.set = py_spoolss_SetPrinterInfo4_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_SetPrinterInfo4_get_attributes,
		.set = py_spoolss_SetPrinterInfo4_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo4, type);
}


static PyTypeObject spoolss_SetPrinterInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo4",
	.tp_getset = py_spoolss_SetPrinterInfo4_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo4_new,
};


static PyObject *py_spoolss_SetPrinterInfo5_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->printername, strlen(object->printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_SetPrinterInfo5_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printername");
		return -1;
	}
	if (value == Py_None) {
		object->printername = NULL;
	} else {
		object->printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo5_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		Py_RETURN_NONE;
	}
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		if (object->portname == NULL) {
			py_portname = Py_None;
			Py_INCREF(py_portname);
		} else {
			py_portname = PyUnicode_Decode(object->portname, strlen(object->portname), "utf-8", "ignore");
		}
	}
	return py_portname;
}

static int py_spoolss_SetPrinterInfo5_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	if (value == Py_None) {
		object->portname = NULL;
	} else {
		object->portname = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->portname = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo5_get_attributes(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_attributes;
	py_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->attributes));
	return py_attributes;
}

static int py_spoolss_SetPrinterInfo5_set_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo5_get_device_not_selected_timeout(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_device_not_selected_timeout;
	py_device_not_selected_timeout = PyLong_FromUnsignedLongLong((uint32_t)(object->device_not_selected_timeout));
	return py_device_not_selected_timeout;
}

static int py_spoolss_SetPrinterInfo5_set_device_not_selected_timeout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_not_selected_timeout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->device_not_selected_timeout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->device_not_selected_timeout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo5_get_transmission_retry_timeout(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_transmission_retry_timeout;
	py_transmission_retry_timeout = PyLong_FromUnsignedLongLong((uint32_t)(object->transmission_retry_timeout));
	return py_transmission_retry_timeout;
}

static int py_spoolss_SetPrinterInfo5_set_transmission_retry_timeout(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->transmission_retry_timeout");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->transmission_retry_timeout));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->transmission_retry_timeout = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo5_getsetters[] = {
	{
		.name = discard_const_p(char, "printername"),
		.get = py_spoolss_SetPrinterInfo5_get_printername,
		.set = py_spoolss_SetPrinterInfo5_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_SetPrinterInfo5_get_portname,
		.set = py_spoolss_SetPrinterInfo5_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "attributes"),
		.get = py_spoolss_SetPrinterInfo5_get_attributes,
		.set = py_spoolss_SetPrinterInfo5_set_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterAttributes")
	},
	{
		.name = discard_const_p(char, "device_not_selected_timeout"),
		.get = py_spoolss_SetPrinterInfo5_get_device_not_selected_timeout,
		.set = py_spoolss_SetPrinterInfo5_set_device_not_selected_timeout,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "transmission_retry_timeout"),
		.get = py_spoolss_SetPrinterInfo5_get_transmission_retry_timeout,
		.set = py_spoolss_SetPrinterInfo5_set_transmission_retry_timeout,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo5, type);
}


static PyTypeObject spoolss_SetPrinterInfo5_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo5",
	.tp_getset = py_spoolss_SetPrinterInfo5_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo5_new,
};


static PyObject *py_spoolss_SetPrinterInfo6_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetPrinterInfo6_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo6_getsetters[] = {
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetPrinterInfo6_get_status,
		.set = py_spoolss_SetPrinterInfo6_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterStatus")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo6, type);
}


static PyTypeObject spoolss_SetPrinterInfo6_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo6",
	.tp_getset = py_spoolss_SetPrinterInfo6_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo6_new,
};


static PyObject *py_spoolss_SetPrinterInfo7_get_guid(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_guid;
	if (object->guid == NULL) {
		Py_RETURN_NONE;
	}
	if (object->guid == NULL) {
		py_guid = Py_None;
		Py_INCREF(py_guid);
	} else {
		if (object->guid == NULL) {
			py_guid = Py_None;
			Py_INCREF(py_guid);
		} else {
			py_guid = PyUnicode_Decode(object->guid, strlen(object->guid), "utf-8", "ignore");
		}
	}
	return py_guid;
}

static int py_spoolss_SetPrinterInfo7_set_guid(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->guid");
		return -1;
	}
	if (value == Py_None) {
		object->guid = NULL;
	} else {
		object->guid = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->guid = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfo7_get_action(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_action;
	py_action = PyLong_FromUnsignedLongLong((uint32_t)(object->action));
	return py_action;
}

static int py_spoolss_SetPrinterInfo7_set_action(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->action");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->action));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->action = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo7_getsetters[] = {
	{
		.name = discard_const_p(char, "guid"),
		.get = py_spoolss_SetPrinterInfo7_get_guid,
		.set = py_spoolss_SetPrinterInfo7_set_guid,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "action"),
		.get = py_spoolss_SetPrinterInfo7_get_action,
		.set = py_spoolss_SetPrinterInfo7_set_action,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DsPrintAction")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo7, type);
}


static PyTypeObject spoolss_SetPrinterInfo7_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo7",
	.tp_getset = py_spoolss_SetPrinterInfo7_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo7_new,
};


static PyObject *py_spoolss_SetPrinterInfo8_get_devmode_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ptr;
	py_devmode_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->devmode_ptr));
	return py_devmode_ptr;
}

static int py_spoolss_SetPrinterInfo8_set_devmode_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->devmode_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->devmode_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo8_getsetters[] = {
	{
		.name = discard_const_p(char, "devmode_ptr"),
		.get = py_spoolss_SetPrinterInfo8_get_devmode_ptr,
		.set = py_spoolss_SetPrinterInfo8_set_devmode_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo8, type);
}


static PyTypeObject spoolss_SetPrinterInfo8_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo8",
	.tp_getset = py_spoolss_SetPrinterInfo8_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo8_new,
};


static PyObject *py_spoolss_SetPrinterInfo9_get_devmode_ptr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfo9 *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ptr;
	py_devmode_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->devmode_ptr));
	return py_devmode_ptr;
}

static int py_spoolss_SetPrinterInfo9_set_devmode_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfo9 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->devmode_ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->devmode_ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->devmode_ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfo9_getsetters[] = {
	{
		.name = discard_const_p(char, "devmode_ptr"),
		.get = py_spoolss_SetPrinterInfo9_get_devmode_ptr,
		.set = py_spoolss_SetPrinterInfo9_set_devmode_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfo9_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfo9, type);
}


static PyTypeObject spoolss_SetPrinterInfo9_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo9",
	.tp_getset = py_spoolss_SetPrinterInfo9_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo9_new,
};

static PyObject *py_import_spoolss_SetPrinterInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_SetPrinterInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 0:
			if (in->info0 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo0_Type, in->info0, in->info0);
			}
			return ret;

		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo2_Type, in->info2, in->info2);
			}
			return ret;

		case 3:
			if (in->info3 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo3_Type, in->info3, in->info3);
			}
			return ret;

		case 4:
			if (in->info4 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo4_Type, in->info4, in->info4);
			}
			return ret;

		case 5:
			if (in->info5 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo5_Type, in->info5, in->info5);
			}
			return ret;

		case 6:
			if (in->info6 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo6_Type, in->info6, in->info6);
			}
			return ret;

		case 7:
			if (in->info7 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo7_Type, in->info7, in->info7);
			}
			return ret;

		case 8:
			if (in->info8 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo8_Type, in->info8, in->info8);
			}
			return ret;

		case 9:
			if (in->info9 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPrinterInfo9_Type, in->info9, in->info9);
			}
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_SetPrinterInfo *py_export_spoolss_SetPrinterInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_SetPrinterInfo *ret = talloc_zero(mem_ctx, union spoolss_SetPrinterInfo);
	switch (level) {
		case 0:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info0");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info0 = NULL;
			} else {
				ret->info0 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo0_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info0 = (struct spoolss_SetPrinterInfo0 *)pytalloc_get_ptr(in);
			}
			break;

		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_SetPrinterInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_SetPrinterInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info3 = NULL;
			} else {
				ret->info3 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo3_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info3 = (struct spoolss_SetPrinterInfo3 *)pytalloc_get_ptr(in);
			}
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info4 = NULL;
			} else {
				ret->info4 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo4_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info4 = (struct spoolss_SetPrinterInfo4 *)pytalloc_get_ptr(in);
			}
			break;

		case 5:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info5");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info5 = NULL;
			} else {
				ret->info5 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo5_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info5 = (struct spoolss_SetPrinterInfo5 *)pytalloc_get_ptr(in);
			}
			break;

		case 6:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info6");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info6 = NULL;
			} else {
				ret->info6 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo6_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info6 = (struct spoolss_SetPrinterInfo6 *)pytalloc_get_ptr(in);
			}
			break;

		case 7:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info7");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info7 = NULL;
			} else {
				ret->info7 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo7_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info7 = (struct spoolss_SetPrinterInfo7 *)pytalloc_get_ptr(in);
			}
			break;

		case 8:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info8");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info8 = NULL;
			} else {
				ret->info8 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo8_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info8 = (struct spoolss_SetPrinterInfo8 *)pytalloc_get_ptr(in);
			}
			break;

		case 9:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info9");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info9 = NULL;
			} else {
				ret->info9 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPrinterInfo9_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info9 = (struct spoolss_SetPrinterInfo9 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_SetPrinterInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_SetPrinterInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_SetPrinterInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_SetPrinterInfo!");
		return NULL;
	}

	return py_import_spoolss_SetPrinterInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_SetPrinterInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_SetPrinterInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_SetPrinterInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_SetPrinterInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_SetPrinterInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_SetPrinterInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_SetPrinterInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfo_new,
};


static PyObject *py_spoolss_SetPrinterInfoCtr_get_level(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_SetPrinterInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterInfoCtr_get_info(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_SetPrinterInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_SetPrinterInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_SetPrinterInfoCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_SetPrinterInfo *info_switch_0;
		info_switch_0 = (union spoolss_SetPrinterInfo *)pyrpc_export_union(&spoolss_SetPrinterInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_SetPrinterInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterInfoCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_SetPrinterInfoCtr_get_level,
		.set = py_spoolss_SetPrinterInfoCtr_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_SetPrinterInfoCtr_get_info,
		.set = py_spoolss_SetPrinterInfoCtr_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPrinterInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPrinterInfoCtr, type);
}

static PyObject *py_spoolss_SetPrinterInfoCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPrinterInfoCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPrinterInfoCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPrinterInfoCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPrinterInfoCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPrinterInfoCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPrinterInfoCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPrinterInfoCtr, "spoolss_SetPrinterInfoCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPrinterInfoCtr, "spoolss_SetPrinterInfoCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPrinterInfoCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPrinterInfoCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterInfoCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterInfoCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPrinterInfoCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterInfoCtr",
	.tp_getset = py_spoolss_SetPrinterInfoCtr_getsetters,
	.tp_methods = py_spoolss_SetPrinterInfoCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterInfoCtr_new,
};


static PyObject *py_spoolss_StringArray_get__ndr_size(PyObject *obj, void *closure)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size;
	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size));
	return py__ndr_size;
}

static int py_spoolss_StringArray_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_StringArray_get_string(PyObject *obj, void *closure)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(obj);
	PyObject *py_string;
	py_string = pytalloc_GenericObject_reference_ex(pytalloc_get_mem_ctx(obj), object->string);
	return py_string;
}

static int py_spoolss_StringArray_set_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
		return -1;
	}
	object->string = pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_StringArray_getsetters[] = {
	{
		.name = discard_const_p(char, "_ndr_size"),
		.get = py_spoolss_StringArray_get__ndr_size,
		.set = py_spoolss_StringArray_set__ndr_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "string"),
		.get = py_spoolss_StringArray_get_string,
		.set = py_spoolss_StringArray_set_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_StringArray_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_StringArray, type);
}

static PyObject *py_spoolss_StringArray_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_StringArray_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_StringArray);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_StringArray);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_StringArray_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_StringArray *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_StringArray, "spoolss_StringArray", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_StringArray, "spoolss_StringArray", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_StringArray_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_StringArray_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StringArray_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StringArray_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_StringArray_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.StringArray",
	.tp_getset = py_spoolss_StringArray_getsetters,
	.tp_methods = py_spoolss_StringArray_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_StringArray_new,
};


static PyObject *py_spoolss_AddDriverInfo1_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo1_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo1_get_driver_name,
		.set = py_spoolss_AddDriverInfo1_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo1, type);
}


static PyTypeObject spoolss_AddDriverInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo1",
	.tp_getset = py_spoolss_AddDriverInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo1_new,
};


static PyObject *py_spoolss_AddDriverInfo2_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo2_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo2_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo2_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo2_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo2_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo2_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo2_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo2_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo2_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo2_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo2_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo2_get_version,
		.set = py_spoolss_AddDriverInfo2_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo2_get_driver_name,
		.set = py_spoolss_AddDriverInfo2_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo2_get_architecture,
		.set = py_spoolss_AddDriverInfo2_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo2_get_driver_path,
		.set = py_spoolss_AddDriverInfo2_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo2_get_data_file,
		.set = py_spoolss_AddDriverInfo2_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo2_get_config_file,
		.set = py_spoolss_AddDriverInfo2_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo2, type);
}


static PyTypeObject spoolss_AddDriverInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo2",
	.tp_getset = py_spoolss_AddDriverInfo2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo2_new,
};


static PyObject *py_spoolss_AddDriverInfo3_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo3_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo3_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo3_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo3_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo3_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo3_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		if (object->help_file == NULL) {
			py_help_file = Py_None;
			Py_INCREF(py_help_file);
		} else {
			py_help_file = PyUnicode_Decode(object->help_file, strlen(object->help_file), "utf-8", "ignore");
		}
	}
	return py_help_file;
}

static int py_spoolss_AddDriverInfo3_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddDriverInfo3_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		if (object->default_datatype == NULL) {
			py_default_datatype = Py_None;
			Py_INCREF(py_default_datatype);
		} else {
			py_default_datatype = PyUnicode_Decode(object->default_datatype, strlen(object->default_datatype), "utf-8", "ignore");
		}
	}
	return py_default_datatype;
}

static int py_spoolss_AddDriverInfo3_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get__ndr_size_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_dependent_files;
	py__ndr_size_dependent_files = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_dependent_files));
	return py__ndr_size_dependent_files;
}

static int py_spoolss_AddDriverInfo3_set__ndr_size_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_dependent_files");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_dependent_files));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_dependent_files = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo3_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_reference_ex(&spoolss_StringArray_Type, object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_AddDriverInfo3_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo3 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dependent_files));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->dependent_files = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo3_get_version,
		.set = py_spoolss_AddDriverInfo3_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo3_get_driver_name,
		.set = py_spoolss_AddDriverInfo3_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo3_get_architecture,
		.set = py_spoolss_AddDriverInfo3_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo3_get_driver_path,
		.set = py_spoolss_AddDriverInfo3_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo3_get_data_file,
		.set = py_spoolss_AddDriverInfo3_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo3_get_config_file,
		.set = py_spoolss_AddDriverInfo3_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_AddDriverInfo3_get_help_file,
		.set = py_spoolss_AddDriverInfo3_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddDriverInfo3_get_monitor_name,
		.set = py_spoolss_AddDriverInfo3_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_AddDriverInfo3_get_default_datatype,
		.set = py_spoolss_AddDriverInfo3_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_ndr_size_dependent_files"),
		.get = py_spoolss_AddDriverInfo3_get__ndr_size_dependent_files,
		.set = py_spoolss_AddDriverInfo3_set__ndr_size_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_AddDriverInfo3_get_dependent_files,
		.set = py_spoolss_AddDriverInfo3_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo3, type);
}


static PyTypeObject spoolss_AddDriverInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo3",
	.tp_getset = py_spoolss_AddDriverInfo3_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo3_new,
};


static PyObject *py_spoolss_AddDriverInfo4_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo4_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo4_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo4_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo4_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo4_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo4_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		if (object->help_file == NULL) {
			py_help_file = Py_None;
			Py_INCREF(py_help_file);
		} else {
			py_help_file = PyUnicode_Decode(object->help_file, strlen(object->help_file), "utf-8", "ignore");
		}
	}
	return py_help_file;
}

static int py_spoolss_AddDriverInfo4_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddDriverInfo4_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		if (object->default_datatype == NULL) {
			py_default_datatype = Py_None;
			Py_INCREF(py_default_datatype);
		} else {
			py_default_datatype = PyUnicode_Decode(object->default_datatype, strlen(object->default_datatype), "utf-8", "ignore");
		}
	}
	return py_default_datatype;
}

static int py_spoolss_AddDriverInfo4_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get__ndr_size_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_dependent_files;
	py__ndr_size_dependent_files = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_dependent_files));
	return py__ndr_size_dependent_files;
}

static int py_spoolss_AddDriverInfo4_set__ndr_size_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_dependent_files");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_dependent_files));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_dependent_files = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_reference_ex(&spoolss_StringArray_Type, object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_AddDriverInfo4_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dependent_files));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->dependent_files = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get__ndr_size_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_previous_names;
	py__ndr_size_previous_names = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_previous_names));
	return py__ndr_size_previous_names;
}

static int py_spoolss_AddDriverInfo4_set__ndr_size_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_previous_names");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_previous_names));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_previous_names = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo4_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_reference_ex(&spoolss_StringArray_Type, object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_AddDriverInfo4_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo4 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->previous_names));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->previous_names = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo4_get_version,
		.set = py_spoolss_AddDriverInfo4_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo4_get_driver_name,
		.set = py_spoolss_AddDriverInfo4_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo4_get_architecture,
		.set = py_spoolss_AddDriverInfo4_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo4_get_driver_path,
		.set = py_spoolss_AddDriverInfo4_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo4_get_data_file,
		.set = py_spoolss_AddDriverInfo4_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo4_get_config_file,
		.set = py_spoolss_AddDriverInfo4_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_AddDriverInfo4_get_help_file,
		.set = py_spoolss_AddDriverInfo4_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddDriverInfo4_get_monitor_name,
		.set = py_spoolss_AddDriverInfo4_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_AddDriverInfo4_get_default_datatype,
		.set = py_spoolss_AddDriverInfo4_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_ndr_size_dependent_files"),
		.get = py_spoolss_AddDriverInfo4_get__ndr_size_dependent_files,
		.set = py_spoolss_AddDriverInfo4_set__ndr_size_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_AddDriverInfo4_get_dependent_files,
		.set = py_spoolss_AddDriverInfo4_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "_ndr_size_previous_names"),
		.get = py_spoolss_AddDriverInfo4_get__ndr_size_previous_names,
		.set = py_spoolss_AddDriverInfo4_set__ndr_size_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_AddDriverInfo4_get_previous_names,
		.set = py_spoolss_AddDriverInfo4_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo4, type);
}


static PyTypeObject spoolss_AddDriverInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo4",
	.tp_getset = py_spoolss_AddDriverInfo4_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo4_new,
};


static PyObject *py_spoolss_AddDriverInfo5_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo5_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo5_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo5_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo5_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo5_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo5_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_driver_attributes(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_attributes;
	py_driver_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->driver_attributes));
	return py_driver_attributes;
}

static int py_spoolss_AddDriverInfo5_set_driver_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_config_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_version;
	py_config_version = PyLong_FromUnsignedLongLong((uint32_t)(object->config_version));
	return py_config_version;
}

static int py_spoolss_AddDriverInfo5_set_config_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->config_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->config_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo5_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong((uint32_t)(object->driver_version));
	return py_driver_version;
}

static int py_spoolss_AddDriverInfo5_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo5_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo5_get_version,
		.set = py_spoolss_AddDriverInfo5_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo5_get_driver_name,
		.set = py_spoolss_AddDriverInfo5_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo5_get_architecture,
		.set = py_spoolss_AddDriverInfo5_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo5_get_driver_path,
		.set = py_spoolss_AddDriverInfo5_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo5_get_data_file,
		.set = py_spoolss_AddDriverInfo5_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo5_get_config_file,
		.set = py_spoolss_AddDriverInfo5_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_attributes"),
		.get = py_spoolss_AddDriverInfo5_get_driver_attributes,
		.set = py_spoolss_AddDriverInfo5_set_driver_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverAttributes")
	},
	{
		.name = discard_const_p(char, "config_version"),
		.get = py_spoolss_AddDriverInfo5_get_config_version,
		.set = py_spoolss_AddDriverInfo5_set_config_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_AddDriverInfo5_get_driver_version,
		.set = py_spoolss_AddDriverInfo5_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo5, type);
}


static PyTypeObject spoolss_AddDriverInfo5_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo5",
	.tp_getset = py_spoolss_AddDriverInfo5_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo5_new,
};


static PyObject *py_spoolss_AddDriverInfo6_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo6_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo6_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo6_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo6_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo6_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo6_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		if (object->help_file == NULL) {
			py_help_file = Py_None;
			Py_INCREF(py_help_file);
		} else {
			py_help_file = PyUnicode_Decode(object->help_file, strlen(object->help_file), "utf-8", "ignore");
		}
	}
	return py_help_file;
}

static int py_spoolss_AddDriverInfo6_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddDriverInfo6_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		if (object->default_datatype == NULL) {
			py_default_datatype = Py_None;
			Py_INCREF(py_default_datatype);
		} else {
			py_default_datatype = PyUnicode_Decode(object->default_datatype, strlen(object->default_datatype), "utf-8", "ignore");
		}
	}
	return py_default_datatype;
}

static int py_spoolss_AddDriverInfo6_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get__ndr_size_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_dependent_files;
	py__ndr_size_dependent_files = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_dependent_files));
	return py__ndr_size_dependent_files;
}

static int py_spoolss_AddDriverInfo6_set__ndr_size_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_dependent_files");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_dependent_files));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_dependent_files = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_reference_ex(&spoolss_StringArray_Type, object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_AddDriverInfo6_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dependent_files));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->dependent_files = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get__ndr_size_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_previous_names;
	py__ndr_size_previous_names = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_previous_names));
	return py__ndr_size_previous_names;
}

static int py_spoolss_AddDriverInfo6_set__ndr_size_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_previous_names");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_previous_names));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_previous_names = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_reference_ex(&spoolss_StringArray_Type, object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_AddDriverInfo6_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->previous_names));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->previous_names = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_AddDriverInfo6_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_AddDriverInfo6_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_manufacturer_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_name;
	if (object->manufacturer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_name == NULL) {
		py_manufacturer_name = Py_None;
		Py_INCREF(py_manufacturer_name);
	} else {
		if (object->manufacturer_name == NULL) {
			py_manufacturer_name = Py_None;
			Py_INCREF(py_manufacturer_name);
		} else {
			py_manufacturer_name = PyUnicode_Decode(object->manufacturer_name, strlen(object->manufacturer_name), "utf-8", "ignore");
		}
	}
	return py_manufacturer_name;
}

static int py_spoolss_AddDriverInfo6_set_manufacturer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_name");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_name = NULL;
	} else {
		object->manufacturer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_manufacturer_url(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_url;
	if (object->manufacturer_url == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_url == NULL) {
		py_manufacturer_url = Py_None;
		Py_INCREF(py_manufacturer_url);
	} else {
		if (object->manufacturer_url == NULL) {
			py_manufacturer_url = Py_None;
			Py_INCREF(py_manufacturer_url);
		} else {
			py_manufacturer_url = PyUnicode_Decode(object->manufacturer_url, strlen(object->manufacturer_url), "utf-8", "ignore");
		}
	}
	return py_manufacturer_url;
}

static int py_spoolss_AddDriverInfo6_set_manufacturer_url(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_url");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_url = NULL;
	} else {
		object->manufacturer_url = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_url = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_hardware_id(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_id;
	if (object->hardware_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->hardware_id == NULL) {
		py_hardware_id = Py_None;
		Py_INCREF(py_hardware_id);
	} else {
		if (object->hardware_id == NULL) {
			py_hardware_id = Py_None;
			Py_INCREF(py_hardware_id);
		} else {
			py_hardware_id = PyUnicode_Decode(object->hardware_id, strlen(object->hardware_id), "utf-8", "ignore");
		}
	}
	return py_hardware_id;
}

static int py_spoolss_AddDriverInfo6_set_hardware_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_id");
		return -1;
	}
	if (value == Py_None) {
		object->hardware_id = NULL;
	} else {
		object->hardware_id = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->hardware_id = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo6_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		if (object->provider == NULL) {
			py_provider = Py_None;
			Py_INCREF(py_provider);
		} else {
			py_provider = PyUnicode_Decode(object->provider, strlen(object->provider), "utf-8", "ignore");
		}
	}
	return py_provider;
}

static int py_spoolss_AddDriverInfo6_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->provider");
		return -1;
	}
	if (value == Py_None) {
		object->provider = NULL;
	} else {
		object->provider = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->provider = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo6_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo6_get_version,
		.set = py_spoolss_AddDriverInfo6_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo6_get_driver_name,
		.set = py_spoolss_AddDriverInfo6_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo6_get_architecture,
		.set = py_spoolss_AddDriverInfo6_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo6_get_driver_path,
		.set = py_spoolss_AddDriverInfo6_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo6_get_data_file,
		.set = py_spoolss_AddDriverInfo6_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo6_get_config_file,
		.set = py_spoolss_AddDriverInfo6_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_AddDriverInfo6_get_help_file,
		.set = py_spoolss_AddDriverInfo6_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddDriverInfo6_get_monitor_name,
		.set = py_spoolss_AddDriverInfo6_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_AddDriverInfo6_get_default_datatype,
		.set = py_spoolss_AddDriverInfo6_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_ndr_size_dependent_files"),
		.get = py_spoolss_AddDriverInfo6_get__ndr_size_dependent_files,
		.set = py_spoolss_AddDriverInfo6_set__ndr_size_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_AddDriverInfo6_get_dependent_files,
		.set = py_spoolss_AddDriverInfo6_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "_ndr_size_previous_names"),
		.get = py_spoolss_AddDriverInfo6_get__ndr_size_previous_names,
		.set = py_spoolss_AddDriverInfo6_set__ndr_size_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_AddDriverInfo6_get_previous_names,
		.set = py_spoolss_AddDriverInfo6_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_AddDriverInfo6_get_driver_date,
		.set = py_spoolss_AddDriverInfo6_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_AddDriverInfo6_get_driver_version,
		.set = py_spoolss_AddDriverInfo6_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "manufacturer_name"),
		.get = py_spoolss_AddDriverInfo6_get_manufacturer_name,
		.set = py_spoolss_AddDriverInfo6_set_manufacturer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "manufacturer_url"),
		.get = py_spoolss_AddDriverInfo6_get_manufacturer_url,
		.set = py_spoolss_AddDriverInfo6_set_manufacturer_url,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "hardware_id"),
		.get = py_spoolss_AddDriverInfo6_get_hardware_id,
		.set = py_spoolss_AddDriverInfo6_set_hardware_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "provider"),
		.get = py_spoolss_AddDriverInfo6_get_provider,
		.set = py_spoolss_AddDriverInfo6_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo6, type);
}


static PyTypeObject spoolss_AddDriverInfo6_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo6",
	.tp_getset = py_spoolss_AddDriverInfo6_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo6_new,
};


static PyObject *py_spoolss_AddDriverInfo8_get_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_AddDriverInfo8_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		if (object->driver_name == NULL) {
			py_driver_name = Py_None;
			Py_INCREF(py_driver_name);
		} else {
			py_driver_name = PyUnicode_Decode(object->driver_name, strlen(object->driver_name), "utf-8", "ignore");
		}
	}
	return py_driver_name;
}

static int py_spoolss_AddDriverInfo8_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->architecture, strlen(object->architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_AddDriverInfo8_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		if (object->driver_path == NULL) {
			py_driver_path = Py_None;
			Py_INCREF(py_driver_path);
		} else {
			py_driver_path = PyUnicode_Decode(object->driver_path, strlen(object->driver_path), "utf-8", "ignore");
		}
	}
	return py_driver_path;
}

static int py_spoolss_AddDriverInfo8_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		if (object->data_file == NULL) {
			py_data_file = Py_None;
			Py_INCREF(py_data_file);
		} else {
			py_data_file = PyUnicode_Decode(object->data_file, strlen(object->data_file), "utf-8", "ignore");
		}
	}
	return py_data_file;
}

static int py_spoolss_AddDriverInfo8_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		if (object->config_file == NULL) {
			py_config_file = Py_None;
			Py_INCREF(py_config_file);
		} else {
			py_config_file = PyUnicode_Decode(object->config_file, strlen(object->config_file), "utf-8", "ignore");
		}
	}
	return py_config_file;
}

static int py_spoolss_AddDriverInfo8_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		if (object->help_file == NULL) {
			py_help_file = Py_None;
			Py_INCREF(py_help_file);
		} else {
			py_help_file = PyUnicode_Decode(object->help_file, strlen(object->help_file), "utf-8", "ignore");
		}
	}
	return py_help_file;
}

static int py_spoolss_AddDriverInfo8_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddDriverInfo8_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		if (object->default_datatype == NULL) {
			py_default_datatype = Py_None;
			Py_INCREF(py_default_datatype);
		} else {
			py_default_datatype = PyUnicode_Decode(object->default_datatype, strlen(object->default_datatype), "utf-8", "ignore");
		}
	}
	return py_default_datatype;
}

static int py_spoolss_AddDriverInfo8_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get__ndr_size_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_dependent_files;
	py__ndr_size_dependent_files = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_dependent_files));
	return py__ndr_size_dependent_files;
}

static int py_spoolss_AddDriverInfo8_set__ndr_size_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_dependent_files");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_dependent_files));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_dependent_files = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_reference_ex(&spoolss_StringArray_Type, object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_AddDriverInfo8_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->dependent_files));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->dependent_files = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get__ndr_size_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_previous_names;
	py__ndr_size_previous_names = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_previous_names));
	return py__ndr_size_previous_names;
}

static int py_spoolss_AddDriverInfo8_set__ndr_size_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_previous_names");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_previous_names));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_previous_names = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_reference_ex(&spoolss_StringArray_Type, object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_AddDriverInfo8_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->previous_names));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->previous_names = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_AddDriverInfo8_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_AddDriverInfo8_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_manufacturer_name(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_name;
	if (object->manufacturer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_name == NULL) {
		py_manufacturer_name = Py_None;
		Py_INCREF(py_manufacturer_name);
	} else {
		if (object->manufacturer_name == NULL) {
			py_manufacturer_name = Py_None;
			Py_INCREF(py_manufacturer_name);
		} else {
			py_manufacturer_name = PyUnicode_Decode(object->manufacturer_name, strlen(object->manufacturer_name), "utf-8", "ignore");
		}
	}
	return py_manufacturer_name;
}

static int py_spoolss_AddDriverInfo8_set_manufacturer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_name");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_name = NULL;
	} else {
		object->manufacturer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_manufacturer_url(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_url;
	if (object->manufacturer_url == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_url == NULL) {
		py_manufacturer_url = Py_None;
		Py_INCREF(py_manufacturer_url);
	} else {
		if (object->manufacturer_url == NULL) {
			py_manufacturer_url = Py_None;
			Py_INCREF(py_manufacturer_url);
		} else {
			py_manufacturer_url = PyUnicode_Decode(object->manufacturer_url, strlen(object->manufacturer_url), "utf-8", "ignore");
		}
	}
	return py_manufacturer_url;
}

static int py_spoolss_AddDriverInfo8_set_manufacturer_url(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_url");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_url = NULL;
	} else {
		object->manufacturer_url = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_url = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_hardware_id(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_id;
	if (object->hardware_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->hardware_id == NULL) {
		py_hardware_id = Py_None;
		Py_INCREF(py_hardware_id);
	} else {
		if (object->hardware_id == NULL) {
			py_hardware_id = Py_None;
			Py_INCREF(py_hardware_id);
		} else {
			py_hardware_id = PyUnicode_Decode(object->hardware_id, strlen(object->hardware_id), "utf-8", "ignore");
		}
	}
	return py_hardware_id;
}

static int py_spoolss_AddDriverInfo8_set_hardware_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_id");
		return -1;
	}
	if (value == Py_None) {
		object->hardware_id = NULL;
	} else {
		object->hardware_id = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->hardware_id = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		if (object->provider == NULL) {
			py_provider = Py_None;
			Py_INCREF(py_provider);
		} else {
			py_provider = PyUnicode_Decode(object->provider, strlen(object->provider), "utf-8", "ignore");
		}
	}
	return py_provider;
}

static int py_spoolss_AddDriverInfo8_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->provider");
		return -1;
	}
	if (value == Py_None) {
		object->provider = NULL;
	} else {
		object->provider = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->provider = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		if (object->print_processor == NULL) {
			py_print_processor = Py_None;
			Py_INCREF(py_print_processor);
		} else {
			py_print_processor = PyUnicode_Decode(object->print_processor, strlen(object->print_processor), "utf-8", "ignore");
		}
	}
	return py_print_processor;
}

static int py_spoolss_AddDriverInfo8_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_vendor_setup(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_vendor_setup;
	if (object->vendor_setup == NULL) {
		Py_RETURN_NONE;
	}
	if (object->vendor_setup == NULL) {
		py_vendor_setup = Py_None;
		Py_INCREF(py_vendor_setup);
	} else {
		if (object->vendor_setup == NULL) {
			py_vendor_setup = Py_None;
			Py_INCREF(py_vendor_setup);
		} else {
			py_vendor_setup = PyUnicode_Decode(object->vendor_setup, strlen(object->vendor_setup), "utf-8", "ignore");
		}
	}
	return py_vendor_setup;
}

static int py_spoolss_AddDriverInfo8_set_vendor_setup(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vendor_setup");
		return -1;
	}
	if (value == Py_None) {
		object->vendor_setup = NULL;
	} else {
		object->vendor_setup = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->vendor_setup = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get__ndr_size_color_profiles(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_color_profiles;
	py__ndr_size_color_profiles = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_color_profiles));
	return py__ndr_size_color_profiles;
}

static int py_spoolss_AddDriverInfo8_set__ndr_size_color_profiles(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_color_profiles");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_color_profiles));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_color_profiles = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_color_profiles(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_color_profiles;
	if (object->color_profiles == NULL) {
		Py_RETURN_NONE;
	}
	if (object->color_profiles == NULL) {
		py_color_profiles = Py_None;
		Py_INCREF(py_color_profiles);
	} else {
		py_color_profiles = pytalloc_reference_ex(&spoolss_StringArray_Type, object->color_profiles, object->color_profiles);
	}
	return py_color_profiles;
}

static int py_spoolss_AddDriverInfo8_set_color_profiles(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->color_profiles));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->color_profiles");
		return -1;
	}
	if (value == Py_None) {
		object->color_profiles = NULL;
	} else {
		object->color_profiles = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->color_profiles = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_inf_path(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_inf_path;
	if (object->inf_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->inf_path == NULL) {
		py_inf_path = Py_None;
		Py_INCREF(py_inf_path);
	} else {
		if (object->inf_path == NULL) {
			py_inf_path = Py_None;
			Py_INCREF(py_inf_path);
		} else {
			py_inf_path = PyUnicode_Decode(object->inf_path, strlen(object->inf_path), "utf-8", "ignore");
		}
	}
	return py_inf_path;
}

static int py_spoolss_AddDriverInfo8_set_inf_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->inf_path");
		return -1;
	}
	if (value == Py_None) {
		object->inf_path = NULL;
	} else {
		object->inf_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->inf_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_printer_driver_attributes(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_driver_attributes;
	py_printer_driver_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->printer_driver_attributes));
	return py_printer_driver_attributes;
}

static int py_spoolss_AddDriverInfo8_set_printer_driver_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_driver_attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->printer_driver_attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->printer_driver_attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get__ndr_size_core_driver_dependencies(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size_core_driver_dependencies;
	py__ndr_size_core_driver_dependencies = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size_core_driver_dependencies));
	return py__ndr_size_core_driver_dependencies;
}

static int py_spoolss_AddDriverInfo8_set__ndr_size_core_driver_dependencies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size_core_driver_dependencies");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size_core_driver_dependencies));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size_core_driver_dependencies = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_core_driver_dependencies(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_core_driver_dependencies;
	if (object->core_driver_dependencies == NULL) {
		Py_RETURN_NONE;
	}
	if (object->core_driver_dependencies == NULL) {
		py_core_driver_dependencies = Py_None;
		Py_INCREF(py_core_driver_dependencies);
	} else {
		py_core_driver_dependencies = pytalloc_reference_ex(&spoolss_StringArray_Type, object->core_driver_dependencies, object->core_driver_dependencies);
	}
	return py_core_driver_dependencies;
}

static int py_spoolss_AddDriverInfo8_set_core_driver_dependencies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->core_driver_dependencies));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->core_driver_dependencies");
		return -1;
	}
	if (value == Py_None) {
		object->core_driver_dependencies = NULL;
	} else {
		object->core_driver_dependencies = NULL;
		PY_CHECK_TYPE(&spoolss_StringArray_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->core_driver_dependencies = (struct spoolss_StringArray *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_min_inbox_driver_ver_date(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_min_inbox_driver_ver_date;
	py_min_inbox_driver_ver_date = PyLong_FromUnsignedLongLong(object->min_inbox_driver_ver_date);
	return py_min_inbox_driver_ver_date;
}

static int py_spoolss_AddDriverInfo8_set_min_inbox_driver_ver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->min_inbox_driver_ver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_inbox_driver_ver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->min_inbox_driver_ver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfo8_get_min_inbox_driver_ver_version(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_min_inbox_driver_ver_version;
	py_min_inbox_driver_ver_version = PyLong_FromUnsignedLongLong(object->min_inbox_driver_ver_version);
	return py_min_inbox_driver_ver_version;
}

static int py_spoolss_AddDriverInfo8_set_min_inbox_driver_ver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->min_inbox_driver_ver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_inbox_driver_ver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->min_inbox_driver_ver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfo8_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_AddDriverInfo8_get_version,
		.set = py_spoolss_AddDriverInfo8_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_AddDriverInfo8_get_driver_name,
		.set = py_spoolss_AddDriverInfo8_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_AddDriverInfo8_get_architecture,
		.set = py_spoolss_AddDriverInfo8_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_AddDriverInfo8_get_driver_path,
		.set = py_spoolss_AddDriverInfo8_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_AddDriverInfo8_get_data_file,
		.set = py_spoolss_AddDriverInfo8_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_AddDriverInfo8_get_config_file,
		.set = py_spoolss_AddDriverInfo8_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_AddDriverInfo8_get_help_file,
		.set = py_spoolss_AddDriverInfo8_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddDriverInfo8_get_monitor_name,
		.set = py_spoolss_AddDriverInfo8_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_AddDriverInfo8_get_default_datatype,
		.set = py_spoolss_AddDriverInfo8_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_ndr_size_dependent_files"),
		.get = py_spoolss_AddDriverInfo8_get__ndr_size_dependent_files,
		.set = py_spoolss_AddDriverInfo8_set__ndr_size_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_AddDriverInfo8_get_dependent_files,
		.set = py_spoolss_AddDriverInfo8_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "_ndr_size_previous_names"),
		.get = py_spoolss_AddDriverInfo8_get__ndr_size_previous_names,
		.set = py_spoolss_AddDriverInfo8_set__ndr_size_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_AddDriverInfo8_get_previous_names,
		.set = py_spoolss_AddDriverInfo8_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_AddDriverInfo8_get_driver_date,
		.set = py_spoolss_AddDriverInfo8_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_AddDriverInfo8_get_driver_version,
		.set = py_spoolss_AddDriverInfo8_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "manufacturer_name"),
		.get = py_spoolss_AddDriverInfo8_get_manufacturer_name,
		.set = py_spoolss_AddDriverInfo8_set_manufacturer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "manufacturer_url"),
		.get = py_spoolss_AddDriverInfo8_get_manufacturer_url,
		.set = py_spoolss_AddDriverInfo8_set_manufacturer_url,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "hardware_id"),
		.get = py_spoolss_AddDriverInfo8_get_hardware_id,
		.set = py_spoolss_AddDriverInfo8_set_hardware_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "provider"),
		.get = py_spoolss_AddDriverInfo8_get_provider,
		.set = py_spoolss_AddDriverInfo8_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_AddDriverInfo8_get_print_processor,
		.set = py_spoolss_AddDriverInfo8_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "vendor_setup"),
		.get = py_spoolss_AddDriverInfo8_get_vendor_setup,
		.set = py_spoolss_AddDriverInfo8_set_vendor_setup,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "_ndr_size_color_profiles"),
		.get = py_spoolss_AddDriverInfo8_get__ndr_size_color_profiles,
		.set = py_spoolss_AddDriverInfo8_set__ndr_size_color_profiles,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "color_profiles"),
		.get = py_spoolss_AddDriverInfo8_get_color_profiles,
		.set = py_spoolss_AddDriverInfo8_set_color_profiles,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "inf_path"),
		.get = py_spoolss_AddDriverInfo8_get_inf_path,
		.set = py_spoolss_AddDriverInfo8_set_inf_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "printer_driver_attributes"),
		.get = py_spoolss_AddDriverInfo8_get_printer_driver_attributes,
		.set = py_spoolss_AddDriverInfo8_set_printer_driver_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverAttributes")
	},
	{
		.name = discard_const_p(char, "_ndr_size_core_driver_dependencies"),
		.get = py_spoolss_AddDriverInfo8_get__ndr_size_core_driver_dependencies,
		.set = py_spoolss_AddDriverInfo8_set__ndr_size_core_driver_dependencies,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "core_driver_dependencies"),
		.get = py_spoolss_AddDriverInfo8_get_core_driver_dependencies,
		.set = py_spoolss_AddDriverInfo8_set_core_driver_dependencies,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_StringArray")
	},
	{
		.name = discard_const_p(char, "min_inbox_driver_ver_date"),
		.get = py_spoolss_AddDriverInfo8_get_min_inbox_driver_ver_date,
		.set = py_spoolss_AddDriverInfo8_set_min_inbox_driver_ver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "min_inbox_driver_ver_version"),
		.get = py_spoolss_AddDriverInfo8_get_min_inbox_driver_ver_version,
		.set = py_spoolss_AddDriverInfo8_set_min_inbox_driver_ver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfo8, type);
}


static PyTypeObject spoolss_AddDriverInfo8_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo8",
	.tp_getset = py_spoolss_AddDriverInfo8_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo8_new,
};

static PyObject *py_import_spoolss_AddDriverInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_AddDriverInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo2_Type, in->info2, in->info2);
			}
			return ret;

		case 3:
			if (in->info3 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo3_Type, in->info3, in->info3);
			}
			return ret;

		case 4:
			if (in->info4 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo4_Type, in->info4, in->info4);
			}
			return ret;

		case 6:
			if (in->info6 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo6_Type, in->info6, in->info6);
			}
			return ret;

		case 8:
			if (in->info8 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddDriverInfo8_Type, in->info8, in->info8);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_AddDriverInfo *py_export_spoolss_AddDriverInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_AddDriverInfo *ret = talloc_zero(mem_ctx, union spoolss_AddDriverInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_AddDriverInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_AddDriverInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info3 = NULL;
			} else {
				ret->info3 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo3_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info3 = (struct spoolss_AddDriverInfo3 *)pytalloc_get_ptr(in);
			}
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info4 = NULL;
			} else {
				ret->info4 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo4_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info4 = (struct spoolss_AddDriverInfo4 *)pytalloc_get_ptr(in);
			}
			break;

		case 6:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info6");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info6 = NULL;
			} else {
				ret->info6 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo6_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info6 = (struct spoolss_AddDriverInfo6 *)pytalloc_get_ptr(in);
			}
			break;

		case 8:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info8");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info8 = NULL;
			} else {
				ret->info8 = NULL;
				PY_CHECK_TYPE(&spoolss_AddDriverInfo8_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info8 = (struct spoolss_AddDriverInfo8 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_AddDriverInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_AddDriverInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_AddDriverInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_AddDriverInfo!");
		return NULL;
	}

	return py_import_spoolss_AddDriverInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_AddDriverInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_AddDriverInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_AddDriverInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_AddDriverInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddDriverInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddDriverInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_AddDriverInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_AddDriverInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_AddDriverInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfo_new,
};


static PyObject *py_spoolss_AddDriverInfoCtr_get_level(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_AddDriverInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddDriverInfoCtr_get_info(PyObject *obj, void *closure)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_AddDriverInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_AddDriverInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_AddDriverInfoCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_AddDriverInfo *info_switch_0;
		info_switch_0 = (union spoolss_AddDriverInfo *)pyrpc_export_union(&spoolss_AddDriverInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_AddDriverInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddDriverInfoCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_AddDriverInfoCtr_get_level,
		.set = py_spoolss_AddDriverInfoCtr_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_AddDriverInfoCtr_get_info,
		.set = py_spoolss_AddDriverInfoCtr_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddDriverInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddDriverInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddDriverInfoCtr, type);
}

static PyObject *py_spoolss_AddDriverInfoCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_AddDriverInfoCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_AddDriverInfoCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_AddDriverInfoCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_AddDriverInfoCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddDriverInfoCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_AddDriverInfoCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_AddDriverInfoCtr, "spoolss_AddDriverInfoCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_AddDriverInfoCtr, "spoolss_AddDriverInfoCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_AddDriverInfoCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_AddDriverInfoCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddDriverInfoCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddDriverInfoCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddDriverInfoCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddDriverInfoCtr",
	.tp_getset = py_spoolss_AddDriverInfoCtr_getsetters,
	.tp_methods = py_spoolss_AddDriverInfoCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddDriverInfoCtr_new,
};


static PyObject *py_spoolss_DriverInfo1_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo1_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo1_get_driver_name,
		.set = py_spoolss_DriverInfo1_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo1, type);
}

static PyObject *py_spoolss_DriverInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo1, "spoolss_DriverInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo1, "spoolss_DriverInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo1",
	.tp_getset = py_spoolss_DriverInfo1_getsetters,
	.tp_methods = py_spoolss_DriverInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo1_new,
};


static PyObject *py_spoolss_DriverInfo2_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo2_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo2_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo2_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo2_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo2_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo2_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo2_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo2_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo2_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo2_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo2_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo2_get_version,
		.set = py_spoolss_DriverInfo2_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo2_get_driver_name,
		.set = py_spoolss_DriverInfo2_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo2_get_architecture,
		.set = py_spoolss_DriverInfo2_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo2_get_driver_path,
		.set = py_spoolss_DriverInfo2_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo2_get_data_file,
		.set = py_spoolss_DriverInfo2_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo2_get_config_file,
		.set = py_spoolss_DriverInfo2_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo2, type);
}

static PyObject *py_spoolss_DriverInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo2, "spoolss_DriverInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo2, "spoolss_DriverInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo2",
	.tp_getset = py_spoolss_DriverInfo2_getsetters,
	.tp_methods = py_spoolss_DriverInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo2_new,
};


static PyObject *py_spoolss_DriverInfo3_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo3_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo3_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo3_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo3_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo3_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo3_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		py_help_file = PyString_FromStringOrNULL(object->help_file);
	}
	return py_help_file;
}

static int py_spoolss_DriverInfo3_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_GenericObject_reference_ex(object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_DriverInfo3_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		object->dependent_files = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_DriverInfo3_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo3_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		py_default_datatype = PyString_FromStringOrNULL(object->default_datatype);
	}
	return py_default_datatype;
}

static int py_spoolss_DriverInfo3_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo3_get_version,
		.set = py_spoolss_DriverInfo3_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo3_get_driver_name,
		.set = py_spoolss_DriverInfo3_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo3_get_architecture,
		.set = py_spoolss_DriverInfo3_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo3_get_driver_path,
		.set = py_spoolss_DriverInfo3_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo3_get_data_file,
		.set = py_spoolss_DriverInfo3_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo3_get_config_file,
		.set = py_spoolss_DriverInfo3_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_DriverInfo3_get_help_file,
		.set = py_spoolss_DriverInfo3_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_DriverInfo3_get_dependent_files,
		.set = py_spoolss_DriverInfo3_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_DriverInfo3_get_monitor_name,
		.set = py_spoolss_DriverInfo3_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_DriverInfo3_get_default_datatype,
		.set = py_spoolss_DriverInfo3_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo3, type);
}

static PyObject *py_spoolss_DriverInfo3_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo3);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo3);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo3);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo3_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo3 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo3, "spoolss_DriverInfo3", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo3, "spoolss_DriverInfo3", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo3_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo3_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo3",
	.tp_getset = py_spoolss_DriverInfo3_getsetters,
	.tp_methods = py_spoolss_DriverInfo3_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo3_new,
};


static PyObject *py_spoolss_DriverInfo4_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo4_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo4_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo4_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo4_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo4_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo4_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		py_help_file = PyString_FromStringOrNULL(object->help_file);
	}
	return py_help_file;
}

static int py_spoolss_DriverInfo4_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_GenericObject_reference_ex(object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_DriverInfo4_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		object->dependent_files = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_DriverInfo4_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		py_default_datatype = PyString_FromStringOrNULL(object->default_datatype);
	}
	return py_default_datatype;
}

static int py_spoolss_DriverInfo4_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo4_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_GenericObject_reference_ex(object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_DriverInfo4_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		object->previous_names = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo4_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo4_get_version,
		.set = py_spoolss_DriverInfo4_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo4_get_driver_name,
		.set = py_spoolss_DriverInfo4_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo4_get_architecture,
		.set = py_spoolss_DriverInfo4_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo4_get_driver_path,
		.set = py_spoolss_DriverInfo4_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo4_get_data_file,
		.set = py_spoolss_DriverInfo4_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo4_get_config_file,
		.set = py_spoolss_DriverInfo4_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_DriverInfo4_get_help_file,
		.set = py_spoolss_DriverInfo4_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_DriverInfo4_get_dependent_files,
		.set = py_spoolss_DriverInfo4_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_DriverInfo4_get_monitor_name,
		.set = py_spoolss_DriverInfo4_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_DriverInfo4_get_default_datatype,
		.set = py_spoolss_DriverInfo4_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_DriverInfo4_get_previous_names,
		.set = py_spoolss_DriverInfo4_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo4_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo4, type);
}

static PyObject *py_spoolss_DriverInfo4_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo4);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo4_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo4);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo4);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo4_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo4 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo4, "spoolss_DriverInfo4", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo4, "spoolss_DriverInfo4", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo4_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo4_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo4_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo4_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo4_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo4",
	.tp_getset = py_spoolss_DriverInfo4_getsetters,
	.tp_methods = py_spoolss_DriverInfo4_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo4_new,
};


static PyObject *py_spoolss_DriverInfo5_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo5_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo5_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo5_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo5_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo5_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo5_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_driver_attributes(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_attributes;
	py_driver_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->driver_attributes));
	return py_driver_attributes;
}

static int py_spoolss_DriverInfo5_set_driver_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_config_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_version;
	py_config_version = PyLong_FromUnsignedLongLong((uint32_t)(object->config_version));
	return py_config_version;
}

static int py_spoolss_DriverInfo5_set_config_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->config_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->config_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo5_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong((uint32_t)(object->driver_version));
	return py_driver_version;
}

static int py_spoolss_DriverInfo5_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo5_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo5_get_version,
		.set = py_spoolss_DriverInfo5_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo5_get_driver_name,
		.set = py_spoolss_DriverInfo5_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo5_get_architecture,
		.set = py_spoolss_DriverInfo5_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo5_get_driver_path,
		.set = py_spoolss_DriverInfo5_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo5_get_data_file,
		.set = py_spoolss_DriverInfo5_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo5_get_config_file,
		.set = py_spoolss_DriverInfo5_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_attributes"),
		.get = py_spoolss_DriverInfo5_get_driver_attributes,
		.set = py_spoolss_DriverInfo5_set_driver_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverAttributes")
	},
	{
		.name = discard_const_p(char, "config_version"),
		.get = py_spoolss_DriverInfo5_get_config_version,
		.set = py_spoolss_DriverInfo5_set_config_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_DriverInfo5_get_driver_version,
		.set = py_spoolss_DriverInfo5_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo5_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo5, type);
}

static PyObject *py_spoolss_DriverInfo5_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo5);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo5_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo5);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo5);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo5_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo5 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo5, "spoolss_DriverInfo5", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo5, "spoolss_DriverInfo5", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo5_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo5_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo5_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo5_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo5_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo5",
	.tp_getset = py_spoolss_DriverInfo5_getsetters,
	.tp_methods = py_spoolss_DriverInfo5_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo5_new,
};


static PyObject *py_spoolss_DriverInfo6_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo6_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo6_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo6_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo6_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo6_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo6_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		py_help_file = PyString_FromStringOrNULL(object->help_file);
	}
	return py_help_file;
}

static int py_spoolss_DriverInfo6_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_GenericObject_reference_ex(object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_DriverInfo6_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		object->dependent_files = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_DriverInfo6_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		py_default_datatype = PyString_FromStringOrNULL(object->default_datatype);
	}
	return py_default_datatype;
}

static int py_spoolss_DriverInfo6_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_GenericObject_reference_ex(object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_DriverInfo6_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		object->previous_names = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_DriverInfo6_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_DriverInfo6_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_manufacturer_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_name;
	if (object->manufacturer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_name == NULL) {
		py_manufacturer_name = Py_None;
		Py_INCREF(py_manufacturer_name);
	} else {
		py_manufacturer_name = PyString_FromStringOrNULL(object->manufacturer_name);
	}
	return py_manufacturer_name;
}

static int py_spoolss_DriverInfo6_set_manufacturer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_name");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_name = NULL;
	} else {
		object->manufacturer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_manufacturer_url(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_url;
	if (object->manufacturer_url == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_url == NULL) {
		py_manufacturer_url = Py_None;
		Py_INCREF(py_manufacturer_url);
	} else {
		py_manufacturer_url = PyString_FromStringOrNULL(object->manufacturer_url);
	}
	return py_manufacturer_url;
}

static int py_spoolss_DriverInfo6_set_manufacturer_url(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_url");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_url = NULL;
	} else {
		object->manufacturer_url = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_url = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_hardware_id(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_id;
	if (object->hardware_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->hardware_id == NULL) {
		py_hardware_id = Py_None;
		Py_INCREF(py_hardware_id);
	} else {
		py_hardware_id = PyString_FromStringOrNULL(object->hardware_id);
	}
	return py_hardware_id;
}

static int py_spoolss_DriverInfo6_set_hardware_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_id");
		return -1;
	}
	if (value == Py_None) {
		object->hardware_id = NULL;
	} else {
		object->hardware_id = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->hardware_id = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo6_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		py_provider = PyString_FromStringOrNULL(object->provider);
	}
	return py_provider;
}

static int py_spoolss_DriverInfo6_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->provider");
		return -1;
	}
	if (value == Py_None) {
		object->provider = NULL;
	} else {
		object->provider = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->provider = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo6_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo6_get_version,
		.set = py_spoolss_DriverInfo6_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo6_get_driver_name,
		.set = py_spoolss_DriverInfo6_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo6_get_architecture,
		.set = py_spoolss_DriverInfo6_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo6_get_driver_path,
		.set = py_spoolss_DriverInfo6_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo6_get_data_file,
		.set = py_spoolss_DriverInfo6_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo6_get_config_file,
		.set = py_spoolss_DriverInfo6_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_DriverInfo6_get_help_file,
		.set = py_spoolss_DriverInfo6_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_DriverInfo6_get_dependent_files,
		.set = py_spoolss_DriverInfo6_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_DriverInfo6_get_monitor_name,
		.set = py_spoolss_DriverInfo6_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_DriverInfo6_get_default_datatype,
		.set = py_spoolss_DriverInfo6_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_DriverInfo6_get_previous_names,
		.set = py_spoolss_DriverInfo6_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_DriverInfo6_get_driver_date,
		.set = py_spoolss_DriverInfo6_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_DriverInfo6_get_driver_version,
		.set = py_spoolss_DriverInfo6_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "manufacturer_name"),
		.get = py_spoolss_DriverInfo6_get_manufacturer_name,
		.set = py_spoolss_DriverInfo6_set_manufacturer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "manufacturer_url"),
		.get = py_spoolss_DriverInfo6_get_manufacturer_url,
		.set = py_spoolss_DriverInfo6_set_manufacturer_url,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "hardware_id"),
		.get = py_spoolss_DriverInfo6_get_hardware_id,
		.set = py_spoolss_DriverInfo6_set_hardware_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "provider"),
		.get = py_spoolss_DriverInfo6_get_provider,
		.set = py_spoolss_DriverInfo6_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo6_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo6, type);
}

static PyObject *py_spoolss_DriverInfo6_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo6);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo6_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo6);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo6);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo6_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo6 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo6, "spoolss_DriverInfo6", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo6, "spoolss_DriverInfo6", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo6_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo6_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo6_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo6_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo6_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo6",
	.tp_getset = py_spoolss_DriverInfo6_getsetters,
	.tp_methods = py_spoolss_DriverInfo6_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo6_new,
};


static PyObject *py_spoolss_DriverInfo7_get_size(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_DriverInfo7_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo7_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo7_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo7_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo7_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo7_get_inf_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_inf_name;
	if (object->inf_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->inf_name == NULL) {
		py_inf_name = Py_None;
		Py_INCREF(py_inf_name);
	} else {
		py_inf_name = PyString_FromStringOrNULL(object->inf_name);
	}
	return py_inf_name;
}

static int py_spoolss_DriverInfo7_set_inf_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->inf_name");
		return -1;
	}
	if (value == Py_None) {
		object->inf_name = NULL;
	} else {
		object->inf_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->inf_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo7_get_install_source_root(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(obj);
	PyObject *py_install_source_root;
	if (object->install_source_root == NULL) {
		Py_RETURN_NONE;
	}
	if (object->install_source_root == NULL) {
		py_install_source_root = Py_None;
		Py_INCREF(py_install_source_root);
	} else {
		py_install_source_root = PyString_FromStringOrNULL(object->install_source_root);
	}
	return py_install_source_root;
}

static int py_spoolss_DriverInfo7_set_install_source_root(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->install_source_root");
		return -1;
	}
	if (value == Py_None) {
		object->install_source_root = NULL;
	} else {
		object->install_source_root = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->install_source_root = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo7_getsetters[] = {
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_DriverInfo7_get_size,
		.set = py_spoolss_DriverInfo7_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo7_get_version,
		.set = py_spoolss_DriverInfo7_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo7_get_driver_name,
		.set = py_spoolss_DriverInfo7_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "inf_name"),
		.get = py_spoolss_DriverInfo7_get_inf_name,
		.set = py_spoolss_DriverInfo7_set_inf_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "install_source_root"),
		.get = py_spoolss_DriverInfo7_get_install_source_root,
		.set = py_spoolss_DriverInfo7_set_install_source_root,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo7_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo7, type);
}

static PyObject *py_spoolss_DriverInfo7_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo7);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo7_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo7);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo7);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo7_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo7 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo7, "spoolss_DriverInfo7", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo7, "spoolss_DriverInfo7", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo7_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo7_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo7_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo7_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo7_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo7",
	.tp_getset = py_spoolss_DriverInfo7_getsetters,
	.tp_methods = py_spoolss_DriverInfo7_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo7_new,
};


static PyObject *py_spoolss_DriverInfo8_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo8_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo8_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo8_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_driver_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_path;
	if (object->driver_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_path == NULL) {
		py_driver_path = Py_None;
		Py_INCREF(py_driver_path);
	} else {
		py_driver_path = PyString_FromStringOrNULL(object->driver_path);
	}
	return py_driver_path;
}

static int py_spoolss_DriverInfo8_set_driver_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_path");
		return -1;
	}
	if (value == Py_None) {
		object->driver_path = NULL;
	} else {
		object->driver_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_data_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_data_file;
	if (object->data_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data_file == NULL) {
		py_data_file = Py_None;
		Py_INCREF(py_data_file);
	} else {
		py_data_file = PyString_FromStringOrNULL(object->data_file);
	}
	return py_data_file;
}

static int py_spoolss_DriverInfo8_set_data_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_file");
		return -1;
	}
	if (value == Py_None) {
		object->data_file = NULL;
	} else {
		object->data_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->data_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_config_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_config_file;
	if (object->config_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->config_file == NULL) {
		py_config_file = Py_None;
		Py_INCREF(py_config_file);
	} else {
		py_config_file = PyString_FromStringOrNULL(object->config_file);
	}
	return py_config_file;
}

static int py_spoolss_DriverInfo8_set_config_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->config_file");
		return -1;
	}
	if (value == Py_None) {
		object->config_file = NULL;
	} else {
		object->config_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->config_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_help_file(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_help_file;
	if (object->help_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->help_file == NULL) {
		py_help_file = Py_None;
		Py_INCREF(py_help_file);
	} else {
		py_help_file = PyString_FromStringOrNULL(object->help_file);
	}
	return py_help_file;
}

static int py_spoolss_DriverInfo8_set_help_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->help_file");
		return -1;
	}
	if (value == Py_None) {
		object->help_file = NULL;
	} else {
		object->help_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->help_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_dependent_files(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_dependent_files;
	if (object->dependent_files == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dependent_files == NULL) {
		py_dependent_files = Py_None;
		Py_INCREF(py_dependent_files);
	} else {
		py_dependent_files = pytalloc_GenericObject_reference_ex(object->dependent_files, object->dependent_files);
	}
	return py_dependent_files;
}

static int py_spoolss_DriverInfo8_set_dependent_files(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dependent_files");
		return -1;
	}
	if (value == Py_None) {
		object->dependent_files = NULL;
	} else {
		object->dependent_files = NULL;
		object->dependent_files = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_DriverInfo8_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		py_default_datatype = PyString_FromStringOrNULL(object->default_datatype);
	}
	return py_default_datatype;
}

static int py_spoolss_DriverInfo8_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_GenericObject_reference_ex(object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_DriverInfo8_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		object->previous_names = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_DriverInfo8_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_DriverInfo8_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_manufacturer_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_name;
	if (object->manufacturer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_name == NULL) {
		py_manufacturer_name = Py_None;
		Py_INCREF(py_manufacturer_name);
	} else {
		py_manufacturer_name = PyString_FromStringOrNULL(object->manufacturer_name);
	}
	return py_manufacturer_name;
}

static int py_spoolss_DriverInfo8_set_manufacturer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_name");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_name = NULL;
	} else {
		object->manufacturer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_manufacturer_url(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_url;
	if (object->manufacturer_url == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_url == NULL) {
		py_manufacturer_url = Py_None;
		Py_INCREF(py_manufacturer_url);
	} else {
		py_manufacturer_url = PyString_FromStringOrNULL(object->manufacturer_url);
	}
	return py_manufacturer_url;
}

static int py_spoolss_DriverInfo8_set_manufacturer_url(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_url");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_url = NULL;
	} else {
		object->manufacturer_url = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_url = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_hardware_id(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_id;
	if (object->hardware_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->hardware_id == NULL) {
		py_hardware_id = Py_None;
		Py_INCREF(py_hardware_id);
	} else {
		py_hardware_id = PyString_FromStringOrNULL(object->hardware_id);
	}
	return py_hardware_id;
}

static int py_spoolss_DriverInfo8_set_hardware_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_id");
		return -1;
	}
	if (value == Py_None) {
		object->hardware_id = NULL;
	} else {
		object->hardware_id = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->hardware_id = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		py_provider = PyString_FromStringOrNULL(object->provider);
	}
	return py_provider;
}

static int py_spoolss_DriverInfo8_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->provider");
		return -1;
	}
	if (value == Py_None) {
		object->provider = NULL;
	} else {
		object->provider = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->provider = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_print_processor(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor;
	if (object->print_processor == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor == NULL) {
		py_print_processor = Py_None;
		Py_INCREF(py_print_processor);
	} else {
		py_print_processor = PyString_FromStringOrNULL(object->print_processor);
	}
	return py_print_processor;
}

static int py_spoolss_DriverInfo8_set_print_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor = NULL;
	} else {
		object->print_processor = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_vendor_setup(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_vendor_setup;
	if (object->vendor_setup == NULL) {
		Py_RETURN_NONE;
	}
	if (object->vendor_setup == NULL) {
		py_vendor_setup = Py_None;
		Py_INCREF(py_vendor_setup);
	} else {
		py_vendor_setup = PyString_FromStringOrNULL(object->vendor_setup);
	}
	return py_vendor_setup;
}

static int py_spoolss_DriverInfo8_set_vendor_setup(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->vendor_setup");
		return -1;
	}
	if (value == Py_None) {
		object->vendor_setup = NULL;
	} else {
		object->vendor_setup = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->vendor_setup = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_color_profiles(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_color_profiles;
	if (object->color_profiles == NULL) {
		Py_RETURN_NONE;
	}
	if (object->color_profiles == NULL) {
		py_color_profiles = Py_None;
		Py_INCREF(py_color_profiles);
	} else {
		py_color_profiles = pytalloc_GenericObject_reference_ex(object->color_profiles, object->color_profiles);
	}
	return py_color_profiles;
}

static int py_spoolss_DriverInfo8_set_color_profiles(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->color_profiles");
		return -1;
	}
	if (value == Py_None) {
		object->color_profiles = NULL;
	} else {
		object->color_profiles = NULL;
		object->color_profiles = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_inf_path(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_inf_path;
	if (object->inf_path == NULL) {
		Py_RETURN_NONE;
	}
	if (object->inf_path == NULL) {
		py_inf_path = Py_None;
		Py_INCREF(py_inf_path);
	} else {
		py_inf_path = PyString_FromStringOrNULL(object->inf_path);
	}
	return py_inf_path;
}

static int py_spoolss_DriverInfo8_set_inf_path(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->inf_path");
		return -1;
	}
	if (value == Py_None) {
		object->inf_path = NULL;
	} else {
		object->inf_path = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->inf_path = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_printer_driver_attributes(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_driver_attributes;
	py_printer_driver_attributes = PyLong_FromUnsignedLongLong((uint32_t)(object->printer_driver_attributes));
	return py_printer_driver_attributes;
}

static int py_spoolss_DriverInfo8_set_printer_driver_attributes(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->printer_driver_attributes");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->printer_driver_attributes));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->printer_driver_attributes = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_core_driver_dependencies(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_core_driver_dependencies;
	if (object->core_driver_dependencies == NULL) {
		Py_RETURN_NONE;
	}
	if (object->core_driver_dependencies == NULL) {
		py_core_driver_dependencies = Py_None;
		Py_INCREF(py_core_driver_dependencies);
	} else {
		py_core_driver_dependencies = pytalloc_GenericObject_reference_ex(object->core_driver_dependencies, object->core_driver_dependencies);
	}
	return py_core_driver_dependencies;
}

static int py_spoolss_DriverInfo8_set_core_driver_dependencies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->core_driver_dependencies");
		return -1;
	}
	if (value == Py_None) {
		object->core_driver_dependencies = NULL;
	} else {
		object->core_driver_dependencies = NULL;
		object->core_driver_dependencies = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_min_inbox_driver_ver_date(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_min_inbox_driver_ver_date;
	py_min_inbox_driver_ver_date = PyLong_FromUnsignedLongLong(object->min_inbox_driver_ver_date);
	return py_min_inbox_driver_ver_date;
}

static int py_spoolss_DriverInfo8_set_min_inbox_driver_ver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->min_inbox_driver_ver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_inbox_driver_ver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->min_inbox_driver_ver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo8_get_min_inbox_driver_ver_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(obj);
	PyObject *py_min_inbox_driver_ver_version;
	py_min_inbox_driver_ver_version = PyLong_FromUnsignedLongLong(object->min_inbox_driver_ver_version);
	return py_min_inbox_driver_ver_version;
}

static int py_spoolss_DriverInfo8_set_min_inbox_driver_ver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->min_inbox_driver_ver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->min_inbox_driver_ver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->min_inbox_driver_ver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo8_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo8_get_version,
		.set = py_spoolss_DriverInfo8_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo8_get_driver_name,
		.set = py_spoolss_DriverInfo8_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo8_get_architecture,
		.set = py_spoolss_DriverInfo8_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "driver_path"),
		.get = py_spoolss_DriverInfo8_get_driver_path,
		.set = py_spoolss_DriverInfo8_set_driver_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "data_file"),
		.get = py_spoolss_DriverInfo8_get_data_file,
		.set = py_spoolss_DriverInfo8_set_data_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "config_file"),
		.get = py_spoolss_DriverInfo8_get_config_file,
		.set = py_spoolss_DriverInfo8_set_config_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "help_file"),
		.get = py_spoolss_DriverInfo8_get_help_file,
		.set = py_spoolss_DriverInfo8_set_help_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "dependent_files"),
		.get = py_spoolss_DriverInfo8_get_dependent_files,
		.set = py_spoolss_DriverInfo8_set_dependent_files,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_DriverInfo8_get_monitor_name,
		.set = py_spoolss_DriverInfo8_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_DriverInfo8_get_default_datatype,
		.set = py_spoolss_DriverInfo8_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_DriverInfo8_get_previous_names,
		.set = py_spoolss_DriverInfo8_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_DriverInfo8_get_driver_date,
		.set = py_spoolss_DriverInfo8_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_DriverInfo8_get_driver_version,
		.set = py_spoolss_DriverInfo8_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "manufacturer_name"),
		.get = py_spoolss_DriverInfo8_get_manufacturer_name,
		.set = py_spoolss_DriverInfo8_set_manufacturer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "manufacturer_url"),
		.get = py_spoolss_DriverInfo8_get_manufacturer_url,
		.set = py_spoolss_DriverInfo8_set_manufacturer_url,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "hardware_id"),
		.get = py_spoolss_DriverInfo8_get_hardware_id,
		.set = py_spoolss_DriverInfo8_set_hardware_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "provider"),
		.get = py_spoolss_DriverInfo8_get_provider,
		.set = py_spoolss_DriverInfo8_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "print_processor"),
		.get = py_spoolss_DriverInfo8_get_print_processor,
		.set = py_spoolss_DriverInfo8_set_print_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "vendor_setup"),
		.get = py_spoolss_DriverInfo8_get_vendor_setup,
		.set = py_spoolss_DriverInfo8_set_vendor_setup,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "color_profiles"),
		.get = py_spoolss_DriverInfo8_get_color_profiles,
		.set = py_spoolss_DriverInfo8_set_color_profiles,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "inf_path"),
		.get = py_spoolss_DriverInfo8_get_inf_path,
		.set = py_spoolss_DriverInfo8_set_inf_path,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "printer_driver_attributes"),
		.get = py_spoolss_DriverInfo8_get_printer_driver_attributes,
		.set = py_spoolss_DriverInfo8_set_printer_driver_attributes,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverAttributes")
	},
	{
		.name = discard_const_p(char, "core_driver_dependencies"),
		.get = py_spoolss_DriverInfo8_get_core_driver_dependencies,
		.set = py_spoolss_DriverInfo8_set_core_driver_dependencies,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "min_inbox_driver_ver_date"),
		.get = py_spoolss_DriverInfo8_get_min_inbox_driver_ver_date,
		.set = py_spoolss_DriverInfo8_set_min_inbox_driver_ver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "min_inbox_driver_ver_version"),
		.get = py_spoolss_DriverInfo8_get_min_inbox_driver_ver_version,
		.set = py_spoolss_DriverInfo8_set_min_inbox_driver_ver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo8_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo8, type);
}

static PyObject *py_spoolss_DriverInfo8_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo8);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo8_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo8);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo8);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo8_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo8 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo8, "spoolss_DriverInfo8", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo8, "spoolss_DriverInfo8", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo8_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo8_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo8_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo8_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo8_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo8",
	.tp_getset = py_spoolss_DriverInfo8_getsetters,
	.tp_methods = py_spoolss_DriverInfo8_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo8_new,
};


static PyObject *py_spoolss_DriverFileInfo_get_file_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_file_name;
	if (object->file_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->file_name == NULL) {
		py_file_name = Py_None;
		Py_INCREF(py_file_name);
	} else {
		py_file_name = PyString_FromStringOrNULL(object->file_name);
	}
	return py_file_name;
}

static int py_spoolss_DriverFileInfo_set_file_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->file_name");
		return -1;
	}
	if (value == Py_None) {
		object->file_name = NULL;
	} else {
		object->file_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->file_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverFileInfo_get_file_type(PyObject *obj, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_file_type;
	py_file_type = PyLong_FromUnsignedLongLong((uint32_t)(object->file_type));
	return py_file_type;
}

static int py_spoolss_DriverFileInfo_set_file_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->file_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->file_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->file_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverFileInfo_get_file_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_file_version;
	py_file_version = PyLong_FromUnsignedLongLong((uint32_t)(object->file_version));
	return py_file_version;
}

static int py_spoolss_DriverFileInfo_set_file_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->file_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->file_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->file_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverFileInfo_getsetters[] = {
	{
		.name = discard_const_p(char, "file_name"),
		.get = py_spoolss_DriverFileInfo_get_file_name,
		.set = py_spoolss_DriverFileInfo_set_file_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "file_type"),
		.get = py_spoolss_DriverFileInfo_get_file_type,
		.set = py_spoolss_DriverFileInfo_set_file_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverFileType")
	},
	{
		.name = discard_const_p(char, "file_version"),
		.get = py_spoolss_DriverFileInfo_get_file_version,
		.set = py_spoolss_DriverFileInfo_set_file_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverFileInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverFileInfo, type);
}

static PyObject *py_spoolss_DriverFileInfo_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverFileInfo);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverFileInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverFileInfo);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverFileInfo);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverFileInfo_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverFileInfo *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverFileInfo, "spoolss_DriverFileInfo", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverFileInfo, "spoolss_DriverFileInfo", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverFileInfo_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverFileInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverFileInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverFileInfo_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverFileInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverFileInfo",
	.tp_getset = py_spoolss_DriverFileInfo_getsetters,
	.tp_methods = py_spoolss_DriverFileInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverFileInfo_new,
};


static PyObject *py_spoolss_DriverInfo101_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_DriverInfo101_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_driver_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_name;
	if (object->driver_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->driver_name == NULL) {
		py_driver_name = Py_None;
		Py_INCREF(py_driver_name);
	} else {
		py_driver_name = PyString_FromStringOrNULL(object->driver_name);
	}
	return py_driver_name;
}

static int py_spoolss_DriverInfo101_set_driver_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_name");
		return -1;
	}
	if (value == Py_None) {
		object->driver_name = NULL;
	} else {
		object->driver_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->driver_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyString_FromStringOrNULL(object->architecture);
	}
	return py_architecture;
}

static int py_spoolss_DriverInfo101_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->architecture");
		return -1;
	}
	if (value == Py_None) {
		object->architecture = NULL;
	} else {
		object->architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_file_info(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_file_info;
	if (object->file_info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->file_info == NULL) {
		py_file_info = Py_None;
		Py_INCREF(py_file_info);
	} else {
		py_file_info = PyList_New(object->file_count);
		if (py_file_info == NULL) {
			return NULL;
		}
		{
			int file_info_cntr_1;
			for (file_info_cntr_1 = 0; file_info_cntr_1 < (object->file_count); file_info_cntr_1++) {
				PyObject *py_file_info_1;
				py_file_info_1 = pytalloc_reference_ex(&spoolss_DriverFileInfo_Type, object->file_info, &(object->file_info)[file_info_cntr_1]);
				PyList_SetItem(py_file_info, file_info_cntr_1, py_file_info_1);
			}
		}
	}
	return py_file_info;
}

static int py_spoolss_DriverInfo101_set_file_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->file_info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->file_info");
		return -1;
	}
	if (value == Py_None) {
		object->file_info = NULL;
	} else {
		object->file_info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int file_info_cntr_1;
			object->file_info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->file_info, PyList_GET_SIZE(value));
			if (!object->file_info) { return -1; }
			talloc_set_name_const(object->file_info, "ARRAY: object->file_info");
			for (file_info_cntr_1 = 0; file_info_cntr_1 < PyList_GET_SIZE(value); file_info_cntr_1++) {
				if (PyList_GET_ITEM(value, file_info_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->file_info)[file_info_cntr_1]");
					return -1;
				}
				PY_CHECK_TYPE(&spoolss_DriverFileInfo_Type, PyList_GET_ITEM(value, file_info_cntr_1), return -1;);
				if (talloc_reference(object->file_info, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, file_info_cntr_1))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(object->file_info)[file_info_cntr_1] = *(struct spoolss_DriverFileInfo *)pytalloc_get_ptr(PyList_GET_ITEM(value, file_info_cntr_1));
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_file_count(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_file_count;
	py_file_count = PyLong_FromUnsignedLongLong((uint32_t)(object->file_count));
	return py_file_count;
}

static int py_spoolss_DriverInfo101_set_file_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->file_count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->file_count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->file_count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_DriverInfo101_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_default_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_default_datatype;
	if (object->default_datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->default_datatype == NULL) {
		py_default_datatype = Py_None;
		Py_INCREF(py_default_datatype);
	} else {
		py_default_datatype = PyString_FromStringOrNULL(object->default_datatype);
	}
	return py_default_datatype;
}

static int py_spoolss_DriverInfo101_set_default_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->default_datatype");
		return -1;
	}
	if (value == Py_None) {
		object->default_datatype = NULL;
	} else {
		object->default_datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->default_datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_previous_names(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_previous_names;
	if (object->previous_names == NULL) {
		Py_RETURN_NONE;
	}
	if (object->previous_names == NULL) {
		py_previous_names = Py_None;
		Py_INCREF(py_previous_names);
	} else {
		py_previous_names = pytalloc_GenericObject_reference_ex(object->previous_names, object->previous_names);
	}
	return py_previous_names;
}

static int py_spoolss_DriverInfo101_set_previous_names(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->previous_names");
		return -1;
	}
	if (value == Py_None) {
		object->previous_names = NULL;
	} else {
		object->previous_names = NULL;
		object->previous_names = pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_DriverInfo101_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_DriverInfo101_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_manufacturer_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_name;
	if (object->manufacturer_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_name == NULL) {
		py_manufacturer_name = Py_None;
		Py_INCREF(py_manufacturer_name);
	} else {
		py_manufacturer_name = PyString_FromStringOrNULL(object->manufacturer_name);
	}
	return py_manufacturer_name;
}

static int py_spoolss_DriverInfo101_set_manufacturer_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_name");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_name = NULL;
	} else {
		object->manufacturer_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_manufacturer_url(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_manufacturer_url;
	if (object->manufacturer_url == NULL) {
		Py_RETURN_NONE;
	}
	if (object->manufacturer_url == NULL) {
		py_manufacturer_url = Py_None;
		Py_INCREF(py_manufacturer_url);
	} else {
		py_manufacturer_url = PyString_FromStringOrNULL(object->manufacturer_url);
	}
	return py_manufacturer_url;
}

static int py_spoolss_DriverInfo101_set_manufacturer_url(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->manufacturer_url");
		return -1;
	}
	if (value == Py_None) {
		object->manufacturer_url = NULL;
	} else {
		object->manufacturer_url = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->manufacturer_url = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_hardware_id(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_id;
	if (object->hardware_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->hardware_id == NULL) {
		py_hardware_id = Py_None;
		Py_INCREF(py_hardware_id);
	} else {
		py_hardware_id = PyString_FromStringOrNULL(object->hardware_id);
	}
	return py_hardware_id;
}

static int py_spoolss_DriverInfo101_set_hardware_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_id");
		return -1;
	}
	if (value == Py_None) {
		object->hardware_id = NULL;
	} else {
		object->hardware_id = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->hardware_id = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DriverInfo101_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		py_provider = PyString_FromStringOrNULL(object->provider);
	}
	return py_provider;
}

static int py_spoolss_DriverInfo101_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->provider");
		return -1;
	}
	if (value == Py_None) {
		object->provider = NULL;
	} else {
		object->provider = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->provider = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverInfo101_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_DriverInfo101_get_version,
		.set = py_spoolss_DriverInfo101_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverOSVersion")
	},
	{
		.name = discard_const_p(char, "driver_name"),
		.get = py_spoolss_DriverInfo101_get_driver_name,
		.set = py_spoolss_DriverInfo101_set_driver_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "architecture"),
		.get = py_spoolss_DriverInfo101_get_architecture,
		.set = py_spoolss_DriverInfo101_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "file_info"),
		.get = py_spoolss_DriverInfo101_get_file_info,
		.set = py_spoolss_DriverInfo101_set_file_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverFileInfo")
	},
	{
		.name = discard_const_p(char, "file_count"),
		.get = py_spoolss_DriverInfo101_get_file_count,
		.set = py_spoolss_DriverInfo101_set_file_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_DriverInfo101_get_monitor_name,
		.set = py_spoolss_DriverInfo101_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "default_datatype"),
		.get = py_spoolss_DriverInfo101_get_default_datatype,
		.set = py_spoolss_DriverInfo101_set_default_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "previous_names"),
		.get = py_spoolss_DriverInfo101_get_previous_names,
		.set = py_spoolss_DriverInfo101_set_previous_names,
		.doc = discard_const_p(char, "PIDL-generated element of base type string_array")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_DriverInfo101_get_driver_date,
		.set = py_spoolss_DriverInfo101_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_DriverInfo101_get_driver_version,
		.set = py_spoolss_DriverInfo101_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "manufacturer_name"),
		.get = py_spoolss_DriverInfo101_get_manufacturer_name,
		.set = py_spoolss_DriverInfo101_set_manufacturer_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "manufacturer_url"),
		.get = py_spoolss_DriverInfo101_get_manufacturer_url,
		.set = py_spoolss_DriverInfo101_set_manufacturer_url,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "hardware_id"),
		.get = py_spoolss_DriverInfo101_get_hardware_id,
		.set = py_spoolss_DriverInfo101_set_hardware_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "provider"),
		.get = py_spoolss_DriverInfo101_get_provider,
		.set = py_spoolss_DriverInfo101_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverInfo101_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverInfo101, type);
}

static PyObject *py_spoolss_DriverInfo101_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo101);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverInfo101_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo101);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverInfo101);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverInfo101_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverInfo101 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo101, "spoolss_DriverInfo101", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverInfo101, "spoolss_DriverInfo101", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverInfo101_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverInfo101_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo101_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo101_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverInfo101_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo101",
	.tp_getset = py_spoolss_DriverInfo101_getsetters,
	.tp_methods = py_spoolss_DriverInfo101_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo101_new,
};

static PyObject *py_import_spoolss_DriverInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_DriverInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo2_Type, mem_ctx, &in->info2);
			return ret;

		case 3:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo3_Type, mem_ctx, &in->info3);
			return ret;

		case 4:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo4_Type, mem_ctx, &in->info4);
			return ret;

		case 5:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo5_Type, mem_ctx, &in->info5);
			return ret;

		case 6:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo6_Type, mem_ctx, &in->info6);
			return ret;

		case 7:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo7_Type, mem_ctx, &in->info7);
			return ret;

		case 8:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo8_Type, mem_ctx, &in->info8);
			return ret;

		case 101:
			ret = pytalloc_reference_ex(&spoolss_DriverInfo101_Type, mem_ctx, &in->info101);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_DriverInfo *py_export_spoolss_DriverInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_DriverInfo *ret = talloc_zero(mem_ctx, union spoolss_DriverInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_DriverInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_DriverInfo2 *)pytalloc_get_ptr(in);
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo3_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info3 = *(struct spoolss_DriverInfo3 *)pytalloc_get_ptr(in);
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info4");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo4_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info4 = *(struct spoolss_DriverInfo4 *)pytalloc_get_ptr(in);
			break;

		case 5:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info5");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo5_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info5 = *(struct spoolss_DriverInfo5 *)pytalloc_get_ptr(in);
			break;

		case 6:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info6");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo6_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info6 = *(struct spoolss_DriverInfo6 *)pytalloc_get_ptr(in);
			break;

		case 7:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info7");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo7_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info7 = *(struct spoolss_DriverInfo7 *)pytalloc_get_ptr(in);
			break;

		case 8:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info8");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo8_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info8 = *(struct spoolss_DriverInfo8 *)pytalloc_get_ptr(in);
			break;

		case 101:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info101");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverInfo101_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info101 = *(struct spoolss_DriverInfo101 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_DriverInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_DriverInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_DriverInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_DriverInfo!");
		return NULL;
	}

	return py_import_spoolss_DriverInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_DriverInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_DriverInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_DriverInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_DriverInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_DriverInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_DriverInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_DriverInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverInfo_new,
};


static PyObject *py_spoolss_DriverDirectoryInfo1_get_directory_name(PyObject *obj, void *closure)
{
	struct spoolss_DriverDirectoryInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_directory_name;
	py_directory_name = PyString_FromStringOrNULL(object->directory_name);
	return py_directory_name;
}

static int py_spoolss_DriverDirectoryInfo1_set_directory_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DriverDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->directory_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->directory_name = talloc_str;
	}
	return 0;
}

static PyGetSetDef py_spoolss_DriverDirectoryInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "directory_name"),
		.get = py_spoolss_DriverDirectoryInfo1_get_directory_name,
		.set = py_spoolss_DriverDirectoryInfo1_set_directory_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DriverDirectoryInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DriverDirectoryInfo1, type);
}

static PyObject *py_spoolss_DriverDirectoryInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DriverDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverDirectoryInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DriverDirectoryInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverDirectoryInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DriverDirectoryInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DriverDirectoryInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DriverDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverDirectoryInfo1, "spoolss_DriverDirectoryInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DriverDirectoryInfo1, "spoolss_DriverDirectoryInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DriverDirectoryInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DriverDirectoryInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverDirectoryInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverDirectoryInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DriverDirectoryInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverDirectoryInfo1",
	.tp_getset = py_spoolss_DriverDirectoryInfo1_getsetters,
	.tp_methods = py_spoolss_DriverDirectoryInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverDirectoryInfo1_new,
};

static PyObject *py_import_spoolss_DriverDirectoryInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_DriverDirectoryInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_DriverDirectoryInfo1_Type, mem_ctx, &in->info1);
			return ret;

		default:
			ret = pytalloc_reference_ex(&spoolss_DriverDirectoryInfo1_Type, mem_ctx, &in->info1);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_DriverDirectoryInfo *py_export_spoolss_DriverDirectoryInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_DriverDirectoryInfo *ret = talloc_zero(mem_ctx, union spoolss_DriverDirectoryInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverDirectoryInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_DriverDirectoryInfo1 *)pytalloc_get_ptr(in);
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DriverDirectoryInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_DriverDirectoryInfo1 *)pytalloc_get_ptr(in);
			break;

	}

	return ret;
}

static PyObject *py_spoolss_DriverDirectoryInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_DriverDirectoryInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_DriverDirectoryInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_DriverDirectoryInfo!");
		return NULL;
	}

	return py_import_spoolss_DriverDirectoryInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_DriverDirectoryInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_DriverDirectoryInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_DriverDirectoryInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_DriverDirectoryInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverDirectoryInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DriverDirectoryInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_DriverDirectoryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_DriverDirectoryInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DriverDirectoryInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_DriverDirectoryInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DriverDirectoryInfo_new,
};


static PyObject *py_spoolss_PrintProcessorInfo1_get_print_processor_name(PyObject *obj, void *closure)
{
	struct spoolss_PrintProcessorInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor_name;
	if (object->print_processor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->print_processor_name == NULL) {
		py_print_processor_name = Py_None;
		Py_INCREF(py_print_processor_name);
	} else {
		py_print_processor_name = PyString_FromStringOrNULL(object->print_processor_name);
	}
	return py_print_processor_name;
}

static int py_spoolss_PrintProcessorInfo1_set_print_processor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintProcessorInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->print_processor_name");
		return -1;
	}
	if (value == Py_None) {
		object->print_processor_name = NULL;
	} else {
		object->print_processor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->print_processor_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrintProcessorInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "print_processor_name"),
		.get = py_spoolss_PrintProcessorInfo1_get_print_processor_name,
		.set = py_spoolss_PrintProcessorInfo1_set_print_processor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrintProcessorInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrintProcessorInfo1, type);
}

static PyObject *py_spoolss_PrintProcessorInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrintProcessorInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrintProcessorInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcessorInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcessorInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcessorInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrintProcessorInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcessorInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcessorInfo1, "spoolss_PrintProcessorInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcessorInfo1, "spoolss_PrintProcessorInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrintProcessorInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrintProcessorInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrintProcessorInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcessorInfo1",
	.tp_getset = py_spoolss_PrintProcessorInfo1_getsetters,
	.tp_methods = py_spoolss_PrintProcessorInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcessorInfo1_new,
};

static PyObject *py_import_spoolss_PrintProcessorInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_PrintProcessorInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_PrintProcessorInfo1_Type, mem_ctx, &in->info1);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrintProcessorInfo *py_export_spoolss_PrintProcessorInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrintProcessorInfo *ret = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrintProcessorInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PrintProcessorInfo1 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PrintProcessorInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrintProcessorInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrintProcessorInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrintProcessorInfo!");
		return NULL;
	}

	return py_import_spoolss_PrintProcessorInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrintProcessorInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrintProcessorInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrintProcessorInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrintProcessorInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrintProcessorInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrintProcessorInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcessorInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrintProcessorInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcessorInfo_new,
};


static PyObject *py_spoolss_PrintProcessorDirectoryInfo1_get_directory_name(PyObject *obj, void *closure)
{
	struct spoolss_PrintProcessorDirectoryInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_directory_name;
	py_directory_name = PyString_FromStringOrNULL(object->directory_name);
	return py_directory_name;
}

static int py_spoolss_PrintProcessorDirectoryInfo1_set_directory_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintProcessorDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->directory_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->directory_name = talloc_str;
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrintProcessorDirectoryInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "directory_name"),
		.get = py_spoolss_PrintProcessorDirectoryInfo1_get_directory_name,
		.set = py_spoolss_PrintProcessorDirectoryInfo1_set_directory_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrintProcessorDirectoryInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrintProcessorDirectoryInfo1, type);
}

static PyObject *py_spoolss_PrintProcessorDirectoryInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrintProcessorDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorDirectoryInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrintProcessorDirectoryInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcessorDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcessorDirectoryInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcessorDirectoryInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrintProcessorDirectoryInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcessorDirectoryInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcessorDirectoryInfo1, "spoolss_PrintProcessorDirectoryInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcessorDirectoryInfo1, "spoolss_PrintProcessorDirectoryInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrintProcessorDirectoryInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrintProcessorDirectoryInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorDirectoryInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorDirectoryInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrintProcessorDirectoryInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcessorDirectoryInfo1",
	.tp_getset = py_spoolss_PrintProcessorDirectoryInfo1_getsetters,
	.tp_methods = py_spoolss_PrintProcessorDirectoryInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcessorDirectoryInfo1_new,
};

static PyObject *py_import_spoolss_PrintProcessorDirectoryInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_PrintProcessorDirectoryInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_PrintProcessorDirectoryInfo1_Type, mem_ctx, &in->info1);
			return ret;

		default:
			ret = pytalloc_reference_ex(&spoolss_PrintProcessorDirectoryInfo1_Type, mem_ctx, &in->info1);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrintProcessorDirectoryInfo *py_export_spoolss_PrintProcessorDirectoryInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrintProcessorDirectoryInfo *ret = talloc_zero(mem_ctx, union spoolss_PrintProcessorDirectoryInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrintProcessorDirectoryInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PrintProcessorDirectoryInfo1 *)pytalloc_get_ptr(in);
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrintProcessorDirectoryInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PrintProcessorDirectoryInfo1 *)pytalloc_get_ptr(in);
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PrintProcessorDirectoryInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrintProcessorDirectoryInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrintProcessorDirectoryInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrintProcessorDirectoryInfo!");
		return NULL;
	}

	return py_import_spoolss_PrintProcessorDirectoryInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrintProcessorDirectoryInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrintProcessorDirectoryInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrintProcessorDirectoryInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrintProcessorDirectoryInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorDirectoryInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcessorDirectoryInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrintProcessorDirectoryInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrintProcessorDirectoryInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcessorDirectoryInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrintProcessorDirectoryInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcessorDirectoryInfo_new,
};


static PyObject *py_spoolss_DocumentInfo1_get_document_name(PyObject *obj, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_document_name;
	if (object->document_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->document_name == NULL) {
		py_document_name = Py_None;
		Py_INCREF(py_document_name);
	} else {
		if (object->document_name == NULL) {
			py_document_name = Py_None;
			Py_INCREF(py_document_name);
		} else {
			py_document_name = PyUnicode_Decode(object->document_name, strlen(object->document_name), "utf-8", "ignore");
		}
	}
	return py_document_name;
}

static int py_spoolss_DocumentInfo1_set_document_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->document_name");
		return -1;
	}
	if (value == Py_None) {
		object->document_name = NULL;
	} else {
		object->document_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->document_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DocumentInfo1_get_output_file(PyObject *obj, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_output_file;
	if (object->output_file == NULL) {
		Py_RETURN_NONE;
	}
	if (object->output_file == NULL) {
		py_output_file = Py_None;
		Py_INCREF(py_output_file);
	} else {
		if (object->output_file == NULL) {
			py_output_file = Py_None;
			Py_INCREF(py_output_file);
		} else {
			py_output_file = PyUnicode_Decode(object->output_file, strlen(object->output_file), "utf-8", "ignore");
		}
	}
	return py_output_file;
}

static int py_spoolss_DocumentInfo1_set_output_file(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->output_file");
		return -1;
	}
	if (value == Py_None) {
		object->output_file = NULL;
	} else {
		object->output_file = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->output_file = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DocumentInfo1_get_datatype(PyObject *obj, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_datatype;
	if (object->datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->datatype == NULL) {
		py_datatype = Py_None;
		Py_INCREF(py_datatype);
	} else {
		if (object->datatype == NULL) {
			py_datatype = Py_None;
			Py_INCREF(py_datatype);
		} else {
			py_datatype = PyUnicode_Decode(object->datatype, strlen(object->datatype), "utf-8", "ignore");
		}
	}
	return py_datatype;
}

static int py_spoolss_DocumentInfo1_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DocumentInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->datatype");
		return -1;
	}
	if (value == Py_None) {
		object->datatype = NULL;
	} else {
		object->datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->datatype = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_DocumentInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "document_name"),
		.get = py_spoolss_DocumentInfo1_get_document_name,
		.set = py_spoolss_DocumentInfo1_set_document_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "output_file"),
		.get = py_spoolss_DocumentInfo1_get_output_file,
		.set = py_spoolss_DocumentInfo1_set_output_file,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "datatype"),
		.get = py_spoolss_DocumentInfo1_get_datatype,
		.set = py_spoolss_DocumentInfo1_set_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DocumentInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DocumentInfo1, type);
}


static PyTypeObject spoolss_DocumentInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DocumentInfo1",
	.tp_getset = py_spoolss_DocumentInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DocumentInfo1_new,
};

static PyObject *py_import_spoolss_DocumentInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_DocumentInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_DocumentInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

		case 3:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_DocumentInfo *py_export_spoolss_DocumentInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_DocumentInfo *ret = talloc_zero(mem_ctx, union spoolss_DocumentInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_DocumentInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_DocumentInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			break;

		case 3:
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_DocumentInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_DocumentInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_DocumentInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_DocumentInfo!");
		return NULL;
	}

	return py_import_spoolss_DocumentInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_DocumentInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_DocumentInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_DocumentInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_DocumentInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DocumentInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DocumentInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_DocumentInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_DocumentInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DocumentInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_DocumentInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DocumentInfo_new,
};


static PyObject *py_spoolss_DocumentInfoCtr_get_level(PyObject *obj, void *closure)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_DocumentInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DocumentInfoCtr_get_info(PyObject *obj, void *closure)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_DocumentInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_DocumentInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_DocumentInfoCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_DocumentInfo *info_switch_0;
		info_switch_0 = (union spoolss_DocumentInfo *)pyrpc_export_union(&spoolss_DocumentInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_DocumentInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_DocumentInfoCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_DocumentInfoCtr_get_level,
		.set = py_spoolss_DocumentInfoCtr_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_DocumentInfoCtr_get_info,
		.set = py_spoolss_DocumentInfoCtr_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DocumentInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DocumentInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_DocumentInfoCtr, type);
}

static PyObject *py_spoolss_DocumentInfoCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_DocumentInfoCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_DocumentInfoCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DocumentInfoCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_DocumentInfoCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DocumentInfoCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_DocumentInfoCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DocumentInfoCtr, "spoolss_DocumentInfoCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_DocumentInfoCtr, "spoolss_DocumentInfoCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_DocumentInfoCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_DocumentInfoCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DocumentInfoCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DocumentInfoCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DocumentInfoCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DocumentInfoCtr",
	.tp_getset = py_spoolss_DocumentInfoCtr_getsetters,
	.tp_methods = py_spoolss_DocumentInfoCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DocumentInfoCtr_new,
};


static PyObject *py_spoolss_OSVersion_get__ndr_size(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size;
	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size));
	return py__ndr_size;
}

static int py_spoolss_OSVersion_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersion_get_major(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py_major;
	py_major = PyLong_FromUnsignedLongLong((uint32_t)(object->major));
	return py_major;
}

static int py_spoolss_OSVersion_set_major(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->major");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->major));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->major = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersion_get_minor(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py_minor;
	py_minor = PyLong_FromUnsignedLongLong((uint32_t)(object->minor));
	return py_minor;
}

static int py_spoolss_OSVersion_set_minor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->minor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersion_get_build(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py_build;
	py_build = PyLong_FromUnsignedLongLong((uint32_t)(object->build));
	return py_build;
}

static int py_spoolss_OSVersion_set_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersion_get_platform_id(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py_platform_id;
	py_platform_id = PyLong_FromUnsignedLongLong((uint32_t)(object->platform_id));
	return py_platform_id;
}

static int py_spoolss_OSVersion_set_platform_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->platform_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->platform_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->platform_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersion_get_extra_string(PyObject *obj, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(obj);
	PyObject *py_extra_string;
	py_extra_string = PyString_FromStringOrNULL(object->extra_string);
	return py_extra_string;
}

static int py_spoolss_OSVersion_set_extra_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->extra_string");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->extra_string = talloc_str;
	}
	return 0;
}

static PyGetSetDef py_spoolss_OSVersion_getsetters[] = {
	{
		.name = discard_const_p(char, "_ndr_size"),
		.get = py_spoolss_OSVersion_get__ndr_size,
		.set = py_spoolss_OSVersion_set__ndr_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "major"),
		.get = py_spoolss_OSVersion_get_major,
		.set = py_spoolss_OSVersion_set_major,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "minor"),
		.get = py_spoolss_OSVersion_get_minor,
		.set = py_spoolss_OSVersion_set_minor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "build"),
		.get = py_spoolss_OSVersion_get_build,
		.set = py_spoolss_OSVersion_set_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "platform_id"),
		.get = py_spoolss_OSVersion_get_platform_id,
		.set = py_spoolss_OSVersion_set_platform_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "extra_string"),
		.get = py_spoolss_OSVersion_get_extra_string,
		.set = py_spoolss_OSVersion_set_extra_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_OSVersion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_OSVersion, type);
}

static PyObject *py_spoolss_OSVersion_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersion);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_OSVersion_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersion);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersion);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_OSVersion_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_OSVersion *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_OSVersion, "spoolss_OSVersion", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_OSVersion, "spoolss_OSVersion", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_OSVersion_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_OSVersion_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OSVersion_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OSVersion_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_OSVersion_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.OSVersion",
	.tp_getset = py_spoolss_OSVersion_getsetters,
	.tp_methods = py_spoolss_OSVersion_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_OSVersion_new,
};


static PyObject *py_spoolss_OSVersionEx_get__ndr_size(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size;
	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(object->_ndr_size));
	return py__ndr_size;
}

static int py_spoolss_OSVersionEx_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->_ndr_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->_ndr_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->_ndr_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_major(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_major;
	py_major = PyLong_FromUnsignedLongLong((uint32_t)(object->major));
	return py_major;
}

static int py_spoolss_OSVersionEx_set_major(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->major");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->major));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->major = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_minor(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_minor;
	py_minor = PyLong_FromUnsignedLongLong((uint32_t)(object->minor));
	return py_minor;
}

static int py_spoolss_OSVersionEx_set_minor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->minor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_build(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_build;
	py_build = PyLong_FromUnsignedLongLong((uint32_t)(object->build));
	return py_build;
}

static int py_spoolss_OSVersionEx_set_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_platform_id(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_platform_id;
	py_platform_id = PyLong_FromUnsignedLongLong((uint32_t)(object->platform_id));
	return py_platform_id;
}

static int py_spoolss_OSVersionEx_set_platform_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->platform_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->platform_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->platform_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_extra_string(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_extra_string;
	py_extra_string = PyString_FromStringOrNULL(object->extra_string);
	return py_extra_string;
}

static int py_spoolss_OSVersionEx_set_extra_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->extra_string");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->extra_string = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_service_pack_major(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_service_pack_major;
	py_service_pack_major = PyLong_FromLong((uint16_t)(object->service_pack_major));
	return py_service_pack_major;
}

static int py_spoolss_OSVersionEx_set_service_pack_major(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->service_pack_major");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_pack_major));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->service_pack_major = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_service_pack_minor(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_service_pack_minor;
	py_service_pack_minor = PyLong_FromLong((uint16_t)(object->service_pack_minor));
	return py_service_pack_minor;
}

static int py_spoolss_OSVersionEx_set_service_pack_minor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->service_pack_minor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->service_pack_minor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->service_pack_minor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_suite_mask(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_suite_mask;
	py_suite_mask = PyLong_FromLong((uint16_t)(object->suite_mask));
	return py_suite_mask;
}

static int py_spoolss_OSVersionEx_set_suite_mask(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->suite_mask");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->suite_mask));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->suite_mask = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_product_type(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_product_type;
	py_product_type = PyLong_FromLong((uint16_t)(object->product_type));
	return py_product_type;
}

static int py_spoolss_OSVersionEx_set_product_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->product_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->product_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->product_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OSVersionEx_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromLong((uint16_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_OSVersionEx_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_OSVersionEx_getsetters[] = {
	{
		.name = discard_const_p(char, "_ndr_size"),
		.get = py_spoolss_OSVersionEx_get__ndr_size,
		.set = py_spoolss_OSVersionEx_set__ndr_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "major"),
		.get = py_spoolss_OSVersionEx_get_major,
		.set = py_spoolss_OSVersionEx_set_major,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "minor"),
		.get = py_spoolss_OSVersionEx_get_minor,
		.set = py_spoolss_OSVersionEx_set_minor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "build"),
		.get = py_spoolss_OSVersionEx_get_build,
		.set = py_spoolss_OSVersionEx_set_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "platform_id"),
		.get = py_spoolss_OSVersionEx_get_platform_id,
		.set = py_spoolss_OSVersionEx_set_platform_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "extra_string"),
		.get = py_spoolss_OSVersionEx_get_extra_string,
		.set = py_spoolss_OSVersionEx_set_extra_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "service_pack_major"),
		.get = py_spoolss_OSVersionEx_get_service_pack_major,
		.set = py_spoolss_OSVersionEx_set_service_pack_major,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "service_pack_minor"),
		.get = py_spoolss_OSVersionEx_get_service_pack_minor,
		.set = py_spoolss_OSVersionEx_set_service_pack_minor,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "suite_mask"),
		.get = py_spoolss_OSVersionEx_get_suite_mask,
		.set = py_spoolss_OSVersionEx_set_suite_mask,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "product_type"),
		.get = py_spoolss_OSVersionEx_get_product_type,
		.set = py_spoolss_OSVersionEx_set_product_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_OSVersionEx_get_reserved,
		.set = py_spoolss_OSVersionEx_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_OSVersionEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_OSVersionEx, type);
}

static PyObject *py_spoolss_OSVersionEx_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_OSVersionEx_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersionEx);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersionEx);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_OSVersionEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_OSVersionEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_OSVersionEx, "spoolss_OSVersionEx", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_OSVersionEx, "spoolss_OSVersionEx", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_OSVersionEx_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_OSVersionEx_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OSVersionEx_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OSVersionEx_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_OSVersionEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.OSVersionEx",
	.tp_getset = py_spoolss_OSVersionEx_getsetters,
	.tp_methods = py_spoolss_OSVersionEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_OSVersionEx_new,
};

static PyObject *py_import_spoolss_PrinterData(TALLOC_CTX *mem_ctx, int level, union spoolss_PrinterData *in)
{
	PyObject *ret;

	switch (level) {
		case REG_NONE:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

		case REG_SZ:
			ret = PyString_FromStringOrNULL(in->string);
			return ret;

		case REG_BINARY:
			ret = PyBytes_FromStringAndSize((char *)(in->binary).data, (in->binary).length);
			return ret;

		case REG_DWORD:
			ret = PyLong_FromUnsignedLongLong((uint32_t)(in->value));
			return ret;

		case REG_MULTI_SZ:
			ret = pytalloc_GenericObject_reference_ex(mem_ctx, in->string_array);
			return ret;

		default:
			ret = PyBytes_FromStringAndSize((char *)(in->data).data, (in->data).length);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrinterData *py_export_spoolss_PrinterData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrinterData *ret = talloc_zero(mem_ctx, union spoolss_PrinterData);
	switch (level) {
		case REG_NONE:
			break;

		case REG_SZ:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->string");
				talloc_free(ret); return NULL;
			}
			{
				const char *test_str;
				const char *talloc_str;
				PyObject *unicode = NULL;
				if (PyUnicode_Check(in)) {
					unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
					if (unicode == NULL) {
						talloc_free(ret); return NULL;
					}
					test_str = PyBytes_AS_STRING(unicode);
				} else if (PyBytes_Check(in)) {
					test_str = PyBytes_AS_STRING(in);
				} else {
					PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
					talloc_free(ret); return NULL;
				}
				talloc_str = talloc_strdup(mem_ctx, test_str);
				if (unicode != NULL) {
					Py_DECREF(unicode);
				}
				if (talloc_str == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->string = talloc_str;
			}
			break;

		case REG_BINARY:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->binary");
				talloc_free(ret); return NULL;
			}
			if (!PyBytes_Check(in)) {
				PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(in)->tp_name);
				talloc_free(ret); return NULL;
			}
			ret->binary = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
			break;

		case REG_DWORD:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->value");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->value));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->value = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case REG_MULTI_SZ:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->string_array");
				talloc_free(ret); return NULL;
			}
			ret->string_array = pytalloc_get_ptr(in);
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->data");
				talloc_free(ret); return NULL;
			}
			if (!PyBytes_Check(in)) {
				PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(in)->tp_name);
				talloc_free(ret); return NULL;
			}
			ret->data = data_blob_talloc(mem_ctx, PyBytes_AS_STRING(in), PyBytes_GET_SIZE(in));
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PrinterData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrinterData *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrinterData *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrinterData!");
		return NULL;
	}

	return py_import_spoolss_PrinterData(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrinterData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrinterData *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrinterData(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrinterData_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterData_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterData_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrinterData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrinterData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterData",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrinterData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterData_new,
};


static PyObject *py_spoolss_FormSize_get_width(PyObject *obj, void *closure)
{
	struct spoolss_FormSize *object = pytalloc_get_ptr(obj);
	PyObject *py_width;
	py_width = PyLong_FromUnsignedLongLong((uint32_t)(object->width));
	return py_width;
}

static int py_spoolss_FormSize_set_width(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormSize *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->width");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->width));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->width = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormSize_get_height(PyObject *obj, void *closure)
{
	struct spoolss_FormSize *object = pytalloc_get_ptr(obj);
	PyObject *py_height;
	py_height = PyLong_FromUnsignedLongLong((uint32_t)(object->height));
	return py_height;
}

static int py_spoolss_FormSize_set_height(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormSize *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->height");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->height));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->height = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_FormSize_getsetters[] = {
	{
		.name = discard_const_p(char, "width"),
		.get = py_spoolss_FormSize_get_width,
		.set = py_spoolss_FormSize_set_width,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "height"),
		.get = py_spoolss_FormSize_get_height,
		.set = py_spoolss_FormSize_set_height,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_FormSize_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_FormSize, type);
}


static PyTypeObject spoolss_FormSize_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FormSize",
	.tp_getset = py_spoolss_FormSize_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FormSize_new,
};


static PyObject *py_spoolss_FormArea_get_left(PyObject *obj, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(obj);
	PyObject *py_left;
	py_left = PyLong_FromUnsignedLongLong((uint32_t)(object->left));
	return py_left;
}

static int py_spoolss_FormArea_set_left(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->left");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->left));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->left = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormArea_get_top(PyObject *obj, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(obj);
	PyObject *py_top;
	py_top = PyLong_FromUnsignedLongLong((uint32_t)(object->top));
	return py_top;
}

static int py_spoolss_FormArea_set_top(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->top");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->top));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->top = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormArea_get_right(PyObject *obj, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(obj);
	PyObject *py_right;
	py_right = PyLong_FromUnsignedLongLong((uint32_t)(object->right));
	return py_right;
}

static int py_spoolss_FormArea_set_right(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->right");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->right));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->right = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormArea_get_bottom(PyObject *obj, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(obj);
	PyObject *py_bottom;
	py_bottom = PyLong_FromUnsignedLongLong((uint32_t)(object->bottom));
	return py_bottom;
}

static int py_spoolss_FormArea_set_bottom(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormArea *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->bottom");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->bottom));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->bottom = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_FormArea_getsetters[] = {
	{
		.name = discard_const_p(char, "left"),
		.get = py_spoolss_FormArea_get_left,
		.set = py_spoolss_FormArea_set_left,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "top"),
		.get = py_spoolss_FormArea_get_top,
		.set = py_spoolss_FormArea_set_top,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "right"),
		.get = py_spoolss_FormArea_get_right,
		.set = py_spoolss_FormArea_set_right,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "bottom"),
		.get = py_spoolss_FormArea_get_bottom,
		.set = py_spoolss_FormArea_set_bottom,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_FormArea_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_FormArea, type);
}


static PyTypeObject spoolss_FormArea_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FormArea",
	.tp_getset = py_spoolss_FormArea_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FormArea_new,
};


static PyObject *py_spoolss_FormInfo1_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_FormInfo1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo1_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->form_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		py_form_name = PyString_FromStringOrNULL(object->form_name);
	}
	return py_form_name;
}

static int py_spoolss_FormInfo1_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->form_name");
		return -1;
	}
	if (value == Py_None) {
		object->form_name = NULL;
	} else {
		object->form_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->form_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo1_get_size(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = pytalloc_reference_ex(&spoolss_FormSize_Type, pytalloc_get_mem_ctx(obj), &object->size);
	return py_size;
}

static int py_spoolss_FormInfo1_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormSize_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->size = *(struct spoolss_FormSize *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_FormInfo1_get_area(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_area;
	py_area = pytalloc_reference_ex(&spoolss_FormArea_Type, pytalloc_get_mem_ctx(obj), &object->area);
	return py_area;
}

static int py_spoolss_FormInfo1_set_area(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->area");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormArea_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->area = *(struct spoolss_FormArea *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_FormInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_FormInfo1_get_flags,
		.set = py_spoolss_FormInfo1_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormFlags")
	},
	{
		.name = discard_const_p(char, "form_name"),
		.get = py_spoolss_FormInfo1_get_form_name,
		.set = py_spoolss_FormInfo1_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_FormInfo1_get_size,
		.set = py_spoolss_FormInfo1_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormSize")
	},
	{
		.name = discard_const_p(char, "area"),
		.get = py_spoolss_FormInfo1_get_area,
		.set = py_spoolss_FormInfo1_set_area,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormArea")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_FormInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_FormInfo1, type);
}

static PyObject *py_spoolss_FormInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_FormInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_FormInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_FormInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_FormInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_FormInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_FormInfo1, "spoolss_FormInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_FormInfo1, "spoolss_FormInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_FormInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_FormInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_FormInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FormInfo1",
	.tp_getset = py_spoolss_FormInfo1_getsetters,
	.tp_methods = py_spoolss_FormInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FormInfo1_new,
};


static PyObject *py_spoolss_FormInfo2_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_FormInfo2_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->form_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		py_form_name = PyString_FromStringOrNULL(object->form_name);
	}
	return py_form_name;
}

static int py_spoolss_FormInfo2_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->form_name");
		return -1;
	}
	if (value == Py_None) {
		object->form_name = NULL;
	} else {
		object->form_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->form_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_size(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = pytalloc_reference_ex(&spoolss_FormSize_Type, pytalloc_get_mem_ctx(obj), &object->size);
	return py_size;
}

static int py_spoolss_FormInfo2_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormSize_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->size = *(struct spoolss_FormSize *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_area(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_area;
	py_area = pytalloc_reference_ex(&spoolss_FormArea_Type, pytalloc_get_mem_ctx(obj), &object->area);
	return py_area;
}

static int py_spoolss_FormInfo2_set_area(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->area");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormArea_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->area = *(struct spoolss_FormArea *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_keyword(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_keyword;
	if (object->keyword == NULL) {
		Py_RETURN_NONE;
	}
	if (object->keyword == NULL) {
		py_keyword = Py_None;
		Py_INCREF(py_keyword);
	} else {
		py_keyword = PyString_FromStringOrNULL(object->keyword);
	}
	return py_keyword;
}

static int py_spoolss_FormInfo2_set_keyword(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->keyword");
		return -1;
	}
	if (value == Py_None) {
		object->keyword = NULL;
	} else {
		object->keyword = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->keyword = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_string_type(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_string_type;
	py_string_type = PyLong_FromUnsignedLongLong((uint32_t)(object->string_type));
	return py_string_type;
}

static int py_spoolss_FormInfo2_set_string_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->string_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->string_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_mui_dll(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_mui_dll;
	if (object->mui_dll == NULL) {
		Py_RETURN_NONE;
	}
	if (object->mui_dll == NULL) {
		py_mui_dll = Py_None;
		Py_INCREF(py_mui_dll);
	} else {
		py_mui_dll = PyString_FromStringOrNULL(object->mui_dll);
	}
	return py_mui_dll;
}

static int py_spoolss_FormInfo2_set_mui_dll(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mui_dll");
		return -1;
	}
	if (value == Py_None) {
		object->mui_dll = NULL;
	} else {
		object->mui_dll = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->mui_dll = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_ressource_id(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_ressource_id;
	py_ressource_id = PyLong_FromUnsignedLongLong((uint32_t)(object->ressource_id));
	return py_ressource_id;
}

static int py_spoolss_FormInfo2_set_ressource_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ressource_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ressource_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ressource_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_display_name(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_display_name;
	if (object->display_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->display_name == NULL) {
		py_display_name = Py_None;
		Py_INCREF(py_display_name);
	} else {
		py_display_name = PyString_FromStringOrNULL(object->display_name);
	}
	return py_display_name;
}

static int py_spoolss_FormInfo2_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->display_name");
		return -1;
	}
	if (value == Py_None) {
		object->display_name = NULL;
	} else {
		object->display_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->display_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_lang_id(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_lang_id;
	py_lang_id = PyLong_FromLong((uint16_t)(object->lang_id));
	return py_lang_id;
}

static int py_spoolss_FormInfo2_set_lang_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lang_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lang_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->lang_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_FormInfo2_get_unused(PyObject *obj, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_unused;
	py_unused = PyLong_FromLong((uint16_t)(object->unused));
	return py_unused;
}

static int py_spoolss_FormInfo2_set_unused(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->unused");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->unused));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->unused = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_FormInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_FormInfo2_get_flags,
		.set = py_spoolss_FormInfo2_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormFlags")
	},
	{
		.name = discard_const_p(char, "form_name"),
		.get = py_spoolss_FormInfo2_get_form_name,
		.set = py_spoolss_FormInfo2_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_FormInfo2_get_size,
		.set = py_spoolss_FormInfo2_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormSize")
	},
	{
		.name = discard_const_p(char, "area"),
		.get = py_spoolss_FormInfo2_get_area,
		.set = py_spoolss_FormInfo2_set_area,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormArea")
	},
	{
		.name = discard_const_p(char, "keyword"),
		.get = py_spoolss_FormInfo2_get_keyword,
		.set = py_spoolss_FormInfo2_set_keyword,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "string_type"),
		.get = py_spoolss_FormInfo2_get_string_type,
		.set = py_spoolss_FormInfo2_set_string_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormStringType")
	},
	{
		.name = discard_const_p(char, "mui_dll"),
		.get = py_spoolss_FormInfo2_get_mui_dll,
		.set = py_spoolss_FormInfo2_set_mui_dll,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "ressource_id"),
		.get = py_spoolss_FormInfo2_get_ressource_id,
		.set = py_spoolss_FormInfo2_set_ressource_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "display_name"),
		.get = py_spoolss_FormInfo2_get_display_name,
		.set = py_spoolss_FormInfo2_set_display_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "lang_id"),
		.get = py_spoolss_FormInfo2_get_lang_id,
		.set = py_spoolss_FormInfo2_set_lang_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "unused"),
		.get = py_spoolss_FormInfo2_get_unused,
		.set = py_spoolss_FormInfo2_set_unused,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_FormInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_FormInfo2, type);
}

static PyObject *py_spoolss_FormInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_FormInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_FormInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_FormInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_FormInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_FormInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_FormInfo2, "spoolss_FormInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_FormInfo2, "spoolss_FormInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_FormInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_FormInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_FormInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FormInfo2",
	.tp_getset = py_spoolss_FormInfo2_getsetters,
	.tp_methods = py_spoolss_FormInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FormInfo2_new,
};

static PyObject *py_import_spoolss_FormInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_FormInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_FormInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_FormInfo2_Type, mem_ctx, &in->info2);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_FormInfo *py_export_spoolss_FormInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_FormInfo *ret = talloc_zero(mem_ctx, union spoolss_FormInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_FormInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_FormInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_FormInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_FormInfo2 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_FormInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_FormInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_FormInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_FormInfo!");
		return NULL;
	}

	return py_import_spoolss_FormInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_FormInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_FormInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_FormInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_FormInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FormInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_FormInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_FormInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FormInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_FormInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FormInfo_new,
};


static PyObject *py_spoolss_AddFormInfo1_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_AddFormInfo1_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo1_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->form_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		if (object->form_name == NULL) {
			py_form_name = Py_None;
			Py_INCREF(py_form_name);
		} else {
			py_form_name = PyUnicode_Decode(object->form_name, strlen(object->form_name), "utf-8", "ignore");
		}
	}
	return py_form_name;
}

static int py_spoolss_AddFormInfo1_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->form_name");
		return -1;
	}
	if (value == Py_None) {
		object->form_name = NULL;
	} else {
		object->form_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->form_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo1_get_size(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = pytalloc_reference_ex(&spoolss_FormSize_Type, pytalloc_get_mem_ctx(obj), &object->size);
	return py_size;
}

static int py_spoolss_AddFormInfo1_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormSize_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->size = *(struct spoolss_FormSize *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddFormInfo1_get_area(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_area;
	py_area = pytalloc_reference_ex(&spoolss_FormArea_Type, pytalloc_get_mem_ctx(obj), &object->area);
	return py_area;
}

static int py_spoolss_AddFormInfo1_set_area(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->area");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormArea_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->area = *(struct spoolss_FormArea *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_AddFormInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_AddFormInfo1_get_flags,
		.set = py_spoolss_AddFormInfo1_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormFlags")
	},
	{
		.name = discard_const_p(char, "form_name"),
		.get = py_spoolss_AddFormInfo1_get_form_name,
		.set = py_spoolss_AddFormInfo1_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_AddFormInfo1_get_size,
		.set = py_spoolss_AddFormInfo1_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormSize")
	},
	{
		.name = discard_const_p(char, "area"),
		.get = py_spoolss_AddFormInfo1_get_area,
		.set = py_spoolss_AddFormInfo1_set_area,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormArea")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddFormInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddFormInfo1, type);
}


static PyTypeObject spoolss_AddFormInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddFormInfo1",
	.tp_getset = py_spoolss_AddFormInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddFormInfo1_new,
};


static PyObject *py_spoolss_AddFormInfo2_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_AddFormInfo2_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->form_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		if (object->form_name == NULL) {
			py_form_name = Py_None;
			Py_INCREF(py_form_name);
		} else {
			py_form_name = PyUnicode_Decode(object->form_name, strlen(object->form_name), "utf-8", "ignore");
		}
	}
	return py_form_name;
}

static int py_spoolss_AddFormInfo2_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->form_name");
		return -1;
	}
	if (value == Py_None) {
		object->form_name = NULL;
	} else {
		object->form_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->form_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_size(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = pytalloc_reference_ex(&spoolss_FormSize_Type, pytalloc_get_mem_ctx(obj), &object->size);
	return py_size;
}

static int py_spoolss_AddFormInfo2_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormSize_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->size = *(struct spoolss_FormSize *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_area(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_area;
	py_area = pytalloc_reference_ex(&spoolss_FormArea_Type, pytalloc_get_mem_ctx(obj), &object->area);
	return py_area;
}

static int py_spoolss_AddFormInfo2_set_area(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->area");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_FormArea_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->area = *(struct spoolss_FormArea *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_keyword(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_keyword;
	if (object->keyword == NULL) {
		Py_RETURN_NONE;
	}
	if (object->keyword == NULL) {
		py_keyword = Py_None;
		Py_INCREF(py_keyword);
	} else {
		if (object->keyword == NULL) {
			py_keyword = Py_None;
			Py_INCREF(py_keyword);
		} else {
			py_keyword = PyUnicode_Decode(object->keyword, strlen(object->keyword), "utf-8", "ignore");
		}
	}
	return py_keyword;
}

static int py_spoolss_AddFormInfo2_set_keyword(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->keyword");
		return -1;
	}
	if (value == Py_None) {
		object->keyword = NULL;
	} else {
		object->keyword = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->keyword = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_string_type(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_string_type;
	py_string_type = PyLong_FromUnsignedLongLong((uint32_t)(object->string_type));
	return py_string_type;
}

static int py_spoolss_AddFormInfo2_set_string_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->string_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->string_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_mui_dll(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_mui_dll;
	if (object->mui_dll == NULL) {
		Py_RETURN_NONE;
	}
	if (object->mui_dll == NULL) {
		py_mui_dll = Py_None;
		Py_INCREF(py_mui_dll);
	} else {
		if (object->mui_dll == NULL) {
			py_mui_dll = Py_None;
			Py_INCREF(py_mui_dll);
		} else {
			py_mui_dll = PyUnicode_Decode(object->mui_dll, strlen(object->mui_dll), "utf-8", "ignore");
		}
	}
	return py_mui_dll;
}

static int py_spoolss_AddFormInfo2_set_mui_dll(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->mui_dll");
		return -1;
	}
	if (value == Py_None) {
		object->mui_dll = NULL;
	} else {
		object->mui_dll = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->mui_dll = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_ressource_id(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_ressource_id;
	py_ressource_id = PyLong_FromUnsignedLongLong((uint32_t)(object->ressource_id));
	return py_ressource_id;
}

static int py_spoolss_AddFormInfo2_set_ressource_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ressource_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ressource_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ressource_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_display_name(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_display_name;
	if (object->display_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->display_name == NULL) {
		py_display_name = Py_None;
		Py_INCREF(py_display_name);
	} else {
		if (object->display_name == NULL) {
			py_display_name = Py_None;
			Py_INCREF(py_display_name);
		} else {
			py_display_name = PyUnicode_Decode(object->display_name, strlen(object->display_name), "utf-8", "ignore");
		}
	}
	return py_display_name;
}

static int py_spoolss_AddFormInfo2_set_display_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->display_name");
		return -1;
	}
	if (value == Py_None) {
		object->display_name = NULL;
	} else {
		object->display_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->display_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfo2_get_lang_id(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_lang_id;
	py_lang_id = PyLong_FromUnsignedLongLong((uint32_t)(object->lang_id));
	return py_lang_id;
}

static int py_spoolss_AddFormInfo2_set_lang_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->lang_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->lang_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->lang_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddFormInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_AddFormInfo2_get_flags,
		.set = py_spoolss_AddFormInfo2_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormFlags")
	},
	{
		.name = discard_const_p(char, "form_name"),
		.get = py_spoolss_AddFormInfo2_get_form_name,
		.set = py_spoolss_AddFormInfo2_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_AddFormInfo2_get_size,
		.set = py_spoolss_AddFormInfo2_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormSize")
	},
	{
		.name = discard_const_p(char, "area"),
		.get = py_spoolss_AddFormInfo2_get_area,
		.set = py_spoolss_AddFormInfo2_set_area,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormArea")
	},
	{
		.name = discard_const_p(char, "keyword"),
		.get = py_spoolss_AddFormInfo2_get_keyword,
		.set = py_spoolss_AddFormInfo2_set_keyword,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "string_type"),
		.get = py_spoolss_AddFormInfo2_get_string_type,
		.set = py_spoolss_AddFormInfo2_set_string_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormStringType")
	},
	{
		.name = discard_const_p(char, "mui_dll"),
		.get = py_spoolss_AddFormInfo2_get_mui_dll,
		.set = py_spoolss_AddFormInfo2_set_mui_dll,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ressource_id"),
		.get = py_spoolss_AddFormInfo2_get_ressource_id,
		.set = py_spoolss_AddFormInfo2_set_ressource_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "display_name"),
		.get = py_spoolss_AddFormInfo2_get_display_name,
		.set = py_spoolss_AddFormInfo2_set_display_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "lang_id"),
		.get = py_spoolss_AddFormInfo2_get_lang_id,
		.set = py_spoolss_AddFormInfo2_set_lang_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddFormInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddFormInfo2, type);
}


static PyTypeObject spoolss_AddFormInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddFormInfo2",
	.tp_getset = py_spoolss_AddFormInfo2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddFormInfo2_new,
};

static PyObject *py_import_spoolss_AddFormInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_AddFormInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddFormInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddFormInfo2_Type, in->info2, in->info2);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_AddFormInfo *py_export_spoolss_AddFormInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_AddFormInfo *ret = talloc_zero(mem_ctx, union spoolss_AddFormInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_AddFormInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_AddFormInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_AddFormInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_AddFormInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_AddFormInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_AddFormInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_AddFormInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_AddFormInfo!");
		return NULL;
	}

	return py_import_spoolss_AddFormInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_AddFormInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_AddFormInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_AddFormInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_AddFormInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddFormInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddFormInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_AddFormInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_AddFormInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddFormInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_AddFormInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddFormInfo_new,
};


static PyObject *py_spoolss_AddFormInfoCtr_get_level(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_AddFormInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddFormInfoCtr_get_info(PyObject *obj, void *closure)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_AddFormInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_AddFormInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_AddFormInfoCtr_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_AddFormInfo *info_switch_0;
		info_switch_0 = (union spoolss_AddFormInfo *)pyrpc_export_union(&spoolss_AddFormInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_AddFormInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddFormInfoCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_AddFormInfoCtr_get_level,
		.set = py_spoolss_AddFormInfoCtr_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_AddFormInfoCtr_get_info,
		.set = py_spoolss_AddFormInfoCtr_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddFormInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddFormInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddFormInfoCtr, type);
}

static PyObject *py_spoolss_AddFormInfoCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_AddFormInfoCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_AddFormInfoCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_AddFormInfoCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_AddFormInfoCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddFormInfoCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_AddFormInfoCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_AddFormInfoCtr, "spoolss_AddFormInfoCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_AddFormInfoCtr, "spoolss_AddFormInfoCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_AddFormInfoCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_AddFormInfoCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddFormInfoCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddFormInfoCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddFormInfoCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddFormInfoCtr",
	.tp_getset = py_spoolss_AddFormInfoCtr_getsetters,
	.tp_methods = py_spoolss_AddFormInfoCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddFormInfoCtr_new,
};


static PyObject *py_spoolss_PortInfo1_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		py_port_name = PyString_FromStringOrNULL(object->port_name);
	}
	return py_port_name;
}

static int py_spoolss_PortInfo1_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_PortInfo1_get_port_name,
		.set = py_spoolss_PortInfo1_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortInfo1, type);
}

static PyObject *py_spoolss_PortInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo1, "spoolss_PortInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo1, "spoolss_PortInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortInfo1",
	.tp_getset = py_spoolss_PortInfo1_getsetters,
	.tp_methods = py_spoolss_PortInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortInfo1_new,
};


static PyObject *py_spoolss_PortInfo2_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		py_port_name = PyString_FromStringOrNULL(object->port_name);
	}
	return py_port_name;
}

static int py_spoolss_PortInfo2_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo2_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_PortInfo2_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo2_get_description(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_description;
	if (object->description == NULL) {
		Py_RETURN_NONE;
	}
	if (object->description == NULL) {
		py_description = Py_None;
		Py_INCREF(py_description);
	} else {
		py_description = PyString_FromStringOrNULL(object->description);
	}
	return py_description;
}

static int py_spoolss_PortInfo2_set_description(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->description");
		return -1;
	}
	if (value == Py_None) {
		object->description = NULL;
	} else {
		object->description = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->description = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo2_get_port_type(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_type;
	py_port_type = PyLong_FromUnsignedLongLong((uint32_t)(object->port_type));
	return py_port_type;
}

static int py_spoolss_PortInfo2_set_port_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->port_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo2_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_PortInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_PortInfo2_get_port_name,
		.set = py_spoolss_PortInfo2_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_PortInfo2_get_monitor_name,
		.set = py_spoolss_PortInfo2_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "description"),
		.get = py_spoolss_PortInfo2_get_description,
		.set = py_spoolss_PortInfo2_set_description,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "port_type"),
		.get = py_spoolss_PortInfo2_get_port_type,
		.set = py_spoolss_PortInfo2_set_port_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortType")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_PortInfo2_get_reserved,
		.set = py_spoolss_PortInfo2_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortInfo2, type);
}

static PyObject *py_spoolss_PortInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo2, "spoolss_PortInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo2, "spoolss_PortInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortInfo2",
	.tp_getset = py_spoolss_PortInfo2_getsetters,
	.tp_methods = py_spoolss_PortInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortInfo2_new,
};


static PyObject *py_spoolss_PortInfo3_get_status(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_PortInfo3_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo3_get_status_string(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_status_string;
	if (object->status_string == NULL) {
		Py_RETURN_NONE;
	}
	if (object->status_string == NULL) {
		py_status_string = Py_None;
		Py_INCREF(py_status_string);
	} else {
		py_status_string = PyString_FromStringOrNULL(object->status_string);
	}
	return py_status_string;
}

static int py_spoolss_PortInfo3_set_status_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status_string");
		return -1;
	}
	if (value == Py_None) {
		object->status_string = NULL;
	} else {
		object->status_string = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->status_string = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfo3_get_severity(PyObject *obj, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_severity;
	py_severity = PyLong_FromUnsignedLongLong((uint32_t)(object->severity));
	return py_severity;
}

static int py_spoolss_PortInfo3_set_severity(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->severity");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->severity));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->severity = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_PortInfo3_get_status,
		.set = py_spoolss_PortInfo3_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortStatus")
	},
	{
		.name = discard_const_p(char, "status_string"),
		.get = py_spoolss_PortInfo3_get_status_string,
		.set = py_spoolss_PortInfo3_set_status_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "severity"),
		.get = py_spoolss_PortInfo3_get_severity,
		.set = py_spoolss_PortInfo3_set_severity,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortSeverity")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortInfo3, type);
}

static PyObject *py_spoolss_PortInfo3_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo3);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo3);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfo3);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortInfo3_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfo3 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo3, "spoolss_PortInfo3", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfo3, "spoolss_PortInfo3", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortInfo3_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo3_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortInfo3",
	.tp_getset = py_spoolss_PortInfo3_getsetters,
	.tp_methods = py_spoolss_PortInfo3_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortInfo3_new,
};


static PyObject *py_spoolss_PortInfoFF_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		py_port_name = PyString_FromStringOrNULL(object->port_name);
	}
	return py_port_name;
}

static int py_spoolss_PortInfoFF_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortInfoFF_get_monitor_data(PyObject *obj, void *closure)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_data;
	py_monitor_data = PyBytes_FromStringAndSize((char *)(object->monitor_data).data, (object->monitor_data).length);
	return py_monitor_data;
}

static int py_spoolss_PortInfoFF_set_monitor_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->monitor_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyGetSetDef py_spoolss_PortInfoFF_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_PortInfoFF_get_port_name,
		.set = py_spoolss_PortInfoFF_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "monitor_data"),
		.get = py_spoolss_PortInfoFF_get_monitor_data,
		.set = py_spoolss_PortInfoFF_set_monitor_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortInfoFF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortInfoFF, type);
}

static PyObject *py_spoolss_PortInfoFF_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfoFF);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortInfoFF_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfoFF);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortInfoFF);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortInfoFF_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortInfoFF *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfoFF, "spoolss_PortInfoFF", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortInfoFF, "spoolss_PortInfoFF", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortInfoFF_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortInfoFF_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfoFF_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfoFF_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortInfoFF_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortInfoFF",
	.tp_getset = py_spoolss_PortInfoFF_getsetters,
	.tp_methods = py_spoolss_PortInfoFF_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortInfoFF_new,
};

static PyObject *py_import_spoolss_PortInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_PortInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_PortInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_PortInfo2_Type, mem_ctx, &in->info2);
			return ret;

		case 3:
			ret = pytalloc_reference_ex(&spoolss_PortInfo3_Type, mem_ctx, &in->info3);
			return ret;

		case 0xff:
			ret = pytalloc_reference_ex(&spoolss_PortInfoFF_Type, mem_ctx, &in->infoFF);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PortInfo *py_export_spoolss_PortInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PortInfo *ret = talloc_zero(mem_ctx, union spoolss_PortInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PortInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PortInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PortInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_PortInfo2 *)pytalloc_get_ptr(in);
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PortInfo3_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info3 = *(struct spoolss_PortInfo3 *)pytalloc_get_ptr(in);
			break;

		case 0xff:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->infoFF");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PortInfoFF_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->infoFF = *(struct spoolss_PortInfoFF *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PortInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PortInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PortInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PortInfo!");
		return NULL;
	}

	return py_import_spoolss_PortInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_PortInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PortInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PortInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PortInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PortInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PortInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PortInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortInfo_new,
};


static PyObject *py_spoolss_MonitorInfo1_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_MonitorInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_MonitorInfo1_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_MonitorInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_MonitorInfo1_get_monitor_name,
		.set = py_spoolss_MonitorInfo1_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_MonitorInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_MonitorInfo1, type);
}

static PyObject *py_spoolss_MonitorInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_MonitorInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_MonitorInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_MonitorInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorInfo1, "spoolss_MonitorInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorInfo1, "spoolss_MonitorInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_MonitorInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_MonitorInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_MonitorInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.MonitorInfo1",
	.tp_getset = py_spoolss_MonitorInfo1_getsetters,
	.tp_methods = py_spoolss_MonitorInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_MonitorInfo1_new,
};


static PyObject *py_spoolss_MonitorInfo2_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyString_FromStringOrNULL(object->monitor_name);
	}
	return py_monitor_name;
}

static int py_spoolss_MonitorInfo2_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_MonitorInfo2_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		py_environment = PyString_FromStringOrNULL(object->environment);
	}
	return py_environment;
}

static int py_spoolss_MonitorInfo2_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->environment");
		return -1;
	}
	if (value == Py_None) {
		object->environment = NULL;
	} else {
		object->environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_MonitorInfo2_get_dll_name(PyObject *obj, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_dll_name;
	if (object->dll_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dll_name == NULL) {
		py_dll_name = Py_None;
		Py_INCREF(py_dll_name);
	} else {
		py_dll_name = PyString_FromStringOrNULL(object->dll_name);
	}
	return py_dll_name;
}

static int py_spoolss_MonitorInfo2_set_dll_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dll_name");
		return -1;
	}
	if (value == Py_None) {
		object->dll_name = NULL;
	} else {
		object->dll_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->dll_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_MonitorInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_MonitorInfo2_get_monitor_name,
		.set = py_spoolss_MonitorInfo2_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "environment"),
		.get = py_spoolss_MonitorInfo2_get_environment,
		.set = py_spoolss_MonitorInfo2_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "dll_name"),
		.get = py_spoolss_MonitorInfo2_get_dll_name,
		.set = py_spoolss_MonitorInfo2_set_dll_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_MonitorInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_MonitorInfo2, type);
}

static PyObject *py_spoolss_MonitorInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_MonitorInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_MonitorInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorInfo2, "spoolss_MonitorInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorInfo2, "spoolss_MonitorInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_MonitorInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_MonitorInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_MonitorInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.MonitorInfo2",
	.tp_getset = py_spoolss_MonitorInfo2_getsetters,
	.tp_methods = py_spoolss_MonitorInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_MonitorInfo2_new,
};

static PyObject *py_import_spoolss_MonitorInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_MonitorInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_MonitorInfo1_Type, mem_ctx, &in->info1);
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_MonitorInfo2_Type, mem_ctx, &in->info2);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_MonitorInfo *py_export_spoolss_MonitorInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_MonitorInfo *ret = talloc_zero(mem_ctx, union spoolss_MonitorInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_MonitorInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_MonitorInfo1 *)pytalloc_get_ptr(in);
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_MonitorInfo2_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info2 = *(struct spoolss_MonitorInfo2 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_MonitorInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_MonitorInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_MonitorInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_MonitorInfo!");
		return NULL;
	}

	return py_import_spoolss_MonitorInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_MonitorInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_MonitorInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_MonitorInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_MonitorInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_MonitorInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_MonitorInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.MonitorInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_MonitorInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_MonitorInfo_new,
};


static PyObject *py_spoolss_SetPortInfo1_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		if (object->port_name == NULL) {
			py_port_name = Py_None;
			Py_INCREF(py_port_name);
		} else {
			py_port_name = PyUnicode_Decode(object->port_name, strlen(object->port_name), "utf-8", "ignore");
		}
	}
	return py_port_name;
}

static int py_spoolss_SetPortInfo1_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPortInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_SetPortInfo1_get_port_name,
		.set = py_spoolss_SetPortInfo1_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPortInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPortInfo1, type);
}

static PyObject *py_spoolss_SetPortInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPortInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPortInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPortInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPortInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo1, "spoolss_SetPortInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo1, "spoolss_SetPortInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPortInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPortInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPortInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfo1",
	.tp_getset = py_spoolss_SetPortInfo1_getsetters,
	.tp_methods = py_spoolss_SetPortInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfo1_new,
};


static PyObject *py_spoolss_SetPortInfo2_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		if (object->port_name == NULL) {
			py_port_name = Py_None;
			Py_INCREF(py_port_name);
		} else {
			py_port_name = PyUnicode_Decode(object->port_name, strlen(object->port_name), "utf-8", "ignore");
		}
	}
	return py_port_name;
}

static int py_spoolss_SetPortInfo2_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo2_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_SetPortInfo2_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo2_get_description(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_description;
	if (object->description == NULL) {
		Py_RETURN_NONE;
	}
	if (object->description == NULL) {
		py_description = Py_None;
		Py_INCREF(py_description);
	} else {
		if (object->description == NULL) {
			py_description = Py_None;
			Py_INCREF(py_description);
		} else {
			py_description = PyUnicode_Decode(object->description, strlen(object->description), "utf-8", "ignore");
		}
	}
	return py_description;
}

static int py_spoolss_SetPortInfo2_set_description(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->description");
		return -1;
	}
	if (value == Py_None) {
		object->description = NULL;
	} else {
		object->description = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->description = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo2_get_port_type(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_type;
	py_port_type = PyLong_FromUnsignedLongLong((uint32_t)(object->port_type));
	return py_port_type;
}

static int py_spoolss_SetPortInfo2_set_port_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->port_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo2_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_SetPortInfo2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPortInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_SetPortInfo2_get_port_name,
		.set = py_spoolss_SetPortInfo2_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_SetPortInfo2_get_monitor_name,
		.set = py_spoolss_SetPortInfo2_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "description"),
		.get = py_spoolss_SetPortInfo2_get_description,
		.set = py_spoolss_SetPortInfo2_set_description,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "port_type"),
		.get = py_spoolss_SetPortInfo2_get_port_type,
		.set = py_spoolss_SetPortInfo2_set_port_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortType")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_SetPortInfo2_get_reserved,
		.set = py_spoolss_SetPortInfo2_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPortInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPortInfo2, type);
}

static PyObject *py_spoolss_SetPortInfo2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPortInfo2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPortInfo2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPortInfo2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo2, "spoolss_SetPortInfo2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo2, "spoolss_SetPortInfo2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPortInfo2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPortInfo2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPortInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfo2",
	.tp_getset = py_spoolss_SetPortInfo2_getsetters,
	.tp_methods = py_spoolss_SetPortInfo2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfo2_new,
};


static PyObject *py_spoolss_SetPortInfo3_get_status(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_status;
	py_status = PyLong_FromUnsignedLongLong((uint32_t)(object->status));
	return py_status;
}

static int py_spoolss_SetPortInfo3_set_status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo3_get_status_string(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_status_string;
	if (object->status_string == NULL) {
		Py_RETURN_NONE;
	}
	if (object->status_string == NULL) {
		py_status_string = Py_None;
		Py_INCREF(py_status_string);
	} else {
		if (object->status_string == NULL) {
			py_status_string = Py_None;
			Py_INCREF(py_status_string);
		} else {
			py_status_string = PyUnicode_Decode(object->status_string, strlen(object->status_string), "utf-8", "ignore");
		}
	}
	return py_status_string;
}

static int py_spoolss_SetPortInfo3_set_status_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->status_string");
		return -1;
	}
	if (value == Py_None) {
		object->status_string = NULL;
	} else {
		object->status_string = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->status_string = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfo3_get_severity(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(obj);
	PyObject *py_severity;
	py_severity = PyLong_FromUnsignedLongLong((uint32_t)(object->severity));
	return py_severity;
}

static int py_spoolss_SetPortInfo3_set_severity(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->severity");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->severity));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->severity = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPortInfo3_getsetters[] = {
	{
		.name = discard_const_p(char, "status"),
		.get = py_spoolss_SetPortInfo3_get_status,
		.set = py_spoolss_SetPortInfo3_set_status,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortStatus")
	},
	{
		.name = discard_const_p(char, "status_string"),
		.get = py_spoolss_SetPortInfo3_get_status_string,
		.set = py_spoolss_SetPortInfo3_set_status_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "severity"),
		.get = py_spoolss_SetPortInfo3_get_severity,
		.set = py_spoolss_SetPortInfo3_set_severity,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortSeverity")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPortInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPortInfo3, type);
}

static PyObject *py_spoolss_SetPortInfo3_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPortInfo3);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPortInfo3_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo3);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfo3);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPortInfo3_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfo3 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo3, "spoolss_SetPortInfo3", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfo3, "spoolss_SetPortInfo3", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPortInfo3_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPortInfo3_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo3_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo3_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPortInfo3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfo3",
	.tp_getset = py_spoolss_SetPortInfo3_getsetters,
	.tp_methods = py_spoolss_SetPortInfo3_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfo3_new,
};


static PyObject *py_spoolss_SetPortInfoFF_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		if (object->port_name == NULL) {
			py_port_name = Py_None;
			Py_INCREF(py_port_name);
		} else {
			py_port_name = PyUnicode_Decode(object->port_name, strlen(object->port_name), "utf-8", "ignore");
		}
	}
	return py_port_name;
}

static int py_spoolss_SetPortInfoFF_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_name");
		return -1;
	}
	if (value == Py_None) {
		object->port_name = NULL;
	} else {
		object->port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->port_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfoFF_get_monitor_data(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_data;
	py_monitor_data = PyBytes_FromStringAndSize((char *)(object->monitor_data).data, (object->monitor_data).length);
	return py_monitor_data;
}

static int py_spoolss_SetPortInfoFF_set_monitor_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->monitor_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetPortInfoFF_getsetters[] = {
	{
		.name = discard_const_p(char, "port_name"),
		.get = py_spoolss_SetPortInfoFF_get_port_name,
		.set = py_spoolss_SetPortInfoFF_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "monitor_data"),
		.get = py_spoolss_SetPortInfoFF_get_monitor_data,
		.set = py_spoolss_SetPortInfoFF_set_monitor_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPortInfoFF_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPortInfoFF, type);
}

static PyObject *py_spoolss_SetPortInfoFF_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPortInfoFF);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPortInfoFF_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfoFF);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfoFF);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPortInfoFF_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfoFF *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfoFF, "spoolss_SetPortInfoFF", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfoFF, "spoolss_SetPortInfoFF", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPortInfoFF_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPortInfoFF_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfoFF_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfoFF_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPortInfoFF_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfoFF",
	.tp_getset = py_spoolss_SetPortInfoFF_getsetters,
	.tp_methods = py_spoolss_SetPortInfoFF_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfoFF_new,
};

static PyObject *py_import_spoolss_SetPortInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_SetPortInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPortInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPortInfo2_Type, in->info2, in->info2);
			}
			return ret;

		case 3:
			if (in->info3 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPortInfo3_Type, in->info3, in->info3);
			}
			return ret;

		case 0xff:
			if (in->infoFF == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_SetPortInfoFF_Type, in->infoFF, in->infoFF);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_SetPortInfo *py_export_spoolss_SetPortInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_SetPortInfo *ret = talloc_zero(mem_ctx, union spoolss_SetPortInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPortInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_SetPortInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPortInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_SetPortInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info3");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info3 = NULL;
			} else {
				ret->info3 = NULL;
				PY_CHECK_TYPE(&spoolss_SetPortInfo3_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info3 = (struct spoolss_SetPortInfo3 *)pytalloc_get_ptr(in);
			}
			break;

		case 0xff:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->infoFF");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->infoFF = NULL;
			} else {
				ret->infoFF = NULL;
				PY_CHECK_TYPE(&spoolss_SetPortInfoFF_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->infoFF = (struct spoolss_SetPortInfoFF *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_SetPortInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_SetPortInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_SetPortInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_SetPortInfo!");
		return NULL;
	}

	return py_import_spoolss_SetPortInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_SetPortInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_SetPortInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_SetPortInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_SetPortInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_SetPortInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_SetPortInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_SetPortInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfo_new,
};


static PyObject *py_spoolss_SetPortInfoContainer_get_level(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_SetPortInfoContainer_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPortInfoContainer_get_info(PyObject *obj, void *closure)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_SetPrinterInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_SetPrinterInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_SetPortInfoContainer_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_SetPrinterInfo *info_switch_0;
		info_switch_0 = (union spoolss_SetPrinterInfo *)pyrpc_export_union(&spoolss_SetPrinterInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_SetPrinterInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_SetPortInfoContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_SetPortInfoContainer_get_level,
		.set = py_spoolss_SetPortInfoContainer_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_SetPortInfoContainer_get_info,
		.set = py_spoolss_SetPortInfoContainer_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPrinterInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPortInfoContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_SetPortInfoContainer, type);
}

static PyObject *py_spoolss_SetPortInfoContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_SetPortInfoContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_SetPortInfoContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfoContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_SetPortInfoContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPortInfoContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_SetPortInfoContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfoContainer, "spoolss_SetPortInfoContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_SetPortInfoContainer, "spoolss_SetPortInfoContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_SetPortInfoContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_SetPortInfoContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfoContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPortInfoContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPortInfoContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPortInfoContainer",
	.tp_getset = py_spoolss_SetPortInfoContainer_getsetters,
	.tp_methods = py_spoolss_SetPortInfoContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPortInfoContainer_new,
};


static PyObject *py_UNIVERSAL_FONT_ID_get_Checksum(PyObject *obj, void *closure)
{
	struct UNIVERSAL_FONT_ID *object = pytalloc_get_ptr(obj);
	PyObject *py_Checksum;
	py_Checksum = PyLong_FromUnsignedLongLong((uint32_t)(object->Checksum));
	return py_Checksum;
}

static int py_UNIVERSAL_FONT_ID_set_Checksum(PyObject *py_obj, PyObject *value, void *closure)
{
	struct UNIVERSAL_FONT_ID *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Checksum");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Checksum));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Checksum = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_UNIVERSAL_FONT_ID_get_Index(PyObject *obj, void *closure)
{
	struct UNIVERSAL_FONT_ID *object = pytalloc_get_ptr(obj);
	PyObject *py_Index;
	py_Index = PyLong_FromUnsignedLongLong((uint32_t)(object->Index));
	return py_Index;
}

static int py_UNIVERSAL_FONT_ID_set_Index(PyObject *py_obj, PyObject *value, void *closure)
{
	struct UNIVERSAL_FONT_ID *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Index");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Index));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_UNIVERSAL_FONT_ID_getsetters[] = {
	{
		.name = discard_const_p(char, "Checksum"),
		.get = py_UNIVERSAL_FONT_ID_get_Checksum,
		.set = py_UNIVERSAL_FONT_ID_set_Checksum,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Index"),
		.get = py_UNIVERSAL_FONT_ID_get_Index,
		.set = py_UNIVERSAL_FONT_ID_set_Index,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_UNIVERSAL_FONT_ID_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct UNIVERSAL_FONT_ID, type);
}


static PyTypeObject UNIVERSAL_FONT_ID_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UNIVERSAL_FONT_ID",
	.tp_getset = py_UNIVERSAL_FONT_ID_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_UNIVERSAL_FONT_ID_new,
};


static PyObject *py_UNIVERSAL_FONT_ID_ctr_get_count(PyObject *obj, void *closure)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
	return py_count;
}

static int py_UNIVERSAL_FONT_ID_ctr_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_UNIVERSAL_FONT_ID_ctr_get_fonts(PyObject *obj, void *closure)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(obj);
	PyObject *py_fonts;
	py_fonts = PyList_New(object->count);
	if (py_fonts == NULL) {
		return NULL;
	}
	{
		int fonts_cntr_0;
		for (fonts_cntr_0 = 0; fonts_cntr_0 < (object->count); fonts_cntr_0++) {
			PyObject *py_fonts_0;
			py_fonts_0 = pytalloc_reference_ex(&UNIVERSAL_FONT_ID_Type, object->fonts, &(object->fonts)[fonts_cntr_0]);
			PyList_SetItem(py_fonts, fonts_cntr_0, py_fonts_0);
		}
	}
	return py_fonts;
}

static int py_UNIVERSAL_FONT_ID_ctr_set_fonts(PyObject *py_obj, PyObject *value, void *closure)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fonts");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int fonts_cntr_0;
		object->fonts = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->fonts, PyList_GET_SIZE(value));
		if (!object->fonts) { return -1; }
		talloc_set_name_const(object->fonts, "ARRAY: object->fonts");
		for (fonts_cntr_0 = 0; fonts_cntr_0 < PyList_GET_SIZE(value); fonts_cntr_0++) {
			if (PyList_GET_ITEM(value, fonts_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->fonts)[fonts_cntr_0]");
				return -1;
			}
			PY_CHECK_TYPE(&UNIVERSAL_FONT_ID_Type, PyList_GET_ITEM(value, fonts_cntr_0), return -1;);
			if (talloc_reference(object->fonts, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, fonts_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			(object->fonts)[fonts_cntr_0] = *(struct UNIVERSAL_FONT_ID *)pytalloc_get_ptr(PyList_GET_ITEM(value, fonts_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_UNIVERSAL_FONT_ID_ctr_getsetters[] = {
	{
		.name = discard_const_p(char, "count"),
		.get = py_UNIVERSAL_FONT_ID_ctr_get_count,
		.set = py_UNIVERSAL_FONT_ID_ctr_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "fonts"),
		.get = py_UNIVERSAL_FONT_ID_ctr_get_fonts,
		.set = py_UNIVERSAL_FONT_ID_ctr_set_fonts,
		.doc = discard_const_p(char, "PIDL-generated element of base type UNIVERSAL_FONT_ID")
	},
	{ .name = NULL }
};

static PyObject *py_UNIVERSAL_FONT_ID_ctr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct UNIVERSAL_FONT_ID_ctr, type);
}

static PyObject *py_UNIVERSAL_FONT_ID_ctr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_UNIVERSAL_FONT_ID_ctr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_UNIVERSAL_FONT_ID_ctr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_UNIVERSAL_FONT_ID_ctr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_UNIVERSAL_FONT_ID_ctr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_UNIVERSAL_FONT_ID_ctr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct UNIVERSAL_FONT_ID_ctr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_UNIVERSAL_FONT_ID_ctr, "UNIVERSAL_FONT_ID_ctr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_UNIVERSAL_FONT_ID_ctr, "UNIVERSAL_FONT_ID_ctr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_UNIVERSAL_FONT_ID_ctr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_UNIVERSAL_FONT_ID_ctr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_UNIVERSAL_FONT_ID_ctr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_UNIVERSAL_FONT_ID_ctr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject UNIVERSAL_FONT_ID_ctr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UNIVERSAL_FONT_ID_ctr",
	.tp_getset = py_UNIVERSAL_FONT_ID_ctr_getsetters,
	.tp_methods = py_UNIVERSAL_FONT_ID_ctr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_UNIVERSAL_FONT_ID_ctr_new,
};


static PyObject *py_spoolss_AddMonitorInfo1_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddMonitorInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddMonitorInfo1_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddMonitorInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddMonitorInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddMonitorInfo1_get_monitor_name,
		.set = py_spoolss_AddMonitorInfo1_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddMonitorInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddMonitorInfo1, type);
}


static PyTypeObject spoolss_AddMonitorInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddMonitorInfo1",
	.tp_getset = py_spoolss_AddMonitorInfo1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddMonitorInfo1_new,
};


static PyObject *py_spoolss_AddMonitorInfo2_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->monitor_name, strlen(object->monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddMonitorInfo2_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_name = NULL;
	} else {
		object->monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddMonitorInfo2_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		if (object->environment == NULL) {
			py_environment = Py_None;
			Py_INCREF(py_environment);
		} else {
			py_environment = PyUnicode_Decode(object->environment, strlen(object->environment), "utf-8", "ignore");
		}
	}
	return py_environment;
}

static int py_spoolss_AddMonitorInfo2_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->environment");
		return -1;
	}
	if (value == Py_None) {
		object->environment = NULL;
	} else {
		object->environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddMonitorInfo2_get_dll_name(PyObject *obj, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(obj);
	PyObject *py_dll_name;
	if (object->dll_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->dll_name == NULL) {
		py_dll_name = Py_None;
		Py_INCREF(py_dll_name);
	} else {
		if (object->dll_name == NULL) {
			py_dll_name = Py_None;
			Py_INCREF(py_dll_name);
		} else {
			py_dll_name = PyUnicode_Decode(object->dll_name, strlen(object->dll_name), "utf-8", "ignore");
		}
	}
	return py_dll_name;
}

static int py_spoolss_AddMonitorInfo2_set_dll_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddMonitorInfo2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dll_name");
		return -1;
	}
	if (value == Py_None) {
		object->dll_name = NULL;
	} else {
		object->dll_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->dll_name = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_AddMonitorInfo2_getsetters[] = {
	{
		.name = discard_const_p(char, "monitor_name"),
		.get = py_spoolss_AddMonitorInfo2_get_monitor_name,
		.set = py_spoolss_AddMonitorInfo2_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "environment"),
		.get = py_spoolss_AddMonitorInfo2_get_environment,
		.set = py_spoolss_AddMonitorInfo2_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dll_name"),
		.get = py_spoolss_AddMonitorInfo2_get_dll_name,
		.set = py_spoolss_AddMonitorInfo2_set_dll_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddMonitorInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_AddMonitorInfo2, type);
}


static PyTypeObject spoolss_AddMonitorInfo2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddMonitorInfo2",
	.tp_getset = py_spoolss_AddMonitorInfo2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddMonitorInfo2_new,
};

static PyObject *py_import_spoolss_AddMonitorInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_AddMonitorInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->info1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddMonitorInfo1_Type, in->info1, in->info1);
			}
			return ret;

		case 2:
			if (in->info2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_AddMonitorInfo2_Type, in->info2, in->info2);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_AddMonitorInfo *py_export_spoolss_AddMonitorInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_AddMonitorInfo *ret = talloc_zero(mem_ctx, union spoolss_AddMonitorInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info1 = NULL;
			} else {
				ret->info1 = NULL;
				PY_CHECK_TYPE(&spoolss_AddMonitorInfo1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info1 = (struct spoolss_AddMonitorInfo1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info2 = NULL;
			} else {
				ret->info2 = NULL;
				PY_CHECK_TYPE(&spoolss_AddMonitorInfo2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info2 = (struct spoolss_AddMonitorInfo2 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_AddMonitorInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_AddMonitorInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_AddMonitorInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_AddMonitorInfo!");
		return NULL;
	}

	return py_import_spoolss_AddMonitorInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_AddMonitorInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_AddMonitorInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_AddMonitorInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_AddMonitorInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddMonitorInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddMonitorInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_AddMonitorInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_AddMonitorInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddMonitorInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_AddMonitorInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddMonitorInfo_new,
};


static PyObject *py_spoolss_MonitorContainer_get_level(PyObject *obj, void *closure)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_MonitorContainer_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_MonitorContainer_get_info(PyObject *obj, void *closure)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_MonitorInfo_Type, pytalloc_get_mem_ctx(obj), object->level, &object->info, "union spoolss_MonitorInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_MonitorContainer_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->info");
		return -1;
	}
	{
		union spoolss_MonitorInfo *info_switch_0;
		info_switch_0 = (union spoolss_MonitorInfo *)pyrpc_export_union(&spoolss_MonitorInfo_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_MonitorInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->info = *info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_MonitorContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_MonitorContainer_get_level,
		.set = py_spoolss_MonitorContainer_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "info"),
		.get = py_spoolss_MonitorContainer_get_info,
		.set = py_spoolss_MonitorContainer_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MonitorInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_MonitorContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_MonitorContainer, type);
}

static PyObject *py_spoolss_MonitorContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_MonitorContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_MonitorContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorContainer, "spoolss_MonitorContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorContainer, "spoolss_MonitorContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_MonitorContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_MonitorContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_MonitorContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.MonitorContainer",
	.tp_getset = py_spoolss_MonitorContainer_getsetters,
	.tp_methods = py_spoolss_MonitorContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_MonitorContainer_new,
};


static PyObject *py_spoolss_PrintProcDataTypesInfo1_get_name_array(PyObject *obj, void *closure)
{
	struct spoolss_PrintProcDataTypesInfo1 *object = pytalloc_get_ptr(obj);
	PyObject *py_name_array;
	if (object->name_array == NULL) {
		Py_RETURN_NONE;
	}
	if (object->name_array == NULL) {
		py_name_array = Py_None;
		Py_INCREF(py_name_array);
	} else {
		py_name_array = PyString_FromStringOrNULL(object->name_array);
	}
	return py_name_array;
}

static int py_spoolss_PrintProcDataTypesInfo1_set_name_array(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintProcDataTypesInfo1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->name_array");
		return -1;
	}
	if (value == Py_None) {
		object->name_array = NULL;
	} else {
		object->name_array = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->name_array = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrintProcDataTypesInfo1_getsetters[] = {
	{
		.name = discard_const_p(char, "name_array"),
		.get = py_spoolss_PrintProcDataTypesInfo1_get_name_array,
		.set = py_spoolss_PrintProcDataTypesInfo1_set_name_array,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrintProcDataTypesInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrintProcDataTypesInfo1, type);
}

static PyObject *py_spoolss_PrintProcDataTypesInfo1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrintProcDataTypesInfo1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcDataTypesInfo1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrintProcDataTypesInfo1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcDataTypesInfo1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcDataTypesInfo1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintProcDataTypesInfo1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrintProcDataTypesInfo1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintProcDataTypesInfo1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcDataTypesInfo1, "spoolss_PrintProcDataTypesInfo1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintProcDataTypesInfo1, "spoolss_PrintProcDataTypesInfo1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrintProcDataTypesInfo1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrintProcDataTypesInfo1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcDataTypesInfo1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcDataTypesInfo1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrintProcDataTypesInfo1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcDataTypesInfo1",
	.tp_getset = py_spoolss_PrintProcDataTypesInfo1_getsetters,
	.tp_methods = py_spoolss_PrintProcDataTypesInfo1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcDataTypesInfo1_new,
};

static PyObject *py_import_spoolss_PrintProcDataTypesInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_PrintProcDataTypesInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = pytalloc_reference_ex(&spoolss_PrintProcDataTypesInfo1_Type, mem_ctx, &in->info1);
			return ret;

		default:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrintProcDataTypesInfo *py_export_spoolss_PrintProcDataTypesInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrintProcDataTypesInfo *ret = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info1");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_PrintProcDataTypesInfo1_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->info1 = *(struct spoolss_PrintProcDataTypesInfo1 *)pytalloc_get_ptr(in);
			break;

		default:
			break;

	}

	return ret;
}

static PyObject *py_spoolss_PrintProcDataTypesInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrintProcDataTypesInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrintProcDataTypesInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrintProcDataTypesInfo!");
		return NULL;
	}

	return py_import_spoolss_PrintProcDataTypesInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrintProcDataTypesInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrintProcDataTypesInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrintProcDataTypesInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrintProcDataTypesInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcDataTypesInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintProcDataTypesInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrintProcDataTypesInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrintProcDataTypesInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintProcDataTypesInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrintProcDataTypesInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintProcDataTypesInfo_new,
};


static PyObject *py_spoolss_PortVarContainer_get_monitor_data_size(PyObject *obj, void *closure)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_data_size;
	py_monitor_data_size = PyLong_FromUnsignedLongLong((uint32_t)(object->monitor_data_size));
	return py_monitor_data_size;
}

static int py_spoolss_PortVarContainer_set_monitor_data_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_data_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->monitor_data_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->monitor_data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortVarContainer_get_monitor_data(PyObject *obj, void *closure)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_data;
	if (object->monitor_data == NULL) {
		Py_RETURN_NONE;
	}
	if (object->monitor_data == NULL) {
		py_monitor_data = Py_None;
		Py_INCREF(py_monitor_data);
	} else {
		py_monitor_data = PyList_New(object->monitor_data_size);
		if (py_monitor_data == NULL) {
			return NULL;
		}
		{
			int monitor_data_cntr_1;
			for (monitor_data_cntr_1 = 0; monitor_data_cntr_1 < (object->monitor_data_size); monitor_data_cntr_1++) {
				PyObject *py_monitor_data_1;
				py_monitor_data_1 = PyLong_FromLong((uint16_t)((object->monitor_data)[monitor_data_cntr_1]));
				PyList_SetItem(py_monitor_data, monitor_data_cntr_1, py_monitor_data_1);
			}
		}
	}
	return py_monitor_data;
}

static int py_spoolss_PortVarContainer_set_monitor_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->monitor_data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->monitor_data");
		return -1;
	}
	if (value == Py_None) {
		object->monitor_data = NULL;
	} else {
		object->monitor_data = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int monitor_data_cntr_1;
			object->monitor_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->monitor_data, PyList_GET_SIZE(value));
			if (!object->monitor_data) { return -1; }
			talloc_set_name_const(object->monitor_data, "ARRAY: object->monitor_data");
			for (monitor_data_cntr_1 = 0; monitor_data_cntr_1 < PyList_GET_SIZE(value); monitor_data_cntr_1++) {
				if (PyList_GET_ITEM(value, monitor_data_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->monitor_data)[monitor_data_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->monitor_data)[monitor_data_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, monitor_data_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, monitor_data_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->monitor_data)[monitor_data_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortVarContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "monitor_data_size"),
		.get = py_spoolss_PortVarContainer_get_monitor_data_size,
		.set = py_spoolss_PortVarContainer_set_monitor_data_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "monitor_data"),
		.get = py_spoolss_PortVarContainer_get_monitor_data,
		.set = py_spoolss_PortVarContainer_set_monitor_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortVarContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortVarContainer, type);
}

static PyObject *py_spoolss_PortVarContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortVarContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortVarContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortVarContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortVarContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortVarContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortVarContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortVarContainer, "spoolss_PortVarContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortVarContainer, "spoolss_PortVarContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortVarContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortVarContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortVarContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortVarContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortVarContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortVarContainer",
	.tp_getset = py_spoolss_PortVarContainer_getsetters,
	.tp_methods = py_spoolss_PortVarContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortVarContainer_new,
};

static PyObject *py_import_spoolss_Field(TALLOC_CTX *mem_ctx, int level, union spoolss_Field *in)
{
	PyObject *ret;

	switch (level) {
		case PRINTER_NOTIFY_TYPE:
			ret = PyLong_FromLong((uint16_t)(in->field));
			return ret;

		case JOB_NOTIFY_TYPE:
			ret = PyLong_FromLong((uint16_t)(in->field));
			return ret;

		default:
			ret = PyLong_FromLong((uint16_t)(in->field));
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_Field *py_export_spoolss_Field(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_Field *ret = talloc_zero(mem_ctx, union spoolss_Field);
	switch (level) {
		case PRINTER_NOTIFY_TYPE:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->field");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->field));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->field = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case JOB_NOTIFY_TYPE:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->field");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->field));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->field = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->field");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->field));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->field = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

	}

	return ret;
}

static PyObject *py_spoolss_Field_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_Field *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_Field *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_Field!");
		return NULL;
	}

	return py_import_spoolss_Field(mem_ctx, level, in);
}

static PyObject *py_spoolss_Field_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_Field *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_Field(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_Field_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_Field_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_Field_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_Field_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_Field_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.Field",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_Field_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_Field_new,
};


static PyObject *py_spoolss_NotifyOptionType_get_type(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromLong((uint16_t)(object->type));
	return py_type;
}

static int py_spoolss_NotifyOptionType_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOptionType_get_u1(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_u1;
	py_u1 = PyLong_FromLong((uint16_t)(object->u1));
	return py_u1;
}

static int py_spoolss_NotifyOptionType_set_u1(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u1");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u1));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->u1 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOptionType_get_u2(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_u2;
	py_u2 = PyLong_FromUnsignedLongLong((uint32_t)(object->u2));
	return py_u2;
}

static int py_spoolss_NotifyOptionType_set_u2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->u2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOptionType_get_u3(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_u3;
	py_u3 = PyLong_FromUnsignedLongLong((uint32_t)(object->u3));
	return py_u3;
}

static int py_spoolss_NotifyOptionType_set_u3(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u3");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->u3));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->u3 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOptionType_get_count(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
	return py_count;
}

static int py_spoolss_NotifyOptionType_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOptionType_get_fields(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(obj);
	PyObject *py_fields;
	if (object->fields == NULL) {
		Py_RETURN_NONE;
	}
	if (object->fields == NULL) {
		py_fields = Py_None;
		Py_INCREF(py_fields);
	} else {
		py_fields = PyList_New(object->count);
		if (py_fields == NULL) {
			return NULL;
		}
		{
			int fields_cntr_1;
			for (fields_cntr_1 = 0; fields_cntr_1 < (object->count); fields_cntr_1++) {
				PyObject *py_fields_1;
				py_fields_1 = pyrpc_import_union(&spoolss_Field_Type, object->fields, object->type, &(object->fields)[fields_cntr_1], "union spoolss_Field");
				if (py_fields_1 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_fields, fields_cntr_1, py_fields_1);
			}
		}
	}
	return py_fields;
}

static int py_spoolss_NotifyOptionType_set_fields(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOptionType *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->fields));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->fields");
		return -1;
	}
	if (value == Py_None) {
		object->fields = NULL;
	} else {
		object->fields = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int fields_cntr_1;
			object->fields = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->fields, PyList_GET_SIZE(value));
			if (!object->fields) { return -1; }
			talloc_set_name_const(object->fields, "ARRAY: object->fields");
			for (fields_cntr_1 = 0; fields_cntr_1 < PyList_GET_SIZE(value); fields_cntr_1++) {
				if (PyList_GET_ITEM(value, fields_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->fields)[fields_cntr_1]");
					return -1;
				}
				{
					union spoolss_Field *fields_switch_2;
					fields_switch_2 = (union spoolss_Field *)pyrpc_export_union(&spoolss_Field_Type, object->fields, object->type, PyList_GET_ITEM(value, fields_cntr_1), "union spoolss_Field");
					if (fields_switch_2 == NULL) {
						return -1;
					}
					(object->fields)[fields_cntr_1] = *fields_switch_2;
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_NotifyOptionType_getsetters[] = {
	{
		.name = discard_const_p(char, "type"),
		.get = py_spoolss_NotifyOptionType_get_type,
		.set = py_spoolss_NotifyOptionType_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyType")
	},
	{
		.name = discard_const_p(char, "u1"),
		.get = py_spoolss_NotifyOptionType_get_u1,
		.set = py_spoolss_NotifyOptionType_set_u1,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "u2"),
		.get = py_spoolss_NotifyOptionType_get_u2,
		.set = py_spoolss_NotifyOptionType_set_u2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "u3"),
		.get = py_spoolss_NotifyOptionType_get_u3,
		.set = py_spoolss_NotifyOptionType_set_u3,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "count"),
		.get = py_spoolss_NotifyOptionType_get_count,
		.set = py_spoolss_NotifyOptionType_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "fields"),
		.get = py_spoolss_NotifyOptionType_get_fields,
		.set = py_spoolss_NotifyOptionType_set_fields,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Field")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_NotifyOptionType_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_NotifyOptionType, type);
}


static PyTypeObject spoolss_NotifyOptionType_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.NotifyOptionType",
	.tp_getset = py_spoolss_NotifyOptionType_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_NotifyOptionType_new,
};


static PyObject *py_spoolss_NotifyOption_get_version(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_NotifyOption_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOption_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_NotifyOption_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOption_get_count(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
	return py_count;
}

static int py_spoolss_NotifyOption_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyOption_get_types(PyObject *obj, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(obj);
	PyObject *py_types;
	if (object->types == NULL) {
		Py_RETURN_NONE;
	}
	if (object->types == NULL) {
		py_types = Py_None;
		Py_INCREF(py_types);
	} else {
		py_types = PyList_New(object->count);
		if (py_types == NULL) {
			return NULL;
		}
		{
			int types_cntr_1;
			for (types_cntr_1 = 0; types_cntr_1 < (object->count); types_cntr_1++) {
				PyObject *py_types_1;
				py_types_1 = pytalloc_reference_ex(&spoolss_NotifyOptionType_Type, object->types, &(object->types)[types_cntr_1]);
				PyList_SetItem(py_types, types_cntr_1, py_types_1);
			}
		}
	}
	return py_types;
}

static int py_spoolss_NotifyOption_set_types(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->types));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->types");
		return -1;
	}
	if (value == Py_None) {
		object->types = NULL;
	} else {
		object->types = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int types_cntr_1;
			object->types = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->types, PyList_GET_SIZE(value));
			if (!object->types) { return -1; }
			talloc_set_name_const(object->types, "ARRAY: object->types");
			for (types_cntr_1 = 0; types_cntr_1 < PyList_GET_SIZE(value); types_cntr_1++) {
				if (PyList_GET_ITEM(value, types_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->types)[types_cntr_1]");
					return -1;
				}
				PY_CHECK_TYPE(&spoolss_NotifyOptionType_Type, PyList_GET_ITEM(value, types_cntr_1), return -1;);
				if (talloc_reference(object->types, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, types_cntr_1))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(object->types)[types_cntr_1] = *(struct spoolss_NotifyOptionType *)pytalloc_get_ptr(PyList_GET_ITEM(value, types_cntr_1));
			}
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_NotifyOption_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_NotifyOption_get_version,
		.set = py_spoolss_NotifyOption_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_NotifyOption_get_flags,
		.set = py_spoolss_NotifyOption_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolssNotifyOptionFlags")
	},
	{
		.name = discard_const_p(char, "count"),
		.get = py_spoolss_NotifyOption_get_count,
		.set = py_spoolss_NotifyOption_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "types"),
		.get = py_spoolss_NotifyOption_get_types,
		.set = py_spoolss_NotifyOption_set_types,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyOptionType")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_NotifyOption_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_NotifyOption, type);
}

static PyObject *py_spoolss_NotifyOption_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_NotifyOption);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_NotifyOption_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_NotifyOption);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_NotifyOption);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_NotifyOption_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_NotifyOption *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_NotifyOption, "spoolss_NotifyOption", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_NotifyOption, "spoolss_NotifyOption", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_NotifyOption_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_NotifyOption_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyOption_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyOption_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_NotifyOption_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.NotifyOption",
	.tp_getset = py_spoolss_NotifyOption_getsetters,
	.tp_methods = py_spoolss_NotifyOption_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_NotifyOption_new,
};


static PyObject *py_spoolss_NotifyString_get_size(PyObject *obj, void *closure)
{
	struct spoolss_NotifyString *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_NotifyString_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyString *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyString_get_string(PyObject *obj, void *closure)
{
	struct spoolss_NotifyString *object = pytalloc_get_ptr(obj);
	PyObject *py_string;
	if (object->string == NULL) {
		Py_RETURN_NONE;
	}
	if (object->string == NULL) {
		py_string = Py_None;
		Py_INCREF(py_string);
	} else {
		if (object->string == NULL) {
			py_string = Py_None;
			Py_INCREF(py_string);
		} else {
			py_string = PyUnicode_Decode(object->string, strlen(object->string), "utf-8", "ignore");
		}
	}
	return py_string;
}

static int py_spoolss_NotifyString_set_string(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyString *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->string");
		return -1;
	}
	if (value == Py_None) {
		object->string = NULL;
	} else {
		object->string = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->string = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_NotifyString_getsetters[] = {
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_NotifyString_get_size,
		.set = py_spoolss_NotifyString_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "string"),
		.get = py_spoolss_NotifyString_get_string,
		.set = py_spoolss_NotifyString_set_string,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_NotifyString_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_NotifyString, type);
}


static PyTypeObject spoolss_NotifyString_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.NotifyString",
	.tp_getset = py_spoolss_NotifyString_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_NotifyString_new,
};

static PyObject *py_import_spoolss_NotifyData(TALLOC_CTX *mem_ctx, int level, union spoolss_NotifyData *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			ret = PyList_New(2);
			if (ret == NULL) {
				return NULL;
			}
			{
				int integer_cntr_0;
				for (integer_cntr_0 = 0; integer_cntr_0 < (2); integer_cntr_0++) {
					PyObject *py_integer_0;
					py_integer_0 = PyLong_FromUnsignedLongLong((uint32_t)((in->integer)[integer_cntr_0]));
					PyList_SetItem(ret, integer_cntr_0, py_integer_0);
				}
			}
			return ret;

		case 2:
			ret = pytalloc_reference_ex(&spoolss_NotifyString_Type, mem_ctx, &in->string);
			return ret;

		case 3:
			ret = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, mem_ctx, &in->devmode);
			return ret;

		case 4:
			ret = pytalloc_reference_ex(&spoolss_TimeCtr_Type, mem_ctx, &in->time);
			return ret;

		case 5:
			ret = pytalloc_reference_ex(sec_desc_buf_Type, mem_ctx, &in->sd);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_NotifyData *py_export_spoolss_NotifyData(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_NotifyData *ret = talloc_zero(mem_ctx, union spoolss_NotifyData);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->integer");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&PyList_Type, in, talloc_free(ret); return NULL;);
			{
				int integer_cntr_0;
				if (ARRAY_SIZE(ret->integer) != PyList_GET_SIZE(in)) {
					PyErr_Format(PyExc_TypeError, "Expected list of type %s, length %zu, got %zd", Py_TYPE(in)->tp_name, ARRAY_SIZE(ret->integer),  PyList_GET_SIZE(in));
					talloc_free(ret); return NULL;
				}
				for (integer_cntr_0 = 0; integer_cntr_0 < PyList_GET_SIZE(in); integer_cntr_0++) {
					if (PyList_GET_ITEM(in, integer_cntr_0) == NULL) {
						PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (ret->integer)[integer_cntr_0]");
						talloc_free(ret); return NULL;
					}
					{
						const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((ret->integer)[integer_cntr_0]));
						if (PyLong_Check(PyList_GET_ITEM(in, integer_cntr_0))) {
							unsigned long long test_var;
							test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(in, integer_cntr_0));
							if (PyErr_Occurred() != NULL) {
								talloc_free(ret); return NULL;
							}
							if (test_var > uint_max) {
								PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
								  PyLong_Type.tp_name, uint_max, test_var);
								talloc_free(ret); return NULL;
							}
							(ret->integer)[integer_cntr_0] = test_var;
						} else {
							PyErr_Format(PyExc_TypeError, "Expected type %s",
							  PyLong_Type.tp_name);
							talloc_free(ret); return NULL;
						}
					}
				}
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->string");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_NotifyString_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->string = *(struct spoolss_NotifyString *)pytalloc_get_ptr(in);
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->devmode");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->devmode = *(struct spoolss_DevmodeContainer *)pytalloc_get_ptr(in);
			break;

		case 4:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->time");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_TimeCtr_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->time = *(struct spoolss_TimeCtr *)pytalloc_get_ptr(in);
			break;

		case 5:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sd");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(sec_desc_buf_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->sd = *(struct sec_desc_buf *)pytalloc_get_ptr(in);
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_NotifyData_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_NotifyData *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_NotifyData *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_NotifyData!");
		return NULL;
	}

	return py_import_spoolss_NotifyData(mem_ctx, level, in);
}

static PyObject *py_spoolss_NotifyData_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_NotifyData *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_NotifyData(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_NotifyData_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyData_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyData_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_NotifyData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_NotifyData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.NotifyData",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_NotifyData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_NotifyData_new,
};


static PyObject *py_spoolss_Notify_get_type(PyObject *obj, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromLong((uint16_t)(object->type));
	return py_type;
}

static int py_spoolss_Notify_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Notify_get_field(PyObject *obj, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(obj);
	PyObject *py_field;
	py_field = pyrpc_import_union(&spoolss_Field_Type, pytalloc_get_mem_ctx(obj), object->type, &object->field, "union spoolss_Field");
	if (py_field == NULL) {
		return NULL;
	}
	return py_field;
}

static int py_spoolss_Notify_set_field(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->field");
		return -1;
	}
	{
		union spoolss_Field *field_switch_0;
		field_switch_0 = (union spoolss_Field *)pyrpc_export_union(&spoolss_Field_Type, pytalloc_get_mem_ctx(py_obj), object->type, value, "union spoolss_Field");
		if (field_switch_0 == NULL) {
			return -1;
		}
		object->field = *field_switch_0;
	}
	return 0;
}

static PyObject *py_spoolss_Notify_get_variable_type(PyObject *obj, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(obj);
	PyObject *py_variable_type;
	py_variable_type = PyLong_FromUnsignedLongLong((uint32_t)(object->variable_type));
	return py_variable_type;
}

static int py_spoolss_Notify_set_variable_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->variable_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->variable_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->variable_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Notify_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->job_id));
	return py_job_id;
}

static int py_spoolss_Notify_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_Notify_get_data(PyObject *obj, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	py_data = pyrpc_import_union(&spoolss_NotifyData_Type, pytalloc_get_mem_ctx(obj), object->variable_type, &object->data, "union spoolss_NotifyData");
	if (py_data == NULL) {
		return NULL;
	}
	return py_data;
}

static int py_spoolss_Notify_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_Notify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
		return -1;
	}
	{
		union spoolss_NotifyData *data_switch_0;
		data_switch_0 = (union spoolss_NotifyData *)pyrpc_export_union(&spoolss_NotifyData_Type, pytalloc_get_mem_ctx(py_obj), object->variable_type, value, "union spoolss_NotifyData");
		if (data_switch_0 == NULL) {
			return -1;
		}
		object->data = *data_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_Notify_getsetters[] = {
	{
		.name = discard_const_p(char, "type"),
		.get = py_spoolss_Notify_get_type,
		.set = py_spoolss_Notify_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyType")
	},
	{
		.name = discard_const_p(char, "field"),
		.get = py_spoolss_Notify_get_field,
		.set = py_spoolss_Notify_set_field,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Field")
	},
	{
		.name = discard_const_p(char, "variable_type"),
		.get = py_spoolss_Notify_get_variable_type,
		.set = py_spoolss_Notify_set_variable_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyTable")
	},
	{
		.name = discard_const_p(char, "job_id"),
		.get = py_spoolss_Notify_get_job_id,
		.set = py_spoolss_Notify_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "data"),
		.get = py_spoolss_Notify_get_data,
		.set = py_spoolss_Notify_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyData")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_Notify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_Notify, type);
}


static PyTypeObject spoolss_Notify_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.Notify",
	.tp_getset = py_spoolss_Notify_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_Notify_new,
};


static PyObject *py_spoolss_NotifyInfo_get_version(PyObject *obj, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_NotifyInfo_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyInfo_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_NotifyInfo_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyInfo_get_count(PyObject *obj, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(object->count));
	return py_count;
}

static int py_spoolss_NotifyInfo_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_NotifyInfo_get_notifies(PyObject *obj, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(obj);
	PyObject *py_notifies;
	py_notifies = PyList_New(object->count);
	if (py_notifies == NULL) {
		return NULL;
	}
	{
		int notifies_cntr_0;
		for (notifies_cntr_0 = 0; notifies_cntr_0 < (object->count); notifies_cntr_0++) {
			PyObject *py_notifies_0;
			py_notifies_0 = pytalloc_reference_ex(&spoolss_Notify_Type, object->notifies, &(object->notifies)[notifies_cntr_0]);
			PyList_SetItem(py_notifies, notifies_cntr_0, py_notifies_0);
		}
	}
	return py_notifies;
}

static int py_spoolss_NotifyInfo_set_notifies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->notifies");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int notifies_cntr_0;
		object->notifies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->notifies, PyList_GET_SIZE(value));
		if (!object->notifies) { return -1; }
		talloc_set_name_const(object->notifies, "ARRAY: object->notifies");
		for (notifies_cntr_0 = 0; notifies_cntr_0 < PyList_GET_SIZE(value); notifies_cntr_0++) {
			if (PyList_GET_ITEM(value, notifies_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->notifies)[notifies_cntr_0]");
				return -1;
			}
			PY_CHECK_TYPE(&spoolss_Notify_Type, PyList_GET_ITEM(value, notifies_cntr_0), return -1;);
			if (talloc_reference(object->notifies, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, notifies_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			(object->notifies)[notifies_cntr_0] = *(struct spoolss_Notify *)pytalloc_get_ptr(PyList_GET_ITEM(value, notifies_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_NotifyInfo_getsetters[] = {
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_NotifyInfo_get_version,
		.set = py_spoolss_NotifyInfo_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_NotifyInfo_get_flags,
		.set = py_spoolss_NotifyInfo_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "count"),
		.get = py_spoolss_NotifyInfo_get_count,
		.set = py_spoolss_NotifyInfo_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "notifies"),
		.get = py_spoolss_NotifyInfo_get_notifies,
		.set = py_spoolss_NotifyInfo_set_notifies,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_Notify")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_NotifyInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_NotifyInfo, type);
}

static PyObject *py_spoolss_NotifyInfo_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_NotifyInfo);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_NotifyInfo_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_NotifyInfo);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_NotifyInfo);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_NotifyInfo_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_NotifyInfo *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_NotifyInfo, "spoolss_NotifyInfo", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_NotifyInfo, "spoolss_NotifyInfo", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_NotifyInfo_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_NotifyInfo_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyInfo_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_NotifyInfo_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_NotifyInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.NotifyInfo",
	.tp_getset = py_spoolss_NotifyInfo_getsetters,
	.tp_methods = py_spoolss_NotifyInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_NotifyInfo_new,
};

static PyObject *py_import_spoolss_ReplyPrinterInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_ReplyPrinterInfo *in)
{
	PyObject *ret;

	switch (level) {
		case 0:
			if (in->info0 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_NotifyInfo_Type, in->info0, in->info0);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_ReplyPrinterInfo *py_export_spoolss_ReplyPrinterInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_ReplyPrinterInfo *ret = talloc_zero(mem_ctx, union spoolss_ReplyPrinterInfo);
	switch (level) {
		case 0:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->info0");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->info0 = NULL;
			} else {
				ret->info0 = NULL;
				PY_CHECK_TYPE(&spoolss_NotifyInfo_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->info0 = (struct spoolss_NotifyInfo *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_ReplyPrinterInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_ReplyPrinterInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_ReplyPrinterInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_ReplyPrinterInfo!");
		return NULL;
	}

	return py_import_spoolss_ReplyPrinterInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_ReplyPrinterInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_ReplyPrinterInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_ReplyPrinterInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_ReplyPrinterInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyPrinterInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyPrinterInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_ReplyPrinterInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_ReplyPrinterInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ReplyPrinterInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_ReplyPrinterInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ReplyPrinterInfo_new,
};


static PyObject *py_spoolss_UserLevel1_get_size(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_UserLevel1_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_client(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_client;
	if (object->client == NULL) {
		Py_RETURN_NONE;
	}
	if (object->client == NULL) {
		py_client = Py_None;
		Py_INCREF(py_client);
	} else {
		if (object->client == NULL) {
			py_client = Py_None;
			Py_INCREF(py_client);
		} else {
			py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
		}
	}
	return py_client;
}

static int py_spoolss_UserLevel1_set_client(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->client");
		return -1;
	}
	if (value == Py_None) {
		object->client = NULL;
	} else {
		object->client = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->client = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_user(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_user;
	if (object->user == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user == NULL) {
		py_user = Py_None;
		Py_INCREF(py_user);
	} else {
		if (object->user == NULL) {
			py_user = Py_None;
			Py_INCREF(py_user);
		} else {
			py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
		}
	}
	return py_user;
}

static int py_spoolss_UserLevel1_set_user(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user");
		return -1;
	}
	if (value == Py_None) {
		object->user = NULL;
	} else {
		object->user = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_build(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_build;
	py_build = PyLong_FromUnsignedLongLong((uint32_t)(object->build));
	return py_build;
}

static int py_spoolss_UserLevel1_set_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_major(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_major;
	py_major = PyLong_FromUnsignedLongLong((uint32_t)(object->major));
	return py_major;
}

static int py_spoolss_UserLevel1_set_major(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->major");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->major));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->major = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_minor(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_minor;
	py_minor = PyLong_FromUnsignedLongLong((uint32_t)(object->minor));
	return py_minor;
}

static int py_spoolss_UserLevel1_set_minor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->minor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel1_get_processor(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor;
	py_processor = PyLong_FromLong((uint16_t)(object->processor));
	return py_processor;
}

static int py_spoolss_UserLevel1_set_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UserLevel1_getsetters[] = {
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_UserLevel1_get_size,
		.set = py_spoolss_UserLevel1_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "client"),
		.get = py_spoolss_UserLevel1_get_client,
		.set = py_spoolss_UserLevel1_set_client,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "user"),
		.get = py_spoolss_UserLevel1_get_user,
		.set = py_spoolss_UserLevel1_set_user,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "build"),
		.get = py_spoolss_UserLevel1_get_build,
		.set = py_spoolss_UserLevel1_set_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "major"),
		.get = py_spoolss_UserLevel1_get_major,
		.set = py_spoolss_UserLevel1_set_major,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MajorVersion")
	},
	{
		.name = discard_const_p(char, "minor"),
		.get = py_spoolss_UserLevel1_get_minor,
		.set = py_spoolss_UserLevel1_set_minor,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MinorVersion")
	},
	{
		.name = discard_const_p(char, "processor"),
		.get = py_spoolss_UserLevel1_get_processor,
		.set = py_spoolss_UserLevel1_set_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorArchitecture")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UserLevel1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UserLevel1, type);
}


static PyTypeObject spoolss_UserLevel1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UserLevel1",
	.tp_getset = py_spoolss_UserLevel1_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UserLevel1_new,
};


static PyObject *py_spoolss_UserLevel2_get_not_used(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel2 *object = pytalloc_get_ptr(obj);
	PyObject *py_not_used;
	py_not_used = PyLong_FromUnsignedLongLong((uint32_t)(object->not_used));
	return py_not_used;
}

static int py_spoolss_UserLevel2_set_not_used(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->not_used");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->not_used));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->not_used = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UserLevel2_getsetters[] = {
	{
		.name = discard_const_p(char, "not_used"),
		.get = py_spoolss_UserLevel2_get_not_used,
		.set = py_spoolss_UserLevel2_set_not_used,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UserLevel2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UserLevel2, type);
}


static PyTypeObject spoolss_UserLevel2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UserLevel2",
	.tp_getset = py_spoolss_UserLevel2_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UserLevel2_new,
};


static PyObject *py_spoolss_UserLevel3_get_size(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_UserLevel3_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->flags));
	return py_flags;
}

static int py_spoolss_UserLevel3_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_size2(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_size2;
	py_size2 = PyLong_FromUnsignedLongLong((uint32_t)(object->size2));
	return py_size2;
}

static int py_spoolss_UserLevel3_set_size2(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size2");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size2));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size2 = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_client(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_client;
	if (object->client == NULL) {
		Py_RETURN_NONE;
	}
	if (object->client == NULL) {
		py_client = Py_None;
		Py_INCREF(py_client);
	} else {
		if (object->client == NULL) {
			py_client = Py_None;
			Py_INCREF(py_client);
		} else {
			py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
		}
	}
	return py_client;
}

static int py_spoolss_UserLevel3_set_client(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->client");
		return -1;
	}
	if (value == Py_None) {
		object->client = NULL;
	} else {
		object->client = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->client = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_user(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_user;
	if (object->user == NULL) {
		Py_RETURN_NONE;
	}
	if (object->user == NULL) {
		py_user = Py_None;
		Py_INCREF(py_user);
	} else {
		if (object->user == NULL) {
			py_user = Py_None;
			Py_INCREF(py_user);
		} else {
			py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
		}
	}
	return py_user;
}

static int py_spoolss_UserLevel3_set_user(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user");
		return -1;
	}
	if (value == Py_None) {
		object->user = NULL;
	} else {
		object->user = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->user = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_build(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_build;
	py_build = PyLong_FromUnsignedLongLong((uint32_t)(object->build));
	return py_build;
}

static int py_spoolss_UserLevel3_set_build(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->build");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->build));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->build = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_major(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_major;
	py_major = PyLong_FromUnsignedLongLong((uint32_t)(object->major));
	return py_major;
}

static int py_spoolss_UserLevel3_set_major(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->major");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->major));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->major = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_minor(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_minor;
	py_minor = PyLong_FromUnsignedLongLong((uint32_t)(object->minor));
	return py_minor;
}

static int py_spoolss_UserLevel3_set_minor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->minor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->minor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->minor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_processor(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_processor;
	py_processor = PyLong_FromLong((uint16_t)(object->processor));
	return py_processor;
}

static int py_spoolss_UserLevel3_set_processor(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->processor");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->processor));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->processor = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevel3_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong(object->reserved);
	return py_reserved;
}

static int py_spoolss_UserLevel3_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevel3 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_UserLevel3_getsetters[] = {
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_UserLevel3_get_size,
		.set = py_spoolss_UserLevel3_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "flags"),
		.get = py_spoolss_UserLevel3_get_flags,
		.set = py_spoolss_UserLevel3_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "size2"),
		.get = py_spoolss_UserLevel3_get_size2,
		.set = py_spoolss_UserLevel3_set_size2,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "client"),
		.get = py_spoolss_UserLevel3_get_client,
		.set = py_spoolss_UserLevel3_set_client,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "user"),
		.get = py_spoolss_UserLevel3_get_user,
		.set = py_spoolss_UserLevel3_set_user,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "build"),
		.get = py_spoolss_UserLevel3_get_build,
		.set = py_spoolss_UserLevel3_set_build,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "major"),
		.get = py_spoolss_UserLevel3_get_major,
		.set = py_spoolss_UserLevel3_set_major,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MajorVersion")
	},
	{
		.name = discard_const_p(char, "minor"),
		.get = py_spoolss_UserLevel3_get_minor,
		.set = py_spoolss_UserLevel3_set_minor,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MinorVersion")
	},
	{
		.name = discard_const_p(char, "processor"),
		.get = py_spoolss_UserLevel3_get_processor,
		.set = py_spoolss_UserLevel3_set_processor,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ProcessorArchitecture")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_UserLevel3_get_reserved,
		.set = py_spoolss_UserLevel3_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type udlong")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UserLevel3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UserLevel3, type);
}


static PyTypeObject spoolss_UserLevel3_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UserLevel3",
	.tp_getset = py_spoolss_UserLevel3_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UserLevel3_new,
};

static PyObject *py_import_spoolss_UserLevel(TALLOC_CTX *mem_ctx, int level, union spoolss_UserLevel *in)
{
	PyObject *ret;

	switch (level) {
		case 1:
			if (in->level1 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_UserLevel1_Type, in->level1, in->level1);
			}
			return ret;

		case 2:
			if (in->level2 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_UserLevel2_Type, in->level2, in->level2);
			}
			return ret;

		case 3:
			if (in->level3 == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				ret = pytalloc_reference_ex(&spoolss_UserLevel3_Type, in->level3, in->level3);
			}
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_UserLevel *py_export_spoolss_UserLevel(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_UserLevel *ret = talloc_zero(mem_ctx, union spoolss_UserLevel);
	switch (level) {
		case 1:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->level1");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->level1 = NULL;
			} else {
				ret->level1 = NULL;
				PY_CHECK_TYPE(&spoolss_UserLevel1_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->level1 = (struct spoolss_UserLevel1 *)pytalloc_get_ptr(in);
			}
			break;

		case 2:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->level2");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->level2 = NULL;
			} else {
				ret->level2 = NULL;
				PY_CHECK_TYPE(&spoolss_UserLevel2_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->level2 = (struct spoolss_UserLevel2 *)pytalloc_get_ptr(in);
			}
			break;

		case 3:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->level3");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->level3 = NULL;
			} else {
				ret->level3 = NULL;
				PY_CHECK_TYPE(&spoolss_UserLevel3_Type, in, talloc_free(ret); return NULL;);
				if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
					PyErr_NoMemory();
					talloc_free(ret); return NULL;
				}
				ret->level3 = (struct spoolss_UserLevel3 *)pytalloc_get_ptr(in);
			}
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_UserLevel_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_UserLevel *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_UserLevel *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_UserLevel!");
		return NULL;
	}

	return py_import_spoolss_UserLevel(mem_ctx, level, in);
}

static PyObject *py_spoolss_UserLevel_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_UserLevel *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_UserLevel(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_UserLevel_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UserLevel_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UserLevel_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_UserLevel_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_UserLevel_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UserLevel",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_UserLevel_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UserLevel_new,
};


static PyObject *py_spoolss_UserLevelCtr_get_level(PyObject *obj, void *closure)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->level));
	return py_level;
}

static int py_spoolss_UserLevelCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_UserLevelCtr_get_user_info(PyObject *obj, void *closure)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(obj);
	PyObject *py_user_info;
	py_user_info = pyrpc_import_union(&spoolss_UserLevel_Type, pytalloc_get_mem_ctx(obj), object->level, &object->user_info, "union spoolss_UserLevel");
	if (py_user_info == NULL) {
		return NULL;
	}
	return py_user_info;
}

static int py_spoolss_UserLevelCtr_set_user_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->user_info");
		return -1;
	}
	{
		union spoolss_UserLevel *user_info_switch_0;
		user_info_switch_0 = (union spoolss_UserLevel *)pyrpc_export_union(&spoolss_UserLevel_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union spoolss_UserLevel");
		if (user_info_switch_0 == NULL) {
			return -1;
		}
		object->user_info = *user_info_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_UserLevelCtr_getsetters[] = {
	{
		.name = discard_const_p(char, "level"),
		.get = py_spoolss_UserLevelCtr_get_level,
		.set = py_spoolss_UserLevelCtr_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "user_info"),
		.get = py_spoolss_UserLevelCtr_get_user_info,
		.set = py_spoolss_UserLevelCtr_set_user_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_UserLevel")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_UserLevelCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_UserLevelCtr, type);
}

static PyObject *py_spoolss_UserLevelCtr_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_UserLevelCtr);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_UserLevelCtr_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_UserLevelCtr);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_UserLevelCtr);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_UserLevelCtr_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_UserLevelCtr *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_UserLevelCtr, "spoolss_UserLevelCtr", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_UserLevelCtr, "spoolss_UserLevelCtr", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_UserLevelCtr_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_UserLevelCtr_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UserLevelCtr_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_UserLevelCtr_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_UserLevelCtr_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.UserLevelCtr",
	.tp_getset = py_spoolss_UserLevelCtr_getsetters,
	.tp_methods = py_spoolss_UserLevelCtr_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_UserLevelCtr_new,
};


static PyObject *py_spoolss_PrinterEnumValues_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->value_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyString_FromStringOrNULL(object->value_name);
	}
	return py_value_name;
}

static int py_spoolss_PrinterEnumValues_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->value_name");
		return -1;
	}
	if (value == Py_None) {
		object->value_name = NULL;
	} else {
		object->value_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->value_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterEnumValues_get_value_name_len(PyObject *obj, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name_len;
	py_value_name_len = PyLong_FromUnsignedLongLong((uint32_t)(object->value_name_len));
	return py_value_name_len;
}

static int py_spoolss_PrinterEnumValues_set_value_name_len(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->value_name_len");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->value_name_len));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->value_name_len = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterEnumValues_get_type(PyObject *obj, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(object->type));
	return py_type;
}

static int py_spoolss_PrinterEnumValues_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrinterEnumValues_get_data(PyObject *obj, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->data == NULL) {
		Py_RETURN_NONE;
	}
	if (object->data == NULL) {
		py_data = Py_None;
		Py_INCREF(py_data);
	} else {
		py_data = PyBytes_FromStringAndSize((char *)(*object->data).data, (*object->data).length);
	}
	return py_data;
}

static int py_spoolss_PrinterEnumValues_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
		return -1;
	}
	if (value == Py_None) {
		object->data = NULL;
	} else {
		object->data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->data);
		if (object->data == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_PrinterEnumValues_get_data_length(PyObject *obj, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(obj);
	PyObject *py_data_length;
	py_data_length = PyLong_FromUnsignedLongLong((uint32_t)(object->data_length));
	return py_data_length;
}

static int py_spoolss_PrinterEnumValues_set_data_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data_length");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->data_length));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->data_length = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrinterEnumValues_getsetters[] = {
	{
		.name = discard_const_p(char, "value_name"),
		.get = py_spoolss_PrinterEnumValues_get_value_name,
		.set = py_spoolss_PrinterEnumValues_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{
		.name = discard_const_p(char, "value_name_len"),
		.get = py_spoolss_PrinterEnumValues_get_value_name_len,
		.set = py_spoolss_PrinterEnumValues_set_value_name_len,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "type"),
		.get = py_spoolss_PrinterEnumValues_get_type,
		.set = py_spoolss_PrinterEnumValues_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "data"),
		.get = py_spoolss_PrinterEnumValues_get_data,
		.set = py_spoolss_PrinterEnumValues_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "data_length"),
		.get = py_spoolss_PrinterEnumValues_get_data_length,
		.set = py_spoolss_PrinterEnumValues_set_data_length,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrinterEnumValues_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrinterEnumValues, type);
}

static PyObject *py_spoolss_PrinterEnumValues_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterEnumValues);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrinterEnumValues_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterEnumValues);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrinterEnumValues);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrinterEnumValues_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrinterEnumValues *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterEnumValues, "spoolss_PrinterEnumValues", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrinterEnumValues, "spoolss_PrinterEnumValues", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrinterEnumValues_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrinterEnumValues_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterEnumValues_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrinterEnumValues_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrinterEnumValues_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrinterEnumValues",
	.tp_getset = py_spoolss_PrinterEnumValues_getsetters,
	.tp_methods = py_spoolss_PrinterEnumValues_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrinterEnumValues_new,
};

static PyObject *py_import_spoolss_KeyNames(TALLOC_CTX *mem_ctx, int level, union spoolss_KeyNames *in)
{
	PyObject *ret;

	switch (level) {
		case 0:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

		case 1:
			ret = Py_None;
			Py_INCREF(ret);
			return ret;

		default:
			ret = pytalloc_GenericObject_reference_ex(mem_ctx, in->string_array);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_KeyNames *py_export_spoolss_KeyNames(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_KeyNames *ret = talloc_zero(mem_ctx, union spoolss_KeyNames);
	switch (level) {
		case 0:
			break;

		case 1:
			break;

		default:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->string_array");
				talloc_free(ret); return NULL;
			}
			ret->string_array = pytalloc_get_ptr(in);
			break;

	}

	return ret;
}

static PyObject *py_spoolss_KeyNames_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_KeyNames *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_KeyNames *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_KeyNames!");
		return NULL;
	}

	return py_import_spoolss_KeyNames(mem_ctx, level, in);
}

static PyObject *py_spoolss_KeyNames_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_KeyNames *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_KeyNames(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_KeyNames_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_KeyNames_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_KeyNames_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_KeyNames_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_KeyNames_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.KeyNames",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_KeyNames_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_KeyNames_new,
};


static PyObject *py_spoolss_PortData1_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		py_portname = PyUnicode_Decode(object->portname, strlen(object->portname), "utf-8", "ignore");
	}
	return py_portname;
}

static int py_spoolss_PortData1_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->portname = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_version(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_PortData1_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_protocol(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_protocol;
	py_protocol = PyLong_FromUnsignedLongLong((uint32_t)(object->protocol));
	return py_protocol;
}

static int py_spoolss_PortData1_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->protocol");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->protocol));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->protocol = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_size(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_PortData1_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_PortData1_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_hostaddress(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_hostaddress;
	if (object->hostaddress == NULL) {
		py_hostaddress = Py_None;
		Py_INCREF(py_hostaddress);
	} else {
		py_hostaddress = PyUnicode_Decode(object->hostaddress, strlen(object->hostaddress), "utf-8", "ignore");
	}
	return py_hostaddress;
}

static int py_spoolss_PortData1_set_hostaddress(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hostaddress");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->hostaddress = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_snmpcommunity(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmpcommunity;
	if (object->snmpcommunity == NULL) {
		py_snmpcommunity = Py_None;
		Py_INCREF(py_snmpcommunity);
	} else {
		py_snmpcommunity = PyUnicode_Decode(object->snmpcommunity, strlen(object->snmpcommunity), "utf-8", "ignore");
	}
	return py_snmpcommunity;
}

static int py_spoolss_PortData1_set_snmpcommunity(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmpcommunity");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->snmpcommunity = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_dblspool(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_dblspool;
	py_dblspool = PyLong_FromUnsignedLongLong((uint32_t)(object->dblspool));
	return py_dblspool;
}

static int py_spoolss_PortData1_set_dblspool(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dblspool");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dblspool));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dblspool = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_queue(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_queue;
	if (object->queue == NULL) {
		py_queue = Py_None;
		Py_INCREF(py_queue);
	} else {
		py_queue = PyUnicode_Decode(object->queue, strlen(object->queue), "utf-8", "ignore");
	}
	return py_queue;
}

static int py_spoolss_PortData1_set_queue(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->queue");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->queue = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_ip_address(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_ip_address;
	if (object->ip_address == NULL) {
		py_ip_address = Py_None;
		Py_INCREF(py_ip_address);
	} else {
		py_ip_address = PyUnicode_Decode(object->ip_address, strlen(object->ip_address), "utf-8", "ignore");
	}
	return py_ip_address;
}

static int py_spoolss_PortData1_set_ip_address(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ip_address");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->ip_address = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_hardware_address(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_hardware_address;
	if (object->hardware_address == NULL) {
		py_hardware_address = Py_None;
		Py_INCREF(py_hardware_address);
	} else {
		py_hardware_address = PyUnicode_Decode(object->hardware_address, strlen(object->hardware_address), "utf-8", "ignore");
	}
	return py_hardware_address;
}

static int py_spoolss_PortData1_set_hardware_address(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hardware_address");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->hardware_address = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_device_type(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_device_type;
	if (object->device_type == NULL) {
		py_device_type = Py_None;
		Py_INCREF(py_device_type);
	} else {
		py_device_type = PyUnicode_Decode(object->device_type, strlen(object->device_type), "utf-8", "ignore");
	}
	return py_device_type;
}

static int py_spoolss_PortData1_set_device_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_type");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->device_type = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_port_number(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_number;
	py_port_number = PyLong_FromUnsignedLongLong((uint32_t)(object->port_number));
	return py_port_number;
}

static int py_spoolss_PortData1_set_port_number(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_number");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port_number));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->port_number = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_snmp_enabled(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmp_enabled;
	py_snmp_enabled = PyLong_FromUnsignedLongLong((uint32_t)(object->snmp_enabled));
	return py_snmp_enabled;
}

static int py_spoolss_PortData1_set_snmp_enabled(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmp_enabled");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->snmp_enabled));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->snmp_enabled = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData1_get_snmp_dev_index(PyObject *obj, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmp_dev_index;
	py_snmp_dev_index = PyLong_FromUnsignedLongLong((uint32_t)(object->snmp_dev_index));
	return py_snmp_dev_index;
}

static int py_spoolss_PortData1_set_snmp_dev_index(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmp_dev_index");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->snmp_dev_index));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->snmp_dev_index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortData1_getsetters[] = {
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_PortData1_get_portname,
		.set = py_spoolss_PortData1_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_PortData1_get_version,
		.set = py_spoolss_PortData1_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "protocol"),
		.get = py_spoolss_PortData1_get_protocol,
		.set = py_spoolss_PortData1_set_protocol,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortProtocol")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_PortData1_get_size,
		.set = py_spoolss_PortData1_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_PortData1_get_reserved,
		.set = py_spoolss_PortData1_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "hostaddress"),
		.get = py_spoolss_PortData1_get_hostaddress,
		.set = py_spoolss_PortData1_set_hostaddress,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "snmpcommunity"),
		.get = py_spoolss_PortData1_get_snmpcommunity,
		.set = py_spoolss_PortData1_set_snmpcommunity,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dblspool"),
		.get = py_spoolss_PortData1_get_dblspool,
		.set = py_spoolss_PortData1_set_dblspool,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "queue"),
		.get = py_spoolss_PortData1_get_queue,
		.set = py_spoolss_PortData1_set_queue,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "ip_address"),
		.get = py_spoolss_PortData1_get_ip_address,
		.set = py_spoolss_PortData1_set_ip_address,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "hardware_address"),
		.get = py_spoolss_PortData1_get_hardware_address,
		.set = py_spoolss_PortData1_set_hardware_address,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "device_type"),
		.get = py_spoolss_PortData1_get_device_type,
		.set = py_spoolss_PortData1_set_device_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "port_number"),
		.get = py_spoolss_PortData1_get_port_number,
		.set = py_spoolss_PortData1_set_port_number,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "snmp_enabled"),
		.get = py_spoolss_PortData1_get_snmp_enabled,
		.set = py_spoolss_PortData1_set_snmp_enabled,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "snmp_dev_index"),
		.get = py_spoolss_PortData1_get_snmp_dev_index,
		.set = py_spoolss_PortData1_set_snmp_dev_index,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortData1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortData1, type);
}

static PyObject *py_spoolss_PortData1_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortData1);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortData1_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortData1);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortData1);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortData1_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortData1 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortData1, "spoolss_PortData1", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortData1, "spoolss_PortData1", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortData1_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortData1_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortData1_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortData1_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortData1_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortData1",
	.tp_getset = py_spoolss_PortData1_getsetters,
	.tp_methods = py_spoolss_PortData1_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortData1_new,
};


static PyObject *py_spoolss_PortData2_get_portname(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_portname;
	if (object->portname == NULL) {
		py_portname = Py_None;
		Py_INCREF(py_portname);
	} else {
		py_portname = PyUnicode_Decode(object->portname, strlen(object->portname), "utf-8", "ignore");
	}
	return py_portname;
}

static int py_spoolss_PortData2_set_portname(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->portname");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->portname = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_version(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->version));
	return py_version;
}

static int py_spoolss_PortData2_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_protocol(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_protocol;
	py_protocol = PyLong_FromUnsignedLongLong((uint32_t)(object->protocol));
	return py_protocol;
}

static int py_spoolss_PortData2_set_protocol(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->protocol");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->protocol));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->protocol = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_size(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_size;
	py_size = PyLong_FromUnsignedLongLong((uint32_t)(object->size));
	return py_size;
}

static int py_spoolss_PortData2_set_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_reserved(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_reserved;
	py_reserved = PyLong_FromUnsignedLongLong((uint32_t)(object->reserved));
	return py_reserved;
}

static int py_spoolss_PortData2_set_reserved(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->reserved");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->reserved));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->reserved = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_hostaddress(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_hostaddress;
	if (object->hostaddress == NULL) {
		py_hostaddress = Py_None;
		Py_INCREF(py_hostaddress);
	} else {
		py_hostaddress = PyUnicode_Decode(object->hostaddress, strlen(object->hostaddress), "utf-8", "ignore");
	}
	return py_hostaddress;
}

static int py_spoolss_PortData2_set_hostaddress(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->hostaddress");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->hostaddress = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_snmpcommunity(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmpcommunity;
	if (object->snmpcommunity == NULL) {
		py_snmpcommunity = Py_None;
		Py_INCREF(py_snmpcommunity);
	} else {
		py_snmpcommunity = PyUnicode_Decode(object->snmpcommunity, strlen(object->snmpcommunity), "utf-8", "ignore");
	}
	return py_snmpcommunity;
}

static int py_spoolss_PortData2_set_snmpcommunity(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmpcommunity");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->snmpcommunity = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_dblspool(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_dblspool;
	py_dblspool = PyLong_FromUnsignedLongLong((uint32_t)(object->dblspool));
	return py_dblspool;
}

static int py_spoolss_PortData2_set_dblspool(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dblspool");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dblspool));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dblspool = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_queue(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_queue;
	if (object->queue == NULL) {
		py_queue = Py_None;
		Py_INCREF(py_queue);
	} else {
		py_queue = PyUnicode_Decode(object->queue, strlen(object->queue), "utf-8", "ignore");
	}
	return py_queue;
}

static int py_spoolss_PortData2_set_queue(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->queue");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->queue = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_device_type(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_device_type;
	if (object->device_type == NULL) {
		py_device_type = Py_None;
		Py_INCREF(py_device_type);
	} else {
		py_device_type = PyUnicode_Decode(object->device_type, strlen(object->device_type), "utf-8", "ignore");
	}
	return py_device_type;
}

static int py_spoolss_PortData2_set_device_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->device_type");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->device_type = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_port_number(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_number;
	py_port_number = PyLong_FromUnsignedLongLong((uint32_t)(object->port_number));
	return py_port_number;
}

static int py_spoolss_PortData2_set_port_number(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_number");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port_number));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->port_number = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_snmp_enabled(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmp_enabled;
	py_snmp_enabled = PyLong_FromUnsignedLongLong((uint32_t)(object->snmp_enabled));
	return py_snmp_enabled;
}

static int py_spoolss_PortData2_set_snmp_enabled(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmp_enabled");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->snmp_enabled));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->snmp_enabled = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_snmp_dev_index(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_snmp_dev_index;
	py_snmp_dev_index = PyLong_FromUnsignedLongLong((uint32_t)(object->snmp_dev_index));
	return py_snmp_dev_index;
}

static int py_spoolss_PortData2_set_snmp_dev_index(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->snmp_dev_index");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->snmp_dev_index));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->snmp_dev_index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PortData2_get_port_monitor_mib_index(PyObject *obj, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(obj);
	PyObject *py_port_monitor_mib_index;
	py_port_monitor_mib_index = PyLong_FromUnsignedLongLong((uint32_t)(object->port_monitor_mib_index));
	return py_port_monitor_mib_index;
}

static int py_spoolss_PortData2_set_port_monitor_mib_index(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->port_monitor_mib_index");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->port_monitor_mib_index));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->port_monitor_mib_index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_PortData2_getsetters[] = {
	{
		.name = discard_const_p(char, "portname"),
		.get = py_spoolss_PortData2_get_portname,
		.set = py_spoolss_PortData2_set_portname,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "version"),
		.get = py_spoolss_PortData2_get_version,
		.set = py_spoolss_PortData2_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "protocol"),
		.get = py_spoolss_PortData2_get_protocol,
		.set = py_spoolss_PortData2_set_protocol,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortProtocol")
	},
	{
		.name = discard_const_p(char, "size"),
		.get = py_spoolss_PortData2_get_size,
		.set = py_spoolss_PortData2_set_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "reserved"),
		.get = py_spoolss_PortData2_get_reserved,
		.set = py_spoolss_PortData2_set_reserved,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "hostaddress"),
		.get = py_spoolss_PortData2_get_hostaddress,
		.set = py_spoolss_PortData2_set_hostaddress,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "snmpcommunity"),
		.get = py_spoolss_PortData2_get_snmpcommunity,
		.set = py_spoolss_PortData2_set_snmpcommunity,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "dblspool"),
		.get = py_spoolss_PortData2_get_dblspool,
		.set = py_spoolss_PortData2_set_dblspool,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "queue"),
		.get = py_spoolss_PortData2_get_queue,
		.set = py_spoolss_PortData2_set_queue,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "device_type"),
		.get = py_spoolss_PortData2_get_device_type,
		.set = py_spoolss_PortData2_set_device_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "port_number"),
		.get = py_spoolss_PortData2_get_port_number,
		.set = py_spoolss_PortData2_set_port_number,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "snmp_enabled"),
		.get = py_spoolss_PortData2_get_snmp_enabled,
		.set = py_spoolss_PortData2_set_snmp_enabled,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "snmp_dev_index"),
		.get = py_spoolss_PortData2_get_snmp_dev_index,
		.set = py_spoolss_PortData2_set_snmp_dev_index,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "port_monitor_mib_index"),
		.get = py_spoolss_PortData2_get_port_monitor_mib_index,
		.set = py_spoolss_PortData2_set_port_monitor_mib_index,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PortData2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PortData2, type);
}

static PyObject *py_spoolss_PortData2_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PortData2);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PortData2_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortData2);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PortData2);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PortData2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PortData2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortData2, "spoolss_PortData2", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PortData2, "spoolss_PortData2", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PortData2_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PortData2_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortData2_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PortData2_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PortData2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PortData2",
	.tp_getset = py_spoolss_PortData2_getsetters,
	.tp_methods = py_spoolss_PortData2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PortData2_new,
};


static PyObject *py_spoolss_MonitorUi_get_dll_name(PyObject *obj, void *closure)
{
	struct spoolss_MonitorUi *object = pytalloc_get_ptr(obj);
	PyObject *py_dll_name;
	py_dll_name = PyString_FromStringOrNULL(object->dll_name);
	return py_dll_name;
}

static int py_spoolss_MonitorUi_set_dll_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_MonitorUi *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dll_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->dll_name = talloc_str;
	}
	return 0;
}

static PyGetSetDef py_spoolss_MonitorUi_getsetters[] = {
	{
		.name = discard_const_p(char, "dll_name"),
		.get = py_spoolss_MonitorUi_get_dll_name,
		.set = py_spoolss_MonitorUi_set_dll_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type string")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_MonitorUi_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_MonitorUi, type);
}

static PyObject *py_spoolss_MonitorUi_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_MonitorUi *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorUi);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_MonitorUi_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorUi *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorUi);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_MonitorUi);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_MonitorUi_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_MonitorUi *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorUi, "spoolss_MonitorUi", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_MonitorUi, "spoolss_MonitorUi", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_MonitorUi_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_MonitorUi_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorUi_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_MonitorUi_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_MonitorUi_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.MonitorUi",
	.tp_getset = py_spoolss_MonitorUi_getsetters,
	.tp_methods = py_spoolss_MonitorUi_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_MonitorUi_new,
};


static PyObject *py_RPC_BINARY_CONTAINER_get_cbBuf(PyObject *obj, void *closure)
{
	struct RPC_BINARY_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_cbBuf;
	py_cbBuf = PyLong_FromUnsignedLongLong((uint32_t)(object->cbBuf));
	return py_cbBuf;
}

static int py_RPC_BINARY_CONTAINER_set_cbBuf(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BINARY_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cbBuf");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cbBuf));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cbBuf = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BINARY_CONTAINER_get_pszString(PyObject *obj, void *closure)
{
	struct RPC_BINARY_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_pszString;
	if (object->pszString == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pszString == NULL) {
		py_pszString = Py_None;
		Py_INCREF(py_pszString);
	} else {
		py_pszString = PyList_New(object->cbBuf);
		if (py_pszString == NULL) {
			return NULL;
		}
		{
			int pszString_cntr_1;
			for (pszString_cntr_1 = 0; pszString_cntr_1 < (object->cbBuf); pszString_cntr_1++) {
				PyObject *py_pszString_1;
				py_pszString_1 = PyLong_FromLong((uint16_t)((object->pszString)[pszString_cntr_1]));
				PyList_SetItem(py_pszString, pszString_cntr_1, py_pszString_1);
			}
		}
	}
	return py_pszString;
}

static int py_RPC_BINARY_CONTAINER_set_pszString(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BINARY_CONTAINER *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pszString));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pszString");
		return -1;
	}
	if (value == Py_None) {
		object->pszString = NULL;
	} else {
		object->pszString = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int pszString_cntr_1;
			object->pszString = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pszString, PyList_GET_SIZE(value));
			if (!object->pszString) { return -1; }
			talloc_set_name_const(object->pszString, "ARRAY: object->pszString");
			for (pszString_cntr_1 = 0; pszString_cntr_1 < PyList_GET_SIZE(value); pszString_cntr_1++) {
				if (PyList_GET_ITEM(value, pszString_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->pszString)[pszString_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->pszString)[pszString_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, pszString_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pszString_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->pszString)[pszString_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_RPC_BINARY_CONTAINER_getsetters[] = {
	{
		.name = discard_const_p(char, "cbBuf"),
		.get = py_RPC_BINARY_CONTAINER_get_cbBuf,
		.set = py_RPC_BINARY_CONTAINER_set_cbBuf,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pszString"),
		.get = py_RPC_BINARY_CONTAINER_get_pszString,
		.set = py_RPC_BINARY_CONTAINER_set_pszString,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BINARY_CONTAINER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BINARY_CONTAINER, type);
}


static PyTypeObject RPC_BINARY_CONTAINER_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BINARY_CONTAINER",
	.tp_getset = py_RPC_BINARY_CONTAINER_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BINARY_CONTAINER_new,
};

static PyObject *py_import_RPC_BIDI_DATA_u(TALLOC_CTX *mem_ctx, int level, union RPC_BIDI_DATA_u *in)
{
	PyObject *ret;

	switch (level) {
		case BIDI_NULL:
			ret = PyLong_FromUnsignedLongLong((uint32_t)(in->bData));
			return ret;

		case BIDI_BOOL:
			ret = PyLong_FromUnsignedLongLong((uint32_t)(in->bData));
			return ret;

		case BIDI_INT:
			ret = PyLong_FromUnsignedLongLong((uint32_t)(in->iData));
			return ret;

		case BIDI_STRING:
			if (in->sData == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				if (in->sData == NULL) {
					ret = Py_None;
					Py_INCREF(ret);
				} else {
					ret = PyUnicode_Decode(in->sData, strlen(in->sData), "utf-8", "ignore");
				}
			}
			return ret;

		case BIDI_TEXT:
			if (in->sData == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				if (in->sData == NULL) {
					ret = Py_None;
					Py_INCREF(ret);
				} else {
					ret = PyUnicode_Decode(in->sData, strlen(in->sData), "utf-8", "ignore");
				}
			}
			return ret;

		case BIDI_ENUM:
			if (in->sData == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				if (in->sData == NULL) {
					ret = Py_None;
					Py_INCREF(ret);
				} else {
					ret = PyUnicode_Decode(in->sData, strlen(in->sData), "utf-8", "ignore");
				}
			}
			return ret;

		case BIDI_BLOB:
			ret = pytalloc_reference_ex(&RPC_BINARY_CONTAINER_Type, mem_ctx, &in->biData);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union RPC_BIDI_DATA_u *py_export_RPC_BIDI_DATA_u(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union RPC_BIDI_DATA_u *ret = talloc_zero(mem_ctx, union RPC_BIDI_DATA_u);
	switch (level) {
		case BIDI_NULL:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bData");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->bData));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->bData = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case BIDI_BOOL:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->bData");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->bData));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->bData = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case BIDI_INT:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->iData");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->iData));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->iData = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case BIDI_STRING:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sData");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->sData = NULL;
			} else {
				ret->sData = NULL;
				{
					const char *test_str;
					const char *talloc_str;
					PyObject *unicode = NULL;
					if (PyUnicode_Check(in)) {
						unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
						if (unicode == NULL) {
							talloc_free(ret); return NULL;
						}
						test_str = PyBytes_AS_STRING(unicode);
					} else if (PyBytes_Check(in)) {
						test_str = PyBytes_AS_STRING(in);
					} else {
						PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
						talloc_free(ret); return NULL;
					}
					talloc_str = talloc_strdup(mem_ctx, test_str);
					if (unicode != NULL) {
						Py_DECREF(unicode);
					}
					if (talloc_str == NULL) {
						PyErr_NoMemory();
						talloc_free(ret); return NULL;
					}
					ret->sData = talloc_str;
				}
			}
			break;

		case BIDI_TEXT:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sData");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->sData = NULL;
			} else {
				ret->sData = NULL;
				{
					const char *test_str;
					const char *talloc_str;
					PyObject *unicode = NULL;
					if (PyUnicode_Check(in)) {
						unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
						if (unicode == NULL) {
							talloc_free(ret); return NULL;
						}
						test_str = PyBytes_AS_STRING(unicode);
					} else if (PyBytes_Check(in)) {
						test_str = PyBytes_AS_STRING(in);
					} else {
						PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
						talloc_free(ret); return NULL;
					}
					talloc_str = talloc_strdup(mem_ctx, test_str);
					if (unicode != NULL) {
						Py_DECREF(unicode);
					}
					if (talloc_str == NULL) {
						PyErr_NoMemory();
						talloc_free(ret); return NULL;
					}
					ret->sData = talloc_str;
				}
			}
			break;

		case BIDI_ENUM:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->sData");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->sData = NULL;
			} else {
				ret->sData = NULL;
				{
					const char *test_str;
					const char *talloc_str;
					PyObject *unicode = NULL;
					if (PyUnicode_Check(in)) {
						unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
						if (unicode == NULL) {
							talloc_free(ret); return NULL;
						}
						test_str = PyBytes_AS_STRING(unicode);
					} else if (PyBytes_Check(in)) {
						test_str = PyBytes_AS_STRING(in);
					} else {
						PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
						talloc_free(ret); return NULL;
					}
					talloc_str = talloc_strdup(mem_ctx, test_str);
					if (unicode != NULL) {
						Py_DECREF(unicode);
					}
					if (talloc_str == NULL) {
						PyErr_NoMemory();
						talloc_free(ret); return NULL;
					}
					ret->sData = talloc_str;
				}
			}
			break;

		case BIDI_BLOB:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->biData");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&RPC_BINARY_CONTAINER_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->biData = *(struct RPC_BINARY_CONTAINER *)pytalloc_get_ptr(in);
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_RPC_BIDI_DATA_u_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union RPC_BIDI_DATA_u *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union RPC_BIDI_DATA_u *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union RPC_BIDI_DATA_u!");
		return NULL;
	}

	return py_import_RPC_BIDI_DATA_u(mem_ctx, level, in);
}

static PyObject *py_RPC_BIDI_DATA_u_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union RPC_BIDI_DATA_u *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_RPC_BIDI_DATA_u(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_RPC_BIDI_DATA_u_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_DATA_u_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_DATA_u_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_RPC_BIDI_DATA_u_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject RPC_BIDI_DATA_u_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_DATA_u",
	.tp_getset = NULL,
	.tp_methods = py_RPC_BIDI_DATA_u_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_DATA_u_new,
};


static PyObject *py_RPC_BIDI_DATA_get_dwBidiType(PyObject *obj, void *closure)
{
	struct RPC_BIDI_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwBidiType;
	py_dwBidiType = PyLong_FromUnsignedLongLong((uint32_t)(object->dwBidiType));
	return py_dwBidiType;
}

static int py_RPC_BIDI_DATA_set_dwBidiType(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwBidiType");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwBidiType));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwBidiType = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_DATA_get_u(PyObject *obj, void *closure)
{
	struct RPC_BIDI_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_u;
	py_u = pyrpc_import_union(&RPC_BIDI_DATA_u_Type, pytalloc_get_mem_ctx(obj), object->dwBidiType, &object->u, "union RPC_BIDI_DATA_u");
	if (py_u == NULL) {
		return NULL;
	}
	return py_u;
}

static int py_RPC_BIDI_DATA_set_u(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->u");
		return -1;
	}
	{
		union RPC_BIDI_DATA_u *u_switch_0;
		u_switch_0 = (union RPC_BIDI_DATA_u *)pyrpc_export_union(&RPC_BIDI_DATA_u_Type, pytalloc_get_mem_ctx(py_obj), object->dwBidiType, value, "union RPC_BIDI_DATA_u");
		if (u_switch_0 == NULL) {
			return -1;
		}
		object->u = *u_switch_0;
	}
	return 0;
}

static PyGetSetDef py_RPC_BIDI_DATA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwBidiType"),
		.get = py_RPC_BIDI_DATA_get_dwBidiType,
		.set = py_RPC_BIDI_DATA_set_dwBidiType,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "u"),
		.get = py_RPC_BIDI_DATA_get_u,
		.set = py_RPC_BIDI_DATA_set_u,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_DATA_u")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BIDI_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BIDI_DATA, type);
}


static PyTypeObject RPC_BIDI_DATA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_DATA",
	.tp_getset = py_RPC_BIDI_DATA_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_DATA_new,
};


static PyObject *py_RPC_BIDI_REQUEST_DATA_get_dwReqNumber(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReqNumber;
	py_dwReqNumber = PyLong_FromUnsignedLongLong((uint32_t)(object->dwReqNumber));
	return py_dwReqNumber;
}

static int py_RPC_BIDI_REQUEST_DATA_set_dwReqNumber(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReqNumber");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReqNumber));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwReqNumber = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_REQUEST_DATA_get_pSchema(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_pSchema;
	if (object->pSchema == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pSchema == NULL) {
		py_pSchema = Py_None;
		Py_INCREF(py_pSchema);
	} else {
		if (object->pSchema == NULL) {
			py_pSchema = Py_None;
			Py_INCREF(py_pSchema);
		} else {
			py_pSchema = PyUnicode_Decode(object->pSchema, strlen(object->pSchema), "utf-8", "ignore");
		}
	}
	return py_pSchema;
}

static int py_RPC_BIDI_REQUEST_DATA_set_pSchema(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pSchema");
		return -1;
	}
	if (value == Py_None) {
		object->pSchema = NULL;
	} else {
		object->pSchema = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pSchema = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_REQUEST_DATA_get_data(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	py_data = pytalloc_reference_ex(&RPC_BIDI_DATA_Type, pytalloc_get_mem_ctx(obj), &object->data);
	return py_data;
}

static int py_RPC_BIDI_REQUEST_DATA_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
		return -1;
	}
	PY_CHECK_TYPE(&RPC_BIDI_DATA_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->data = *(struct RPC_BIDI_DATA *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_RPC_BIDI_REQUEST_DATA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwReqNumber"),
		.get = py_RPC_BIDI_REQUEST_DATA_get_dwReqNumber,
		.set = py_RPC_BIDI_REQUEST_DATA_set_dwReqNumber,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pSchema"),
		.get = py_RPC_BIDI_REQUEST_DATA_get_pSchema,
		.set = py_RPC_BIDI_REQUEST_DATA_set_pSchema,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data"),
		.get = py_RPC_BIDI_REQUEST_DATA_get_data,
		.set = py_RPC_BIDI_REQUEST_DATA_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_DATA")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BIDI_REQUEST_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BIDI_REQUEST_DATA, type);
}


static PyTypeObject RPC_BIDI_REQUEST_DATA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_REQUEST_DATA",
	.tp_getset = py_RPC_BIDI_REQUEST_DATA_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_REQUEST_DATA_new,
};


static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_get_Version(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Version;
	py_Version = PyLong_FromUnsignedLongLong((uint32_t)(object->Version));
	return py_Version;
}

static int py_RPC_BIDI_REQUEST_CONTAINER_set_Version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_get_Flags(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Flags;
	py_Flags = PyLong_FromUnsignedLongLong((uint32_t)(object->Flags));
	return py_Flags;
}

static int py_RPC_BIDI_REQUEST_CONTAINER_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_get_Count(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Count;
	py_Count = PyLong_FromUnsignedLongLong((uint32_t)(object->Count));
	return py_Count;
}

static int py_RPC_BIDI_REQUEST_CONTAINER_set_Count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_get_aData(PyObject *obj, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_aData;
	py_aData = PyList_New(object->Count);
	if (py_aData == NULL) {
		return NULL;
	}
	{
		int aData_cntr_0;
		for (aData_cntr_0 = 0; aData_cntr_0 < (object->Count); aData_cntr_0++) {
			PyObject *py_aData_0;
			if ((object->aData)[aData_cntr_0] == NULL) {
				py_aData_0 = Py_None;
				Py_INCREF(py_aData_0);
			} else {
				py_aData_0 = pytalloc_reference_ex(&RPC_BIDI_REQUEST_DATA_Type, (object->aData)[aData_cntr_0], (object->aData)[aData_cntr_0]);
			}
			PyList_SetItem(py_aData, aData_cntr_0, py_aData_0);
		}
	}
	return py_aData;
}

static int py_RPC_BIDI_REQUEST_CONTAINER_set_aData(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aData");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aData_cntr_0;
		object->aData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->aData, PyList_GET_SIZE(value));
		if (!object->aData) { return -1; }
		talloc_set_name_const(object->aData, "ARRAY: object->aData");
		for (aData_cntr_0 = 0; aData_cntr_0 < PyList_GET_SIZE(value); aData_cntr_0++) {
			if (PyList_GET_ITEM(value, aData_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aData)[aData_cntr_0]");
				return -1;
			}
			if (PyList_GET_ITEM(value, aData_cntr_0) == Py_None) {
				(object->aData)[aData_cntr_0] = NULL;
			} else {
				(object->aData)[aData_cntr_0] = NULL;
				PY_CHECK_TYPE(&RPC_BIDI_REQUEST_DATA_Type, PyList_GET_ITEM(value, aData_cntr_0), return -1;);
				if (talloc_reference(object->aData, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, aData_cntr_0))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(object->aData)[aData_cntr_0] = (struct RPC_BIDI_REQUEST_DATA *)pytalloc_get_ptr(PyList_GET_ITEM(value, aData_cntr_0));
			}
		}
	}
	return 0;
}

static PyGetSetDef py_RPC_BIDI_REQUEST_CONTAINER_getsetters[] = {
	{
		.name = discard_const_p(char, "Version"),
		.get = py_RPC_BIDI_REQUEST_CONTAINER_get_Version,
		.set = py_RPC_BIDI_REQUEST_CONTAINER_set_Version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Flags"),
		.get = py_RPC_BIDI_REQUEST_CONTAINER_get_Flags,
		.set = py_RPC_BIDI_REQUEST_CONTAINER_set_Flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Count"),
		.get = py_RPC_BIDI_REQUEST_CONTAINER_get_Count,
		.set = py_RPC_BIDI_REQUEST_CONTAINER_set_Count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aData"),
		.get = py_RPC_BIDI_REQUEST_CONTAINER_get_aData,
		.set = py_RPC_BIDI_REQUEST_CONTAINER_set_aData,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_REQUEST_DATA")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BIDI_REQUEST_CONTAINER, type);
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_RPC_BIDI_REQUEST_CONTAINER);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RPC_BIDI_REQUEST_CONTAINER);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RPC_BIDI_REQUEST_CONTAINER);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_RPC_BIDI_REQUEST_CONTAINER_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct RPC_BIDI_REQUEST_CONTAINER *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RPC_BIDI_REQUEST_CONTAINER, "RPC_BIDI_REQUEST_CONTAINER", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RPC_BIDI_REQUEST_CONTAINER, "RPC_BIDI_REQUEST_CONTAINER", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_RPC_BIDI_REQUEST_CONTAINER_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_RPC_BIDI_REQUEST_CONTAINER_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_REQUEST_CONTAINER_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_REQUEST_CONTAINER_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject RPC_BIDI_REQUEST_CONTAINER_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_REQUEST_CONTAINER",
	.tp_getset = py_RPC_BIDI_REQUEST_CONTAINER_getsetters,
	.tp_methods = py_RPC_BIDI_REQUEST_CONTAINER_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_REQUEST_CONTAINER_new,
};


static PyObject *py_RPC_BIDI_RESPONSE_DATA_get_dwResult(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwResult;
	py_dwResult = PyLong_FromUnsignedLongLong((uint32_t)(object->dwResult));
	return py_dwResult;
}

static int py_RPC_BIDI_RESPONSE_DATA_set_dwResult(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwResult");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwResult));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwResult = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_DATA_get_dwReqNumber(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_dwReqNumber;
	py_dwReqNumber = PyLong_FromUnsignedLongLong((uint32_t)(object->dwReqNumber));
	return py_dwReqNumber;
}

static int py_RPC_BIDI_RESPONSE_DATA_set_dwReqNumber(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->dwReqNumber");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dwReqNumber));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->dwReqNumber = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_DATA_get_pSchema(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_pSchema;
	if (object->pSchema == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pSchema == NULL) {
		py_pSchema = Py_None;
		Py_INCREF(py_pSchema);
	} else {
		if (object->pSchema == NULL) {
			py_pSchema = Py_None;
			Py_INCREF(py_pSchema);
		} else {
			py_pSchema = PyUnicode_Decode(object->pSchema, strlen(object->pSchema), "utf-8", "ignore");
		}
	}
	return py_pSchema;
}

static int py_RPC_BIDI_RESPONSE_DATA_set_pSchema(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pSchema");
		return -1;
	}
	if (value == Py_None) {
		object->pSchema = NULL;
	} else {
		object->pSchema = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pSchema = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_DATA_get_data(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	py_data = pytalloc_reference_ex(&RPC_BIDI_DATA_Type, pytalloc_get_mem_ctx(obj), &object->data);
	return py_data;
}

static int py_RPC_BIDI_RESPONSE_DATA_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_DATA *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->data");
		return -1;
	}
	PY_CHECK_TYPE(&RPC_BIDI_DATA_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->data = *(struct RPC_BIDI_DATA *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_RPC_BIDI_RESPONSE_DATA_getsetters[] = {
	{
		.name = discard_const_p(char, "dwResult"),
		.get = py_RPC_BIDI_RESPONSE_DATA_get_dwResult,
		.set = py_RPC_BIDI_RESPONSE_DATA_set_dwResult,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "dwReqNumber"),
		.get = py_RPC_BIDI_RESPONSE_DATA_get_dwReqNumber,
		.set = py_RPC_BIDI_RESPONSE_DATA_set_dwReqNumber,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pSchema"),
		.get = py_RPC_BIDI_RESPONSE_DATA_get_pSchema,
		.set = py_RPC_BIDI_RESPONSE_DATA_set_pSchema,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "data"),
		.get = py_RPC_BIDI_RESPONSE_DATA_get_data,
		.set = py_RPC_BIDI_RESPONSE_DATA_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_DATA")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BIDI_RESPONSE_DATA_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BIDI_RESPONSE_DATA, type);
}


static PyTypeObject RPC_BIDI_RESPONSE_DATA_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_RESPONSE_DATA",
	.tp_getset = py_RPC_BIDI_RESPONSE_DATA_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_RESPONSE_DATA_new,
};


static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_get_Version(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Version;
	py_Version = PyLong_FromUnsignedLongLong((uint32_t)(object->Version));
	return py_Version;
}

static int py_RPC_BIDI_RESPONSE_CONTAINER_set_Version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_get_Flags(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Flags;
	py_Flags = PyLong_FromUnsignedLongLong((uint32_t)(object->Flags));
	return py_Flags;
}

static int py_RPC_BIDI_RESPONSE_CONTAINER_set_Flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_get_Count(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_Count;
	py_Count = PyLong_FromUnsignedLongLong((uint32_t)(object->Count));
	return py_Count;
}

static int py_RPC_BIDI_RESPONSE_CONTAINER_set_Count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_get_aData(PyObject *obj, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(obj);
	PyObject *py_aData;
	py_aData = PyList_New(object->Count);
	if (py_aData == NULL) {
		return NULL;
	}
	{
		int aData_cntr_0;
		for (aData_cntr_0 = 0; aData_cntr_0 < (object->Count); aData_cntr_0++) {
			PyObject *py_aData_0;
			if ((object->aData)[aData_cntr_0] == NULL) {
				py_aData_0 = Py_None;
				Py_INCREF(py_aData_0);
			} else {
				py_aData_0 = pytalloc_reference_ex(&RPC_BIDI_RESPONSE_DATA_Type, (object->aData)[aData_cntr_0], (object->aData)[aData_cntr_0]);
			}
			PyList_SetItem(py_aData, aData_cntr_0, py_aData_0);
		}
	}
	return py_aData;
}

static int py_RPC_BIDI_RESPONSE_CONTAINER_set_aData(PyObject *py_obj, PyObject *value, void *closure)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->aData");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int aData_cntr_0;
		object->aData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->aData, PyList_GET_SIZE(value));
		if (!object->aData) { return -1; }
		talloc_set_name_const(object->aData, "ARRAY: object->aData");
		for (aData_cntr_0 = 0; aData_cntr_0 < PyList_GET_SIZE(value); aData_cntr_0++) {
			if (PyList_GET_ITEM(value, aData_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->aData)[aData_cntr_0]");
				return -1;
			}
			if (PyList_GET_ITEM(value, aData_cntr_0) == Py_None) {
				(object->aData)[aData_cntr_0] = NULL;
			} else {
				(object->aData)[aData_cntr_0] = NULL;
				PY_CHECK_TYPE(&RPC_BIDI_RESPONSE_DATA_Type, PyList_GET_ITEM(value, aData_cntr_0), return -1;);
				if (talloc_reference(object->aData, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, aData_cntr_0))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(object->aData)[aData_cntr_0] = (struct RPC_BIDI_RESPONSE_DATA *)pytalloc_get_ptr(PyList_GET_ITEM(value, aData_cntr_0));
			}
		}
	}
	return 0;
}

static PyGetSetDef py_RPC_BIDI_RESPONSE_CONTAINER_getsetters[] = {
	{
		.name = discard_const_p(char, "Version"),
		.get = py_RPC_BIDI_RESPONSE_CONTAINER_get_Version,
		.set = py_RPC_BIDI_RESPONSE_CONTAINER_set_Version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Flags"),
		.get = py_RPC_BIDI_RESPONSE_CONTAINER_get_Flags,
		.set = py_RPC_BIDI_RESPONSE_CONTAINER_set_Flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Count"),
		.get = py_RPC_BIDI_RESPONSE_CONTAINER_get_Count,
		.set = py_RPC_BIDI_RESPONSE_CONTAINER_set_Count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "aData"),
		.get = py_RPC_BIDI_RESPONSE_CONTAINER_get_aData,
		.set = py_RPC_BIDI_RESPONSE_CONTAINER_set_aData,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_RESPONSE_DATA")
	},
	{ .name = NULL }
};

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct RPC_BIDI_RESPONSE_CONTAINER, type);
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_RPC_BIDI_RESPONSE_CONTAINER);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RPC_BIDI_RESPONSE_CONTAINER);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_RPC_BIDI_RESPONSE_CONTAINER);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_RPC_BIDI_RESPONSE_CONTAINER_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct RPC_BIDI_RESPONSE_CONTAINER *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RPC_BIDI_RESPONSE_CONTAINER, "RPC_BIDI_RESPONSE_CONTAINER", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_RPC_BIDI_RESPONSE_CONTAINER, "RPC_BIDI_RESPONSE_CONTAINER", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_RPC_BIDI_RESPONSE_CONTAINER_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_RPC_BIDI_RESPONSE_CONTAINER_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_RESPONSE_CONTAINER_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_RPC_BIDI_RESPONSE_CONTAINER_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject RPC_BIDI_RESPONSE_CONTAINER_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RPC_BIDI_RESPONSE_CONTAINER",
	.tp_getset = py_RPC_BIDI_RESPONSE_CONTAINER_getsetters,
	.tp_methods = py_RPC_BIDI_RESPONSE_CONTAINER_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_RPC_BIDI_RESPONSE_CONTAINER_new,
};


static PyObject *py_spoolss_CorePrinterDriver_get_core_driver_guid(PyObject *obj, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_core_driver_guid;
	py_core_driver_guid = pytalloc_reference_ex(GUID_Type, pytalloc_get_mem_ctx(obj), &object->core_driver_guid);
	return py_core_driver_guid;
}

static int py_spoolss_CorePrinterDriver_set_core_driver_guid(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->core_driver_guid");
		return -1;
	}
	PY_CHECK_TYPE(GUID_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->core_driver_guid = *(struct GUID *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_CorePrinterDriver_get_driver_date(PyObject *obj, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_date;
	py_driver_date = PyLong_FromUnsignedLongLong(object->driver_date);
	return py_driver_date;
}

static int py_spoolss_CorePrinterDriver_set_driver_date(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_date");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_date));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_date = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_CorePrinterDriver_get_driver_version(PyObject *obj, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_version;
	py_driver_version = PyLong_FromUnsignedLongLong(object->driver_version);
	return py_driver_version;
}

static int py_spoolss_CorePrinterDriver_set_driver_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->driver_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->driver_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->driver_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_CorePrinterDriver_get_szPackageID(PyObject *obj, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_szPackageID;
	if (object->szPackageID == NULL) {
		py_szPackageID = Py_None;
		Py_INCREF(py_szPackageID);
	} else {
		py_szPackageID = PyUnicode_Decode(object->szPackageID, strlen(object->szPackageID), "utf-8", "ignore");
	}
	return py_szPackageID;
}

static int py_spoolss_CorePrinterDriver_set_szPackageID(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->szPackageID");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->szPackageID = talloc_str;
	}
	return 0;
}

static PyGetSetDef py_spoolss_CorePrinterDriver_getsetters[] = {
	{
		.name = discard_const_p(char, "core_driver_guid"),
		.get = py_spoolss_CorePrinterDriver_get_core_driver_guid,
		.set = py_spoolss_CorePrinterDriver_set_core_driver_guid,
		.doc = discard_const_p(char, "PIDL-generated element of base type GUID")
	},
	{
		.name = discard_const_p(char, "driver_date"),
		.get = py_spoolss_CorePrinterDriver_get_driver_date,
		.set = py_spoolss_CorePrinterDriver_set_driver_date,
		.doc = discard_const_p(char, "PIDL-generated element of base type NTTIME")
	},
	{
		.name = discard_const_p(char, "driver_version"),
		.get = py_spoolss_CorePrinterDriver_get_driver_version,
		.set = py_spoolss_CorePrinterDriver_set_driver_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "szPackageID"),
		.get = py_spoolss_CorePrinterDriver_get_szPackageID,
		.set = py_spoolss_CorePrinterDriver_set_szPackageID,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_CorePrinterDriver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_CorePrinterDriver, type);
}

static PyObject *py_spoolss_CorePrinterDriver_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_CorePrinterDriver);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_CorePrinterDriver_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_CorePrinterDriver);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_CorePrinterDriver);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_CorePrinterDriver_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_CorePrinterDriver *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_CorePrinterDriver, "spoolss_CorePrinterDriver", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_CorePrinterDriver, "spoolss_CorePrinterDriver", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_CorePrinterDriver_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_CorePrinterDriver_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CorePrinterDriver_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CorePrinterDriver_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_CorePrinterDriver_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.CorePrinterDriver",
	.tp_getset = py_spoolss_CorePrinterDriver_getsetters,
	.tp_methods = py_spoolss_CorePrinterDriver_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_CorePrinterDriver_new,
};


static PyObject *py_propertyBlob_get_cbBuf(PyObject *obj, void *closure)
{
	struct propertyBlob *object = pytalloc_get_ptr(obj);
	PyObject *py_cbBuf;
	py_cbBuf = PyLong_FromUnsignedLongLong((uint32_t)(object->cbBuf));
	return py_cbBuf;
}

static int py_propertyBlob_set_cbBuf(PyObject *py_obj, PyObject *value, void *closure)
{
	struct propertyBlob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cbBuf");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cbBuf));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cbBuf = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_propertyBlob_get_pBuf(PyObject *obj, void *closure)
{
	struct propertyBlob *object = pytalloc_get_ptr(obj);
	PyObject *py_pBuf;
	if (object->pBuf == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pBuf == NULL) {
		py_pBuf = Py_None;
		Py_INCREF(py_pBuf);
	} else {
		py_pBuf = PyList_New(object->cbBuf);
		if (py_pBuf == NULL) {
			return NULL;
		}
		{
			int pBuf_cntr_1;
			for (pBuf_cntr_1 = 0; pBuf_cntr_1 < (object->cbBuf); pBuf_cntr_1++) {
				PyObject *py_pBuf_1;
				py_pBuf_1 = PyLong_FromLong((uint16_t)((object->pBuf)[pBuf_cntr_1]));
				PyList_SetItem(py_pBuf, pBuf_cntr_1, py_pBuf_1);
			}
		}
	}
	return py_pBuf;
}

static int py_propertyBlob_set_pBuf(PyObject *py_obj, PyObject *value, void *closure)
{
	struct propertyBlob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->pBuf));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pBuf");
		return -1;
	}
	if (value == Py_None) {
		object->pBuf = NULL;
	} else {
		object->pBuf = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int pBuf_cntr_1;
			object->pBuf = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->pBuf, PyList_GET_SIZE(value));
			if (!object->pBuf) { return -1; }
			talloc_set_name_const(object->pBuf, "ARRAY: object->pBuf");
			for (pBuf_cntr_1 = 0; pBuf_cntr_1 < PyList_GET_SIZE(value); pBuf_cntr_1++) {
				if (PyList_GET_ITEM(value, pBuf_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->pBuf)[pBuf_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->pBuf)[pBuf_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, pBuf_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pBuf_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->pBuf)[pBuf_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyGetSetDef py_propertyBlob_getsetters[] = {
	{
		.name = discard_const_p(char, "cbBuf"),
		.get = py_propertyBlob_get_cbBuf,
		.set = py_propertyBlob_set_cbBuf,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pBuf"),
		.get = py_propertyBlob_get_pBuf,
		.set = py_propertyBlob_set_pBuf,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{ .name = NULL }
};

static PyObject *py_propertyBlob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct propertyBlob, type);
}


static PyTypeObject propertyBlob_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.propertyBlob",
	.tp_getset = py_propertyBlob_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_propertyBlob_new,
};

static PyObject *py_import_spoolss_PrintPropertyValueUnion(TALLOC_CTX *mem_ctx, int level, union spoolss_PrintPropertyValueUnion *in)
{
	PyObject *ret;

	switch (level) {
		case kRpcPropertyTypeString:
			if (in->propertyString == NULL) {
				ret = Py_None;
				Py_INCREF(ret);
			} else {
				if (in->propertyString == NULL) {
					ret = Py_None;
					Py_INCREF(ret);
				} else {
					ret = PyUnicode_Decode(in->propertyString, strlen(in->propertyString), "utf-8", "ignore");
				}
			}
			return ret;

		case kRpcPropertyTypeInt32:
			ret = PyLong_FromUnsignedLongLong((uint32_t)(in->propertyInt32));
			return ret;

		case kRpcPropertyTypeInt64:
			ret = PyLong_FromUnsignedLongLong(in->propertyInt64);
			return ret;

		case kRpcPropertyTypeByte:
			ret = PyLong_FromLong((uint16_t)(in->propertyByte));
			return ret;

		case kRpcPropertyTypeBuffer:
			ret = pytalloc_reference_ex(&propertyBlob_Type, mem_ctx, &in->propertyBlob);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_PrintPropertyValueUnion *py_export_spoolss_PrintPropertyValueUnion(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_PrintPropertyValueUnion *ret = talloc_zero(mem_ctx, union spoolss_PrintPropertyValueUnion);
	switch (level) {
		case kRpcPropertyTypeString:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->propertyString");
				talloc_free(ret); return NULL;
			}
			if (in == Py_None) {
				ret->propertyString = NULL;
			} else {
				ret->propertyString = NULL;
				{
					const char *test_str;
					const char *talloc_str;
					PyObject *unicode = NULL;
					if (PyUnicode_Check(in)) {
						unicode = PyUnicode_AsEncodedString(in, "utf-8", "ignore");
						if (unicode == NULL) {
							talloc_free(ret); return NULL;
						}
						test_str = PyBytes_AS_STRING(unicode);
					} else if (PyBytes_Check(in)) {
						test_str = PyBytes_AS_STRING(in);
					} else {
						PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(in)->tp_name);
						talloc_free(ret); return NULL;
					}
					talloc_str = talloc_strdup(mem_ctx, test_str);
					if (unicode != NULL) {
						Py_DECREF(unicode);
					}
					if (talloc_str == NULL) {
						PyErr_NoMemory();
						talloc_free(ret); return NULL;
					}
					ret->propertyString = talloc_str;
				}
			}
			break;

		case kRpcPropertyTypeInt32:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->propertyInt32");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->propertyInt32));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->propertyInt32 = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case kRpcPropertyTypeInt64:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->propertyInt64");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->propertyInt64));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->propertyInt64 = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case kRpcPropertyTypeByte:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->propertyByte");
				talloc_free(ret); return NULL;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(ret->propertyByte));
				if (PyLong_Check(in)) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(in);
					if (PyErr_Occurred() != NULL) {
						talloc_free(ret); return NULL;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						talloc_free(ret); return NULL;
					}
					ret->propertyByte = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					talloc_free(ret); return NULL;
				}
			}
			break;

		case kRpcPropertyTypeBuffer:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->propertyBlob");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&propertyBlob_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->propertyBlob = *(struct propertyBlob *)pytalloc_get_ptr(in);
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_PrintPropertyValueUnion_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_PrintPropertyValueUnion *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_PrintPropertyValueUnion *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_PrintPropertyValueUnion!");
		return NULL;
	}

	return py_import_spoolss_PrintPropertyValueUnion(mem_ctx, level, in);
}

static PyObject *py_spoolss_PrintPropertyValueUnion_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_PrintPropertyValueUnion *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_PrintPropertyValueUnion(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_PrintPropertyValueUnion_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintPropertyValueUnion_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintPropertyValueUnion_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_PrintPropertyValueUnion_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_PrintPropertyValueUnion_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintPropertyValueUnion",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_PrintPropertyValueUnion_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintPropertyValueUnion_new,
};


static PyObject *py_spoolss_PrintPropertyValue_get_ePropertyType(PyObject *obj, void *closure)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_ePropertyType;
	py_ePropertyType = PyLong_FromLong((uint16_t)(object->ePropertyType));
	return py_ePropertyType;
}

static int py_spoolss_PrintPropertyValue_set_ePropertyType(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ePropertyType");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ePropertyType));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ePropertyType = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrintPropertyValue_get_value(PyObject *obj, void *closure)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_value;
	py_value = pyrpc_import_union(&spoolss_PrintPropertyValueUnion_Type, pytalloc_get_mem_ctx(obj), object->ePropertyType, &object->value, "union spoolss_PrintPropertyValueUnion");
	if (py_value == NULL) {
		return NULL;
	}
	return py_value;
}

static int py_spoolss_PrintPropertyValue_set_value(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->value");
		return -1;
	}
	{
		union spoolss_PrintPropertyValueUnion *value_switch_0;
		value_switch_0 = (union spoolss_PrintPropertyValueUnion *)pyrpc_export_union(&spoolss_PrintPropertyValueUnion_Type, pytalloc_get_mem_ctx(py_obj), object->ePropertyType, value, "union spoolss_PrintPropertyValueUnion");
		if (value_switch_0 == NULL) {
			return -1;
		}
		object->value = *value_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_PrintPropertyValue_getsetters[] = {
	{
		.name = discard_const_p(char, "ePropertyType"),
		.get = py_spoolss_PrintPropertyValue_get_ePropertyType,
		.set = py_spoolss_PrintPropertyValue_set_ePropertyType,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_EPrintPropertyType")
	},
	{
		.name = discard_const_p(char, "value"),
		.get = py_spoolss_PrintPropertyValue_get_value,
		.set = py_spoolss_PrintPropertyValue_set_value,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintPropertyValueUnion")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrintPropertyValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrintPropertyValue, type);
}

static PyObject *py_spoolss_PrintPropertyValue_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintPropertyValue);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrintPropertyValue_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintPropertyValue);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintPropertyValue);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrintPropertyValue_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintPropertyValue *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintPropertyValue, "spoolss_PrintPropertyValue", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintPropertyValue, "spoolss_PrintPropertyValue", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrintPropertyValue_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrintPropertyValue_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintPropertyValue_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintPropertyValue_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrintPropertyValue_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintPropertyValue",
	.tp_getset = py_spoolss_PrintPropertyValue_getsetters,
	.tp_methods = py_spoolss_PrintPropertyValue_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintPropertyValue_new,
};


static PyObject *py_spoolss_PrintNamedProperty_get_propertyName(PyObject *obj, void *closure)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_propertyName;
	if (object->propertyName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->propertyName == NULL) {
		py_propertyName = Py_None;
		Py_INCREF(py_propertyName);
	} else {
		if (object->propertyName == NULL) {
			py_propertyName = Py_None;
			Py_INCREF(py_propertyName);
		} else {
			py_propertyName = PyUnicode_Decode(object->propertyName, strlen(object->propertyName), "utf-8", "ignore");
		}
	}
	return py_propertyName;
}

static int py_spoolss_PrintNamedProperty_set_propertyName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->propertyName");
		return -1;
	}
	if (value == Py_None) {
		object->propertyName = NULL;
	} else {
		object->propertyName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->propertyName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PrintNamedProperty_get_propertyValue(PyObject *obj, void *closure)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_propertyValue;
	py_propertyValue = pytalloc_reference_ex(&spoolss_PrintPropertyValue_Type, pytalloc_get_mem_ctx(obj), &object->propertyValue);
	return py_propertyValue;
}

static int py_spoolss_PrintNamedProperty_set_propertyValue(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->propertyValue");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_PrintPropertyValue_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->propertyValue = *(struct spoolss_PrintPropertyValue *)pytalloc_get_ptr(value);
	return 0;
}

static PyGetSetDef py_spoolss_PrintNamedProperty_getsetters[] = {
	{
		.name = discard_const_p(char, "propertyName"),
		.get = py_spoolss_PrintNamedProperty_get_propertyName,
		.set = py_spoolss_PrintNamedProperty_set_propertyName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "propertyValue"),
		.get = py_spoolss_PrintNamedProperty_get_propertyValue,
		.set = py_spoolss_PrintNamedProperty_set_propertyValue,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintPropertyValue")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PrintNamedProperty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_PrintNamedProperty, type);
}

static PyObject *py_spoolss_PrintNamedProperty_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintNamedProperty);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_PrintNamedProperty_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintNamedProperty);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_PrintNamedProperty);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PrintNamedProperty_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_PrintNamedProperty *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintNamedProperty, "spoolss_PrintNamedProperty", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_PrintNamedProperty, "spoolss_PrintNamedProperty", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_PrintNamedProperty_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_PrintNamedProperty_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintNamedProperty_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PrintNamedProperty_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PrintNamedProperty_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PrintNamedProperty",
	.tp_getset = py_spoolss_PrintNamedProperty_getsetters,
	.tp_methods = py_spoolss_PrintNamedProperty_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PrintNamedProperty_new,
};


static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_Status(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_Status;
	py_Status = PyLong_FromUnsignedLongLong((uint32_t)(object->Status));
	return py_Status;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_Status(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Status");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Status));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Status = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_pDocumentName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_pDocumentName;
	if (object->pDocumentName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pDocumentName == NULL) {
		py_pDocumentName = Py_None;
		Py_INCREF(py_pDocumentName);
	} else {
		if (object->pDocumentName == NULL) {
			py_pDocumentName = Py_None;
			Py_INCREF(py_pDocumentName);
		} else {
			py_pDocumentName = PyUnicode_Decode(object->pDocumentName, strlen(object->pDocumentName), "utf-8", "ignore");
		}
	}
	return py_pDocumentName;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_pDocumentName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pDocumentName");
		return -1;
	}
	if (value == Py_None) {
		object->pDocumentName = NULL;
	} else {
		object->pDocumentName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pDocumentName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_pUserName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_pUserName;
	if (object->pUserName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pUserName == NULL) {
		py_pUserName = Py_None;
		Py_INCREF(py_pUserName);
	} else {
		if (object->pUserName == NULL) {
			py_pUserName = Py_None;
			Py_INCREF(py_pUserName);
		} else {
			py_pUserName = PyUnicode_Decode(object->pUserName, strlen(object->pUserName), "utf-8", "ignore");
		}
	}
	return py_pUserName;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_pUserName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pUserName");
		return -1;
	}
	if (value == Py_None) {
		object->pUserName = NULL;
	} else {
		object->pUserName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pUserName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_pMachineName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_pMachineName;
	if (object->pMachineName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pMachineName == NULL) {
		py_pMachineName = Py_None;
		Py_INCREF(py_pMachineName);
	} else {
		if (object->pMachineName == NULL) {
			py_pMachineName = Py_None;
			Py_INCREF(py_pMachineName);
		} else {
			py_pMachineName = PyUnicode_Decode(object->pMachineName, strlen(object->pMachineName), "utf-8", "ignore");
		}
	}
	return py_pMachineName;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_pMachineName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pMachineName");
		return -1;
	}
	if (value == Py_None) {
		object->pMachineName = NULL;
	} else {
		object->pMachineName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pMachineName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_pPrinterName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_pPrinterName;
	if (object->pPrinterName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pPrinterName == NULL) {
		py_pPrinterName = Py_None;
		Py_INCREF(py_pPrinterName);
	} else {
		if (object->pPrinterName == NULL) {
			py_pPrinterName = Py_None;
			Py_INCREF(py_pPrinterName);
		} else {
			py_pPrinterName = PyUnicode_Decode(object->pPrinterName, strlen(object->pPrinterName), "utf-8", "ignore");
		}
	}
	return py_pPrinterName;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_pPrinterName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pPrinterName");
		return -1;
	}
	if (value == Py_None) {
		object->pPrinterName = NULL;
	} else {
		object->pPrinterName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pPrinterName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_pPortName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_pPortName;
	if (object->pPortName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pPortName == NULL) {
		py_pPortName = Py_None;
		Py_INCREF(py_pPortName);
	} else {
		if (object->pPortName == NULL) {
			py_pPortName = Py_None;
			Py_INCREF(py_pPortName);
		} else {
			py_pPortName = PyUnicode_Decode(object->pPortName, strlen(object->pPortName), "utf-8", "ignore");
		}
	}
	return py_pPortName;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_pPortName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pPortName");
		return -1;
	}
	if (value == Py_None) {
		object->pPortName = NULL;
	} else {
		object->pPortName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pPortName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_Size(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_Size;
	py_Size = PyLong_FromUnsignedLongLong(object->Size);
	return py_Size;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_Size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_get_TotalPages(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(obj);
	PyObject *py_TotalPages;
	py_TotalPages = PyLong_FromUnsignedLongLong((uint32_t)(object->TotalPages));
	return py_TotalPages;
}

static int py_spoolss_BranchOfficeJobDataPrinted_set_TotalPages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPrinted *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->TotalPages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TotalPages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->TotalPages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobDataPrinted_getsetters[] = {
	{
		.name = discard_const_p(char, "Status"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_Status,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_Status,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pDocumentName"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_pDocumentName,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_pDocumentName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pUserName"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_pUserName,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_pUserName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pMachineName"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_pMachineName,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_pMachineName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pPrinterName"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_pPrinterName,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_pPrinterName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pPortName"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_pPortName,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_pPortName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "Size"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_Size,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_Size,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "TotalPages"),
		.get = py_spoolss_BranchOfficeJobDataPrinted_get_TotalPages,
		.set = py_spoolss_BranchOfficeJobDataPrinted_set_TotalPages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobDataPrinted_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobDataPrinted, type);
}


static PyTypeObject spoolss_BranchOfficeJobDataPrinted_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobDataPrinted",
	.tp_getset = py_spoolss_BranchOfficeJobDataPrinted_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobDataPrinted_new,
};


static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_Size(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_Size;
	py_Size = PyLong_FromUnsignedLongLong(object->Size);
	return py_Size;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_Size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->Size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->Size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_ICMMethod(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_ICMMethod;
	py_ICMMethod = PyLong_FromUnsignedLongLong((uint32_t)(object->ICMMethod));
	return py_ICMMethod;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_ICMMethod(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->ICMMethod");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->ICMMethod));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->ICMMethod = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_Color(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_Color;
	py_Color = PyLong_FromLong(object->Color);
	return py_Color;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_Color(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Color");
		return -1;
	}
	{
		const long long int_max = ndr_sizeof2intmax(sizeof(object->Color));
		const long long int_min = -int_max - 1;
		if (PyLong_Check(value)) {
			long long test_var;
			test_var = PyLong_AsLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var < int_min || test_var > int_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
				  PyLong_Type.tp_name, int_min, int_max, test_var);
				return -1;
			}
			object->Color = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_PrintQuality(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_PrintQuality;
	py_PrintQuality = PyLong_FromLong(object->PrintQuality);
	return py_PrintQuality;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_PrintQuality(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->PrintQuality");
		return -1;
	}
	{
		const long long int_max = ndr_sizeof2intmax(sizeof(object->PrintQuality));
		const long long int_min = -int_max - 1;
		if (PyLong_Check(value)) {
			long long test_var;
			test_var = PyLong_AsLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var < int_min || test_var > int_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
				  PyLong_Type.tp_name, int_min, int_max, test_var);
				return -1;
			}
			object->PrintQuality = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_YResolution(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_YResolution;
	py_YResolution = PyLong_FromLong(object->YResolution);
	return py_YResolution;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_YResolution(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->YResolution");
		return -1;
	}
	{
		const long long int_max = ndr_sizeof2intmax(sizeof(object->YResolution));
		const long long int_min = -int_max - 1;
		if (PyLong_Check(value)) {
			long long test_var;
			test_var = PyLong_AsLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var < int_min || test_var > int_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
				  PyLong_Type.tp_name, int_min, int_max, test_var);
				return -1;
			}
			object->YResolution = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_Copies(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_Copies;
	py_Copies = PyLong_FromLong(object->Copies);
	return py_Copies;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_Copies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->Copies");
		return -1;
	}
	{
		const long long int_max = ndr_sizeof2intmax(sizeof(object->Copies));
		const long long int_min = -int_max - 1;
		if (PyLong_Check(value)) {
			long long test_var;
			test_var = PyLong_AsLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var < int_min || test_var > int_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
				  PyLong_Type.tp_name, int_min, int_max, test_var);
				return -1;
			}
			object->Copies = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataRendered_get_TTOption(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(obj);
	PyObject *py_TTOption;
	py_TTOption = PyLong_FromLong(object->TTOption);
	return py_TTOption;
}

static int py_spoolss_BranchOfficeJobDataRendered_set_TTOption(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataRendered *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->TTOption");
		return -1;
	}
	{
		const long long int_max = ndr_sizeof2intmax(sizeof(object->TTOption));
		const long long int_min = -int_max - 1;
		if (PyLong_Check(value)) {
			long long test_var;
			test_var = PyLong_AsLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var < int_min || test_var > int_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range %lld - %lld, got %lld",
				  PyLong_Type.tp_name, int_min, int_max, test_var);
				return -1;
			}
			object->TTOption = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobDataRendered_getsetters[] = {
	{
		.name = discard_const_p(char, "Size"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_Size,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_Size,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "ICMMethod"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_ICMMethod,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_ICMMethod,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "Color"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_Color,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_Color,
		.doc = discard_const_p(char, "PIDL-generated element of base type int16")
	},
	{
		.name = discard_const_p(char, "PrintQuality"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_PrintQuality,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_PrintQuality,
		.doc = discard_const_p(char, "PIDL-generated element of base type int16")
	},
	{
		.name = discard_const_p(char, "YResolution"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_YResolution,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_YResolution,
		.doc = discard_const_p(char, "PIDL-generated element of base type int16")
	},
	{
		.name = discard_const_p(char, "Copies"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_Copies,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_Copies,
		.doc = discard_const_p(char, "PIDL-generated element of base type int16")
	},
	{
		.name = discard_const_p(char, "TTOption"),
		.get = py_spoolss_BranchOfficeJobDataRendered_get_TTOption,
		.set = py_spoolss_BranchOfficeJobDataRendered_set_TTOption,
		.doc = discard_const_p(char, "PIDL-generated element of base type int16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobDataRendered_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobDataRendered, type);
}


static PyTypeObject spoolss_BranchOfficeJobDataRendered_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobDataRendered",
	.tp_getset = py_spoolss_BranchOfficeJobDataRendered_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobDataRendered_new,
};


static PyObject *py_spoolss_BranchOfficeJobDataError_get_LastError(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_LastError;
	py_LastError = PyErr_FromWERROR(object->LastError);
	return py_LastError;
}

static int py_spoolss_BranchOfficeJobDataError_set_LastError(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->LastError");
		return -1;
	}
	object->LastError = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pDocumentName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pDocumentName;
	if (object->pDocumentName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pDocumentName == NULL) {
		py_pDocumentName = Py_None;
		Py_INCREF(py_pDocumentName);
	} else {
		if (object->pDocumentName == NULL) {
			py_pDocumentName = Py_None;
			Py_INCREF(py_pDocumentName);
		} else {
			py_pDocumentName = PyUnicode_Decode(object->pDocumentName, strlen(object->pDocumentName), "utf-8", "ignore");
		}
	}
	return py_pDocumentName;
}

static int py_spoolss_BranchOfficeJobDataError_set_pDocumentName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pDocumentName");
		return -1;
	}
	if (value == Py_None) {
		object->pDocumentName = NULL;
	} else {
		object->pDocumentName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pDocumentName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pUserName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pUserName;
	if (object->pUserName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pUserName == NULL) {
		py_pUserName = Py_None;
		Py_INCREF(py_pUserName);
	} else {
		if (object->pUserName == NULL) {
			py_pUserName = Py_None;
			Py_INCREF(py_pUserName);
		} else {
			py_pUserName = PyUnicode_Decode(object->pUserName, strlen(object->pUserName), "utf-8", "ignore");
		}
	}
	return py_pUserName;
}

static int py_spoolss_BranchOfficeJobDataError_set_pUserName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pUserName");
		return -1;
	}
	if (value == Py_None) {
		object->pUserName = NULL;
	} else {
		object->pUserName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pUserName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pPrinterName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pPrinterName;
	if (object->pPrinterName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pPrinterName == NULL) {
		py_pPrinterName = Py_None;
		Py_INCREF(py_pPrinterName);
	} else {
		if (object->pPrinterName == NULL) {
			py_pPrinterName = Py_None;
			Py_INCREF(py_pPrinterName);
		} else {
			py_pPrinterName = PyUnicode_Decode(object->pPrinterName, strlen(object->pPrinterName), "utf-8", "ignore");
		}
	}
	return py_pPrinterName;
}

static int py_spoolss_BranchOfficeJobDataError_set_pPrinterName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pPrinterName");
		return -1;
	}
	if (value == Py_None) {
		object->pPrinterName = NULL;
	} else {
		object->pPrinterName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pPrinterName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pDataType(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pDataType;
	if (object->pDataType == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pDataType == NULL) {
		py_pDataType = Py_None;
		Py_INCREF(py_pDataType);
	} else {
		if (object->pDataType == NULL) {
			py_pDataType = Py_None;
			Py_INCREF(py_pDataType);
		} else {
			py_pDataType = PyUnicode_Decode(object->pDataType, strlen(object->pDataType), "utf-8", "ignore");
		}
	}
	return py_pDataType;
}

static int py_spoolss_BranchOfficeJobDataError_set_pDataType(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pDataType");
		return -1;
	}
	if (value == Py_None) {
		object->pDataType = NULL;
	} else {
		object->pDataType = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pDataType = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_TotalSize(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_TotalSize;
	py_TotalSize = PyLong_FromUnsignedLongLong(object->TotalSize);
	return py_TotalSize;
}

static int py_spoolss_BranchOfficeJobDataError_set_TotalSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->TotalSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TotalSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->TotalSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_PrintedSize(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_PrintedSize;
	py_PrintedSize = PyLong_FromUnsignedLongLong(object->PrintedSize);
	return py_PrintedSize;
}

static int py_spoolss_BranchOfficeJobDataError_set_PrintedSize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->PrintedSize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PrintedSize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->PrintedSize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_TotalPages(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_TotalPages;
	py_TotalPages = PyLong_FromUnsignedLongLong((uint32_t)(object->TotalPages));
	return py_TotalPages;
}

static int py_spoolss_BranchOfficeJobDataError_set_TotalPages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->TotalPages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->TotalPages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->TotalPages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_PrintedPages(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_PrintedPages;
	py_PrintedPages = PyLong_FromUnsignedLongLong((uint32_t)(object->PrintedPages));
	return py_PrintedPages;
}

static int py_spoolss_BranchOfficeJobDataError_set_PrintedPages(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->PrintedPages");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->PrintedPages));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->PrintedPages = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pMachineName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pMachineName;
	if (object->pMachineName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pMachineName == NULL) {
		py_pMachineName = Py_None;
		Py_INCREF(py_pMachineName);
	} else {
		if (object->pMachineName == NULL) {
			py_pMachineName = Py_None;
			Py_INCREF(py_pMachineName);
		} else {
			py_pMachineName = PyUnicode_Decode(object->pMachineName, strlen(object->pMachineName), "utf-8", "ignore");
		}
	}
	return py_pMachineName;
}

static int py_spoolss_BranchOfficeJobDataError_set_pMachineName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pMachineName");
		return -1;
	}
	if (value == Py_None) {
		object->pMachineName = NULL;
	} else {
		object->pMachineName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pMachineName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pJobError(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pJobError;
	if (object->pJobError == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pJobError == NULL) {
		py_pJobError = Py_None;
		Py_INCREF(py_pJobError);
	} else {
		if (object->pJobError == NULL) {
			py_pJobError = Py_None;
			Py_INCREF(py_pJobError);
		} else {
			py_pJobError = PyUnicode_Decode(object->pJobError, strlen(object->pJobError), "utf-8", "ignore");
		}
	}
	return py_pJobError;
}

static int py_spoolss_BranchOfficeJobDataError_set_pJobError(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pJobError");
		return -1;
	}
	if (value == Py_None) {
		object->pJobError = NULL;
	} else {
		object->pJobError = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pJobError = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataError_get_pErrorDescription(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(obj);
	PyObject *py_pErrorDescription;
	if (object->pErrorDescription == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pErrorDescription == NULL) {
		py_pErrorDescription = Py_None;
		Py_INCREF(py_pErrorDescription);
	} else {
		if (object->pErrorDescription == NULL) {
			py_pErrorDescription = Py_None;
			Py_INCREF(py_pErrorDescription);
		} else {
			py_pErrorDescription = PyUnicode_Decode(object->pErrorDescription, strlen(object->pErrorDescription), "utf-8", "ignore");
		}
	}
	return py_pErrorDescription;
}

static int py_spoolss_BranchOfficeJobDataError_set_pErrorDescription(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataError *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pErrorDescription");
		return -1;
	}
	if (value == Py_None) {
		object->pErrorDescription = NULL;
	} else {
		object->pErrorDescription = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pErrorDescription = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobDataError_getsetters[] = {
	{
		.name = discard_const_p(char, "LastError"),
		.get = py_spoolss_BranchOfficeJobDataError_get_LastError,
		.set = py_spoolss_BranchOfficeJobDataError_set_LastError,
		.doc = discard_const_p(char, "PIDL-generated element of base type WERROR")
	},
	{
		.name = discard_const_p(char, "pDocumentName"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pDocumentName,
		.set = py_spoolss_BranchOfficeJobDataError_set_pDocumentName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pUserName"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pUserName,
		.set = py_spoolss_BranchOfficeJobDataError_set_pUserName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pPrinterName"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pPrinterName,
		.set = py_spoolss_BranchOfficeJobDataError_set_pPrinterName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pDataType"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pDataType,
		.set = py_spoolss_BranchOfficeJobDataError_set_pDataType,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "TotalSize"),
		.get = py_spoolss_BranchOfficeJobDataError_get_TotalSize,
		.set = py_spoolss_BranchOfficeJobDataError_set_TotalSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "PrintedSize"),
		.get = py_spoolss_BranchOfficeJobDataError_get_PrintedSize,
		.set = py_spoolss_BranchOfficeJobDataError_set_PrintedSize,
		.doc = discard_const_p(char, "PIDL-generated element of base type hyper")
	},
	{
		.name = discard_const_p(char, "TotalPages"),
		.get = py_spoolss_BranchOfficeJobDataError_get_TotalPages,
		.set = py_spoolss_BranchOfficeJobDataError_set_TotalPages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "PrintedPages"),
		.get = py_spoolss_BranchOfficeJobDataError_get_PrintedPages,
		.set = py_spoolss_BranchOfficeJobDataError_set_PrintedPages,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "pMachineName"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pMachineName,
		.set = py_spoolss_BranchOfficeJobDataError_set_pMachineName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pJobError"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pJobError,
		.set = py_spoolss_BranchOfficeJobDataError_set_pJobError,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pErrorDescription"),
		.get = py_spoolss_BranchOfficeJobDataError_get_pErrorDescription,
		.set = py_spoolss_BranchOfficeJobDataError_set_pErrorDescription,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobDataError_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobDataError, type);
}


static PyTypeObject spoolss_BranchOfficeJobDataError_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobDataError",
	.tp_getset = py_spoolss_BranchOfficeJobDataError_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobDataError_new,
};


static PyObject *py_spoolss_BranchOfficeJobDataPipelineFailed_get_pDocumentName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(obj);
	PyObject *py_pDocumentName;
	if (object->pDocumentName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pDocumentName == NULL) {
		py_pDocumentName = Py_None;
		Py_INCREF(py_pDocumentName);
	} else {
		if (object->pDocumentName == NULL) {
			py_pDocumentName = Py_None;
			Py_INCREF(py_pDocumentName);
		} else {
			py_pDocumentName = PyUnicode_Decode(object->pDocumentName, strlen(object->pDocumentName), "utf-8", "ignore");
		}
	}
	return py_pDocumentName;
}

static int py_spoolss_BranchOfficeJobDataPipelineFailed_set_pDocumentName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pDocumentName");
		return -1;
	}
	if (value == Py_None) {
		object->pDocumentName = NULL;
	} else {
		object->pDocumentName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pDocumentName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPipelineFailed_get_pPrinterName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(obj);
	PyObject *py_pPrinterName;
	if (object->pPrinterName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pPrinterName == NULL) {
		py_pPrinterName = Py_None;
		Py_INCREF(py_pPrinterName);
	} else {
		if (object->pPrinterName == NULL) {
			py_pPrinterName = Py_None;
			Py_INCREF(py_pPrinterName);
		} else {
			py_pPrinterName = PyUnicode_Decode(object->pPrinterName, strlen(object->pPrinterName), "utf-8", "ignore");
		}
	}
	return py_pPrinterName;
}

static int py_spoolss_BranchOfficeJobDataPipelineFailed_set_pPrinterName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pPrinterName");
		return -1;
	}
	if (value == Py_None) {
		object->pPrinterName = NULL;
	} else {
		object->pPrinterName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pPrinterName = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataPipelineFailed_get_pExtraErrorInfo(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(obj);
	PyObject *py_pExtraErrorInfo;
	if (object->pExtraErrorInfo == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pExtraErrorInfo == NULL) {
		py_pExtraErrorInfo = Py_None;
		Py_INCREF(py_pExtraErrorInfo);
	} else {
		if (object->pExtraErrorInfo == NULL) {
			py_pExtraErrorInfo = Py_None;
			Py_INCREF(py_pExtraErrorInfo);
		} else {
			py_pExtraErrorInfo = PyUnicode_Decode(object->pExtraErrorInfo, strlen(object->pExtraErrorInfo), "utf-8", "ignore");
		}
	}
	return py_pExtraErrorInfo;
}

static int py_spoolss_BranchOfficeJobDataPipelineFailed_set_pExtraErrorInfo(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataPipelineFailed *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pExtraErrorInfo");
		return -1;
	}
	if (value == Py_None) {
		object->pExtraErrorInfo = NULL;
	} else {
		object->pExtraErrorInfo = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pExtraErrorInfo = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobDataPipelineFailed_getsetters[] = {
	{
		.name = discard_const_p(char, "pDocumentName"),
		.get = py_spoolss_BranchOfficeJobDataPipelineFailed_get_pDocumentName,
		.set = py_spoolss_BranchOfficeJobDataPipelineFailed_set_pDocumentName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pPrinterName"),
		.get = py_spoolss_BranchOfficeJobDataPipelineFailed_get_pPrinterName,
		.set = py_spoolss_BranchOfficeJobDataPipelineFailed_set_pPrinterName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "pExtraErrorInfo"),
		.get = py_spoolss_BranchOfficeJobDataPipelineFailed_get_pExtraErrorInfo,
		.set = py_spoolss_BranchOfficeJobDataPipelineFailed_set_pExtraErrorInfo,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobDataPipelineFailed_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobDataPipelineFailed, type);
}


static PyTypeObject spoolss_BranchOfficeJobDataPipelineFailed_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobDataPipelineFailed",
	.tp_getset = py_spoolss_BranchOfficeJobDataPipelineFailed_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobDataPipelineFailed_new,
};


static PyObject *py_spoolss_BranchOfficeLogOfflineFileFull_get_pMachineName(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeLogOfflineFileFull *object = pytalloc_get_ptr(obj);
	PyObject *py_pMachineName;
	if (object->pMachineName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->pMachineName == NULL) {
		py_pMachineName = Py_None;
		Py_INCREF(py_pMachineName);
	} else {
		if (object->pMachineName == NULL) {
			py_pMachineName = Py_None;
			Py_INCREF(py_pMachineName);
		} else {
			py_pMachineName = PyUnicode_Decode(object->pMachineName, strlen(object->pMachineName), "utf-8", "ignore");
		}
	}
	return py_pMachineName;
}

static int py_spoolss_BranchOfficeLogOfflineFileFull_set_pMachineName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeLogOfflineFileFull *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->pMachineName");
		return -1;
	}
	if (value == Py_None) {
		object->pMachineName = NULL;
	} else {
		object->pMachineName = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->pMachineName = talloc_str;
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeLogOfflineFileFull_getsetters[] = {
	{
		.name = discard_const_p(char, "pMachineName"),
		.get = py_spoolss_BranchOfficeLogOfflineFileFull_get_pMachineName,
		.set = py_spoolss_BranchOfficeLogOfflineFileFull_set_pMachineName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeLogOfflineFileFull_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeLogOfflineFileFull, type);
}


static PyTypeObject spoolss_BranchOfficeLogOfflineFileFull_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeLogOfflineFileFull",
	.tp_getset = py_spoolss_BranchOfficeLogOfflineFileFull_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeLogOfflineFileFull_new,
};

static PyObject *py_import_spoolss_BranchOfficeJobInfo(TALLOC_CTX *mem_ctx, int level, union spoolss_BranchOfficeJobInfo *in)
{
	PyObject *ret;

	switch (level) {
		case kLogJobPrinted:
			ret = pytalloc_reference_ex(&spoolss_BranchOfficeJobDataPrinted_Type, mem_ctx, &in->LogJobPrinted);
			return ret;

		case kLogJobRendered:
			ret = pytalloc_reference_ex(&spoolss_BranchOfficeJobDataRendered_Type, mem_ctx, &in->LogJobRendered);
			return ret;

		case kLogJobError:
			ret = pytalloc_reference_ex(&spoolss_BranchOfficeJobDataError_Type, mem_ctx, &in->LogJobError);
			return ret;

		case kLogJobPipelineError:
			ret = pytalloc_reference_ex(&spoolss_BranchOfficeJobDataPipelineFailed_Type, mem_ctx, &in->LogPipelineFailed);
			return ret;

		case kLogOfflineFileFull:
			ret = pytalloc_reference_ex(&spoolss_BranchOfficeLogOfflineFileFull_Type, mem_ctx, &in->LogOfflineFileFull);
			return ret;

	}
	PyErr_SetString(PyExc_TypeError, "unknown union level");
	return NULL;
}

static union spoolss_BranchOfficeJobInfo *py_export_spoolss_BranchOfficeJobInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
{
	union spoolss_BranchOfficeJobInfo *ret = talloc_zero(mem_ctx, union spoolss_BranchOfficeJobInfo);
	switch (level) {
		case kLogJobPrinted:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->LogJobPrinted");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataPrinted_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->LogJobPrinted = *(struct spoolss_BranchOfficeJobDataPrinted *)pytalloc_get_ptr(in);
			break;

		case kLogJobRendered:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->LogJobRendered");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataRendered_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->LogJobRendered = *(struct spoolss_BranchOfficeJobDataRendered *)pytalloc_get_ptr(in);
			break;

		case kLogJobError:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->LogJobError");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataError_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->LogJobError = *(struct spoolss_BranchOfficeJobDataError *)pytalloc_get_ptr(in);
			break;

		case kLogJobPipelineError:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->LogPipelineFailed");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataPipelineFailed_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->LogPipelineFailed = *(struct spoolss_BranchOfficeJobDataPipelineFailed *)pytalloc_get_ptr(in);
			break;

		case kLogOfflineFileFull:
			if (in == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: ret->LogOfflineFileFull");
				talloc_free(ret); return NULL;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeLogOfflineFileFull_Type, in, talloc_free(ret); return NULL;);
			if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
				PyErr_NoMemory();
				talloc_free(ret); return NULL;
			}
			ret->LogOfflineFileFull = *(struct spoolss_BranchOfficeLogOfflineFileFull *)pytalloc_get_ptr(in);
			break;

		default:
			PyErr_SetString(PyExc_TypeError, "invalid union level value");
			talloc_free(ret);
			ret = NULL;
	}

	return ret;
}

static PyObject *py_spoolss_BranchOfficeJobInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in_obj = NULL;
	union spoolss_BranchOfficeJobInfo *in = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in_obj)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}
	in = (union spoolss_BranchOfficeJobInfo *)pytalloc_get_ptr(in_obj);
	if (in == NULL) {
		PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union spoolss_BranchOfficeJobInfo!");
		return NULL;
	}

	return py_import_spoolss_BranchOfficeJobInfo(mem_ctx, level, in);
}

static PyObject *py_spoolss_BranchOfficeJobInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
	PyObject *mem_ctx_obj = NULL;
	TALLOC_CTX *mem_ctx = NULL;
	int level = 0;
	PyObject *in = NULL;
	union spoolss_BranchOfficeJobInfo *out = NULL;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
		discard_const_p(char *, kwnames),
		&mem_ctx_obj,
		&level,
		&in)) {
		return NULL;
	}
	mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
	if (mem_ctx == NULL) {
		PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
		return NULL;
	}

	out = py_export_spoolss_BranchOfficeJobInfo(mem_ctx, level, in);
	if (out == NULL) {
		return NULL;
	}

	return pytalloc_GenericObject_reference(out);
}

static PyMethodDef py_spoolss_BranchOfficeJobInfo_methods[] = {
	{ "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_BranchOfficeJobInfo_import),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__import__(mem_ctx, level, in) => ret." },
	{ "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_BranchOfficeJobInfo_export),
		METH_VARARGS|METH_KEYWORDS|METH_CLASS,
		"T.__export__(mem_ctx, level, in) => ret." },
	{ NULL, NULL, 0, NULL }
};

static PyObject *py_spoolss_BranchOfficeJobInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
	return NULL;
}


static PyTypeObject spoolss_BranchOfficeJobInfo_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobInfo",
	.tp_getset = NULL,
	.tp_methods = py_spoolss_BranchOfficeJobInfo_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobInfo_new,
};


static PyObject *py_spoolss_BranchOfficeJobData_get_eEventType(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(obj);
	PyObject *py_eEventType;
	py_eEventType = PyLong_FromLong((uint16_t)(object->eEventType));
	return py_eEventType;
}

static int py_spoolss_BranchOfficeJobData_set_eEventType(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->eEventType");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->eEventType));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->eEventType = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobData_get_JobId(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(obj);
	PyObject *py_JobId;
	py_JobId = PyLong_FromUnsignedLongLong((uint32_t)(object->JobId));
	return py_JobId;
}

static int py_spoolss_BranchOfficeJobData_set_JobId(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->JobId");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->JobId));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobData_get_JobInfo(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(obj);
	PyObject *py_JobInfo;
	py_JobInfo = pyrpc_import_union(&spoolss_BranchOfficeJobInfo_Type, pytalloc_get_mem_ctx(obj), object->eEventType, &object->JobInfo, "union spoolss_BranchOfficeJobInfo");
	if (py_JobInfo == NULL) {
		return NULL;
	}
	return py_JobInfo;
}

static int py_spoolss_BranchOfficeJobData_set_JobInfo(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->JobInfo");
		return -1;
	}
	{
		union spoolss_BranchOfficeJobInfo *JobInfo_switch_0;
		JobInfo_switch_0 = (union spoolss_BranchOfficeJobInfo *)pyrpc_export_union(&spoolss_BranchOfficeJobInfo_Type, pytalloc_get_mem_ctx(py_obj), object->eEventType, value, "union spoolss_BranchOfficeJobInfo");
		if (JobInfo_switch_0 == NULL) {
			return -1;
		}
		object->JobInfo = *JobInfo_switch_0;
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobData_getsetters[] = {
	{
		.name = discard_const_p(char, "eEventType"),
		.get = py_spoolss_BranchOfficeJobData_get_eEventType,
		.set = py_spoolss_BranchOfficeJobData_set_eEventType,
		.doc = discard_const_p(char, "PIDL-generated element of base type EBranchOfficeJobEventType")
	},
	{
		.name = discard_const_p(char, "JobId"),
		.get = py_spoolss_BranchOfficeJobData_get_JobId,
		.set = py_spoolss_BranchOfficeJobData_set_JobId,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "JobInfo"),
		.get = py_spoolss_BranchOfficeJobData_get_JobInfo,
		.set = py_spoolss_BranchOfficeJobData_set_JobInfo,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_BranchOfficeJobInfo")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobData, type);
}


static PyTypeObject spoolss_BranchOfficeJobData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobData",
	.tp_getset = py_spoolss_BranchOfficeJobData_getsetters,
	.tp_methods = NULL,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobData_new,
};


static PyObject *py_spoolss_BranchOfficeJobDataContainer_get_cJobDataEntries(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_cJobDataEntries;
	py_cJobDataEntries = PyLong_FromUnsignedLongLong((uint32_t)(object->cJobDataEntries));
	return py_cJobDataEntries;
}

static int py_spoolss_BranchOfficeJobDataContainer_set_cJobDataEntries(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->cJobDataEntries");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->cJobDataEntries));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->cJobDataEntries = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_BranchOfficeJobDataContainer_get_JobData(PyObject *obj, void *closure)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(obj);
	PyObject *py_JobData;
	py_JobData = PyList_New(object->cJobDataEntries);
	if (py_JobData == NULL) {
		return NULL;
	}
	{
		int JobData_cntr_0;
		for (JobData_cntr_0 = 0; JobData_cntr_0 < (object->cJobDataEntries); JobData_cntr_0++) {
			PyObject *py_JobData_0;
			py_JobData_0 = pytalloc_reference_ex(&spoolss_BranchOfficeJobData_Type, object->JobData, &(object->JobData)[JobData_cntr_0]);
			PyList_SetItem(py_JobData, JobData_cntr_0, py_JobData_0);
		}
	}
	return py_JobData;
}

static int py_spoolss_BranchOfficeJobDataContainer_set_JobData(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->JobData");
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int JobData_cntr_0;
		object->JobData = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->JobData, PyList_GET_SIZE(value));
		if (!object->JobData) { return -1; }
		talloc_set_name_const(object->JobData, "ARRAY: object->JobData");
		for (JobData_cntr_0 = 0; JobData_cntr_0 < PyList_GET_SIZE(value); JobData_cntr_0++) {
			if (PyList_GET_ITEM(value, JobData_cntr_0) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->JobData)[JobData_cntr_0]");
				return -1;
			}
			PY_CHECK_TYPE(&spoolss_BranchOfficeJobData_Type, PyList_GET_ITEM(value, JobData_cntr_0), return -1;);
			if (talloc_reference(object->JobData, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, JobData_cntr_0))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			(object->JobData)[JobData_cntr_0] = *(struct spoolss_BranchOfficeJobData *)pytalloc_get_ptr(PyList_GET_ITEM(value, JobData_cntr_0));
		}
	}
	return 0;
}

static PyGetSetDef py_spoolss_BranchOfficeJobDataContainer_getsetters[] = {
	{
		.name = discard_const_p(char, "cJobDataEntries"),
		.get = py_spoolss_BranchOfficeJobDataContainer_get_cJobDataEntries,
		.set = py_spoolss_BranchOfficeJobDataContainer_set_cJobDataEntries,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "JobData"),
		.get = py_spoolss_BranchOfficeJobDataContainer_get_JobData,
		.set = py_spoolss_BranchOfficeJobDataContainer_set_JobData,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_BranchOfficeJobData")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_BranchOfficeJobDataContainer_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return pytalloc_new(struct spoolss_BranchOfficeJobDataContainer, type);
}

static PyObject *py_spoolss_BranchOfficeJobDataContainer_ndr_pack(PyObject *py_obj,  PyObject *Py_UNUSED(ignored))
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;
	TALLOC_CTX *tmp_ctx = talloc_new(pytalloc_get_mem_ctx(py_obj));
	if (tmp_ctx == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}
	err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_spoolss_BranchOfficeJobDataContainer);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(tmp_ctx);
		PyErr_SetNdrError(err);
		return NULL;
	}

	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(tmp_ctx);
	return ret;
}

static PyObject *py_spoolss_BranchOfficeJobDataContainer_ndr_unpack(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(py_obj);
	DATA_BLOB blob = {.data = NULL, .length = 0};
	Py_ssize_t blob_length = 0;
	enum ndr_err_code err;
	const char * const kwnames[] = { "data_blob", "allow_remaining", NULL };
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|O:__ndr_unpack__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	if (allow_remaining) {
		err = ndr_pull_struct_blob(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_BranchOfficeJobDataContainer);
	} else {
		err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_spoolss_BranchOfficeJobDataContainer);
	}
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		PyErr_SetNdrError(err);
		return NULL;
	}

	Py_RETURN_NONE;
}

static PyObject *py_spoolss_BranchOfficeJobDataContainer_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	struct spoolss_BranchOfficeJobDataContainer *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_struct_secret_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_BranchOfficeJobDataContainer, "spoolss_BranchOfficeJobDataContainer", object);
	} else {
		retstr = ndr_print_struct_string(pytalloc_get_mem_ctx(py_obj), (ndr_print_fn_t)ndr_print_spoolss_BranchOfficeJobDataContainer, "spoolss_BranchOfficeJobDataContainer", object);
		}
	ret = PyUnicode_FromString(retstr);
	talloc_free(retstr);

	return ret;
}

static PyMethodDef py_spoolss_BranchOfficeJobDataContainer_methods[] = {
	{ "__ndr_pack__", (PyCFunction)py_spoolss_BranchOfficeJobDataContainer_ndr_pack, METH_NOARGS, "S.ndr_pack(object) -> blob\nNDR pack" },
	{ "__ndr_unpack__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_BranchOfficeJobDataContainer_ndr_unpack), METH_VARARGS|METH_KEYWORDS, "S.ndr_unpack(class, blob, allow_remaining=False) -> None\nNDR unpack" },
	{ "__ndr_print__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_BranchOfficeJobDataContainer_ndr_print), METH_VARARGS|METH_KEYWORDS, "S.ndr_print(object, print_secrets=False) -> String\nNDR print" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_BranchOfficeJobDataContainer_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.BranchOfficeJobDataContainer",
	.tp_getset = py_spoolss_BranchOfficeJobDataContainer_getsetters,
	.tp_methods = py_spoolss_BranchOfficeJobDataContainer_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_BranchOfficeJobDataContainer_new,
};



static PyObject *py_spoolss_EnumPrinters_in_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
	return py_flags;
}

static int py_spoolss_EnumPrinters_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_EnumPrinters_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumPrinters_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPrinters_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrinters_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPrinters_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrinterInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_PrinterInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPrinters_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_PrinterInfo *info_switch_3;
					info_switch_3 = (union spoolss_PrinterInfo *)pyrpc_export_union(&spoolss_PrinterInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_PrinterInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrinters_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinters_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrinters_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrinters_getsetters[] = {
	{
		.name = discard_const_p(char, "in_flags"),
		.get = py_spoolss_EnumPrinters_in_get_flags,
		.set = py_spoolss_EnumPrinters_in_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_EnumPrinterFlags")
	},
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_EnumPrinters_in_get_server,
		.set = py_spoolss_EnumPrinters_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumPrinters_in_get_level,
		.set = py_spoolss_EnumPrinters_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPrinters_in_get_buffer,
		.set = py_spoolss_EnumPrinters_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrinters_in_get_offered,
		.set = py_spoolss_EnumPrinters_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPrinters_out_get_count,
		.set = py_spoolss_EnumPrinters_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPrinters_out_get_info,
		.set = py_spoolss_EnumPrinters_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrinters_out_get_needed,
		.set = py_spoolss_EnumPrinters_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrinters_get_result,
		.set = py_spoolss_EnumPrinters_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrinters_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrinters, type);
	struct spoolss_EnumPrinters *_self = (struct spoolss_EnumPrinters *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrinters_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(0);
}

static PyObject *py_spoolss_EnumPrinters_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 1) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinters_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[0];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrinters_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinters_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinters_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinters_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinters_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 1) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinters_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[0];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrinters_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinters_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinters_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinters_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinters_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinters *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 1) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinters_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[0];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrinters_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinters_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinters_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrinters_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinters_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinters_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrinters_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrinters_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrinters.opnum() -> 0 (0x00) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinters_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrinters_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrinters",
	.tp_getset = py_spoolss_EnumPrinters_getsetters,
	.tp_methods = py_spoolss_EnumPrinters_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrinters_new,
};

static bool pack_py_spoolss_EnumPrinters_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrinters *r)
{
	PyObject *py_flags;
	PyObject *py_server;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"flags", "server", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_EnumPrinters", discard_const_p(char *, kwnames), &py_flags, &py_server, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
		if (PyLong_Check(py_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrinters_args_out(struct spoolss_EnumPrinters *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrinterInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_PrinterInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_OpenPrinter_in_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->in.printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->in.printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->in.printername, strlen(object->in.printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_OpenPrinter_in_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printername");
		return -1;
	}
	if (value == Py_None) {
		object->in.printername = NULL;
	} else {
		object->in.printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinter_in_get_datatype(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_datatype;
	if (object->in.datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.datatype == NULL) {
		py_datatype = Py_None;
		Py_INCREF(py_datatype);
	} else {
		if (object->in.datatype == NULL) {
			py_datatype = Py_None;
			Py_INCREF(py_datatype);
		} else {
			py_datatype = PyUnicode_Decode(object->in.datatype, strlen(object->in.datatype), "utf-8", "ignore");
		}
	}
	return py_datatype;
}

static int py_spoolss_OpenPrinter_in_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.datatype");
		return -1;
	}
	if (value == Py_None) {
		object->in.datatype = NULL;
	} else {
		object->in.datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinter_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, pytalloc_get_mem_ctx(obj), &object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_OpenPrinter_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = *(struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_OpenPrinter_in_get_access_mask(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_access_mask;
	py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
	return py_access_mask;
}

static int py_spoolss_OpenPrinter_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.access_mask = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinter_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_OpenPrinter_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_OpenPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_OpenPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_OpenPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_printername"),
		.get = py_spoolss_OpenPrinter_in_get_printername,
		.set = py_spoolss_OpenPrinter_in_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_datatype"),
		.get = py_spoolss_OpenPrinter_in_get_datatype,
		.set = py_spoolss_OpenPrinter_in_set_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_OpenPrinter_in_get_devmode_ctr,
		.set = py_spoolss_OpenPrinter_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "in_access_mask"),
		.get = py_spoolss_OpenPrinter_in_get_access_mask,
		.set = py_spoolss_OpenPrinter_in_set_access_mask,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AccessRights")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_OpenPrinter_out_get_handle,
		.set = py_spoolss_OpenPrinter_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_OpenPrinter_get_result,
		.set = py_spoolss_OpenPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_OpenPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_OpenPrinter, type);
	struct spoolss_OpenPrinter *_self = (struct spoolss_OpenPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_OpenPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(1);
}

static PyObject *py_spoolss_OpenPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 2) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[1];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_OpenPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_OpenPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_OpenPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_OpenPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_OpenPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 2) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[1];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_OpenPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_OpenPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_OpenPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_OpenPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_OpenPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 2) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[1];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_OpenPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_OpenPrinter_ndr_print(py_obj, args, kwargs, "spoolss_OpenPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_OpenPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_OpenPrinter_ndr_print(py_obj, args, kwargs, "spoolss_OpenPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_OpenPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_OpenPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.OpenPrinter.opnum() -> 1 (0x01) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_OpenPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.OpenPrinter",
	.tp_getset = py_spoolss_OpenPrinter_getsetters,
	.tp_methods = py_spoolss_OpenPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_OpenPrinter_new,
};

static bool pack_py_spoolss_OpenPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_OpenPrinter *r)
{
	PyObject *py_printername;
	PyObject *py_datatype;
	PyObject *py_devmode_ctr;
	PyObject *py_access_mask;
	const char *kwnames[] = {
		"printername", "datatype", "devmode_ctr", "access_mask", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_OpenPrinter", discard_const_p(char *, kwnames), &py_printername, &py_datatype, &py_devmode_ctr, &py_access_mask)) {
		return false;
	}

	if (py_printername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printername");
		return false;
	}
	if (py_printername == Py_None) {
		r->in.printername = NULL;
	} else {
		r->in.printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_printername)) {
				unicode = PyUnicode_AsEncodedString(py_printername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_printername)) {
				test_str = PyBytes_AS_STRING(py_printername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_printername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.printername = talloc_str;
		}
	}
	if (py_datatype == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.datatype");
		return false;
	}
	if (py_datatype == Py_None) {
		r->in.datatype = NULL;
	} else {
		r->in.datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_datatype)) {
				unicode = PyUnicode_AsEncodedString(py_datatype, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_datatype)) {
				test_str = PyBytes_AS_STRING(py_datatype);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_datatype)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.datatype = talloc_str;
		}
	}
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = *(struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	if (py_access_mask == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
		if (PyLong_Check(py_access_mask)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_access_mask);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.access_mask = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_OpenPrinter_args_out(struct spoolss_OpenPrinter *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_SetJob_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_SetJob_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetJob_in_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->in.job_id));
	return py_job_id;
}

static int py_spoolss_SetJob_in_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJob_in_get_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_ctr;
	if (object->in.ctr == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.ctr == NULL) {
		py_ctr = Py_None;
		Py_INCREF(py_ctr);
	} else {
		py_ctr = pytalloc_reference_ex(&spoolss_JobInfoContainer_Type, object->in.ctr, object->in.ctr);
	}
	return py_ctr;
}

static int py_spoolss_SetJob_in_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.ctr");
		return -1;
	}
	if (value == Py_None) {
		object->in.ctr = NULL;
	} else {
		object->in.ctr = NULL;
		PY_CHECK_TYPE(&spoolss_JobInfoContainer_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.ctr = (struct spoolss_JobInfoContainer *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_SetJob_in_get_command(PyObject *obj, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_command;
	py_command = PyLong_FromUnsignedLongLong((uint32_t)(object->in.command));
	return py_command;
}

static int py_spoolss_SetJob_in_set_command(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.command");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.command));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.command = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJob_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetJob_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetJob_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_SetJob_in_get_handle,
		.set = py_spoolss_SetJob_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_job_id"),
		.get = py_spoolss_SetJob_in_get_job_id,
		.set = py_spoolss_SetJob_in_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_ctr"),
		.get = py_spoolss_SetJob_in_get_ctr,
		.set = py_spoolss_SetJob_in_set_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobInfoContainer")
	},
	{
		.name = discard_const_p(char, "in_command"),
		.get = py_spoolss_SetJob_in_get_command,
		.set = py_spoolss_SetJob_in_set_command,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobControl")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetJob_get_result,
		.set = py_spoolss_SetJob_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetJob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetJob, type);
	struct spoolss_SetJob *_self = (struct spoolss_SetJob *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_SetJob_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(2);
}

static PyObject *py_spoolss_SetJob_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 3) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJob_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[2];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetJob_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetJob_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetJob_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetJob_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetJob_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 3) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJob_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[2];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetJob_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetJob_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetJob_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetJob_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetJob_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJob *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 3) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJob_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[2];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetJob_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetJob_ndr_print(py_obj, args, kwargs, "spoolss_SetJob_in", NDR_IN);
}

static PyObject *py_spoolss_SetJob_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetJob_ndr_print(py_obj, args, kwargs, "spoolss_SetJob_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetJob_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetJob_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetJob.opnum() -> 2 (0x02) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJob_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetJob_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJob",
	.tp_getset = py_spoolss_SetJob_getsetters,
	.tp_methods = py_spoolss_SetJob_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJob_new,
};

static bool pack_py_spoolss_SetJob_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetJob *r)
{
	PyObject *py_handle;
	PyObject *py_job_id;
	PyObject *py_ctr;
	PyObject *py_command;
	const char *kwnames[] = {
		"handle", "job_id", "ctr", "command", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_SetJob", discard_const_p(char *, kwnames), &py_handle, &py_job_id, &py_ctr, &py_command)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_job_id == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.job_id");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.job_id));
		if (PyLong_Check(py_job_id)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_job_id);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.ctr");
		return false;
	}
	if (py_ctr == Py_None) {
		r->in.ctr = NULL;
	} else {
		r->in.ctr = NULL;
		PY_CHECK_TYPE(&spoolss_JobInfoContainer_Type, py_ctr, return false;);
		if (talloc_reference(r, pytalloc_get_mem_ctx(py_ctr)) == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.ctr = (struct spoolss_JobInfoContainer *)pytalloc_get_ptr(py_ctr);
	}
	if (py_command == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.command");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.command));
		if (PyLong_Check(py_command)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_command);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.command = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_SetJob_args_out(struct spoolss_SetJob *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetJob_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetJob_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetJob_in_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(object->in.job_id));
	return py_job_id;
}

static int py_spoolss_GetJob_in_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.job_id");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetJob_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetJob_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetJob_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_JobInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_JobInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetJob_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_JobInfo *info_switch_2;
			info_switch_2 = (union spoolss_JobInfo *)pyrpc_export_union(&spoolss_JobInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_JobInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetJob_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJob_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetJob_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetJob_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetJob_in_get_handle,
		.set = py_spoolss_GetJob_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_job_id"),
		.get = py_spoolss_GetJob_in_get_job_id,
		.set = py_spoolss_GetJob_in_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetJob_in_get_level,
		.set = py_spoolss_GetJob_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetJob_in_get_buffer,
		.set = py_spoolss_GetJob_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetJob_in_get_offered,
		.set = py_spoolss_GetJob_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetJob_out_get_info,
		.set = py_spoolss_GetJob_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetJob_out_get_needed,
		.set = py_spoolss_GetJob_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetJob_get_result,
		.set = py_spoolss_GetJob_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetJob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetJob, type);
	struct spoolss_GetJob *_self = (struct spoolss_GetJob *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetJob_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(3);
}

static PyObject *py_spoolss_GetJob_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 4) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJob_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[3];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetJob_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetJob_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetJob_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetJob_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetJob_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 4) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJob_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[3];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetJob_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetJob_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetJob_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetJob_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetJob_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJob *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 4) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJob_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[3];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetJob_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetJob_ndr_print(py_obj, args, kwargs, "spoolss_GetJob_in", NDR_IN);
}

static PyObject *py_spoolss_GetJob_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetJob_ndr_print(py_obj, args, kwargs, "spoolss_GetJob_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetJob_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetJob_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetJob.opnum() -> 3 (0x03) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJob_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetJob_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetJob",
	.tp_getset = py_spoolss_GetJob_getsetters,
	.tp_methods = py_spoolss_GetJob_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetJob_new,
};

static bool pack_py_spoolss_GetJob_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetJob *r)
{
	PyObject *py_handle;
	PyObject *py_job_id;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "job_id", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetJob", discard_const_p(char *, kwnames), &py_handle, &py_job_id, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_job_id == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.job_id");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.job_id));
		if (PyLong_Check(py_job_id)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_job_id);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetJob_args_out(struct spoolss_GetJob *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_JobInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_JobInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EnumJobs_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EnumJobs_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumJobs_in_get_firstjob(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_firstjob;
	py_firstjob = PyLong_FromUnsignedLongLong((uint32_t)(object->in.firstjob));
	return py_firstjob;
}

static int py_spoolss_EnumJobs_in_set_firstjob(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.firstjob");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.firstjob));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.firstjob = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_in_get_numjobs(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_numjobs;
	py_numjobs = PyLong_FromUnsignedLongLong((uint32_t)(object->in.numjobs));
	return py_numjobs;
}

static int py_spoolss_EnumJobs_in_set_numjobs(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.numjobs");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.numjobs));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.numjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumJobs_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumJobs_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumJobs_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumJobs_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_JobInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_JobInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumJobs_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_JobInfo *info_switch_3;
					info_switch_3 = (union spoolss_JobInfo *)pyrpc_export_union(&spoolss_JobInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_JobInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumJobs_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobs_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumJobs_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumJobs_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EnumJobs_in_get_handle,
		.set = py_spoolss_EnumJobs_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_firstjob"),
		.get = py_spoolss_EnumJobs_in_get_firstjob,
		.set = py_spoolss_EnumJobs_in_set_firstjob,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_numjobs"),
		.get = py_spoolss_EnumJobs_in_get_numjobs,
		.set = py_spoolss_EnumJobs_in_set_numjobs,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumJobs_in_get_level,
		.set = py_spoolss_EnumJobs_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumJobs_in_get_buffer,
		.set = py_spoolss_EnumJobs_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumJobs_in_get_offered,
		.set = py_spoolss_EnumJobs_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumJobs_out_get_count,
		.set = py_spoolss_EnumJobs_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumJobs_out_get_info,
		.set = py_spoolss_EnumJobs_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_JobInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumJobs_out_get_needed,
		.set = py_spoolss_EnumJobs_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumJobs_get_result,
		.set = py_spoolss_EnumJobs_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumJobs_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumJobs, type);
	struct spoolss_EnumJobs *_self = (struct spoolss_EnumJobs *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumJobs_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(4);
}

static PyObject *py_spoolss_EnumJobs_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 5) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobs_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[4];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumJobs_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumJobs_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumJobs_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumJobs_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumJobs_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 5) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobs_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[4];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumJobs_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumJobs_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumJobs_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumJobs_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumJobs_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobs *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 5) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobs_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[4];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumJobs_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumJobs_ndr_print(py_obj, args, kwargs, "spoolss_EnumJobs_in", NDR_IN);
}

static PyObject *py_spoolss_EnumJobs_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumJobs_ndr_print(py_obj, args, kwargs, "spoolss_EnumJobs_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumJobs_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumJobs_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumJobs.opnum() -> 4 (0x04) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobs_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumJobs_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumJobs",
	.tp_getset = py_spoolss_EnumJobs_getsetters,
	.tp_methods = py_spoolss_EnumJobs_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumJobs_new,
};

static bool pack_py_spoolss_EnumJobs_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumJobs *r)
{
	PyObject *py_handle;
	PyObject *py_firstjob;
	PyObject *py_numjobs;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "firstjob", "numjobs", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:spoolss_EnumJobs", discard_const_p(char *, kwnames), &py_handle, &py_firstjob, &py_numjobs, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_firstjob == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.firstjob");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.firstjob));
		if (PyLong_Check(py_firstjob)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_firstjob);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.firstjob = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_numjobs == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.numjobs");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.numjobs));
		if (PyLong_Check(py_numjobs)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_numjobs);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.numjobs = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumJobs_args_out(struct spoolss_EnumJobs *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_JobInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_JobInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPrinter_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_AddPrinter_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrinter_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_SetPrinterInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_AddPrinter_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinter_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	if (object->in.devmode_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, object->in.devmode_ctr, object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_AddPrinter_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.devmode_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	object->in.devmode_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.devmode_ctr);
	if (object->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinter_in_get_secdesc_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc_ctr;
	if (object->in.secdesc_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_secdesc_ctr = pytalloc_reference_ex(sec_desc_buf_Type, object->in.secdesc_ctr, object->in.secdesc_ctr);
	return py_secdesc_ctr;
}

static int py_spoolss_AddPrinter_in_set_secdesc_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.secdesc_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.secdesc_ctr");
		return -1;
	}
	object->in.secdesc_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.secdesc_ctr);
	if (object->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinter_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_AddPrinter_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_AddPrinter_in_get_server,
		.set = py_spoolss_AddPrinter_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_AddPrinter_in_get_info_ctr,
		.set = py_spoolss_AddPrinter_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPrinterInfoCtr")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_AddPrinter_in_get_devmode_ctr,
		.set = py_spoolss_AddPrinter_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "in_secdesc_ctr"),
		.get = py_spoolss_AddPrinter_in_get_secdesc_ctr,
		.set = py_spoolss_AddPrinter_in_set_secdesc_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_AddPrinter_out_get_handle,
		.set = py_spoolss_AddPrinter_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPrinter_get_result,
		.set = py_spoolss_AddPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPrinter, type);
	struct spoolss_AddPrinter *_self = (struct spoolss_AddPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_SetPrinterInfoCtr);
	_self->in.devmode_ctr = talloc_zero(mem_ctx, struct spoolss_DevmodeContainer);
	_self->in.secdesc_ctr = talloc_zero(mem_ctx, struct sec_desc_buf);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_AddPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(5);
}

static PyObject *py_spoolss_AddPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 6) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[5];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 6) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[5];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 6) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[5];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinter_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_AddPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinter_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPrinter.opnum() -> 5 (0x05) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPrinter",
	.tp_getset = py_spoolss_AddPrinter_getsetters,
	.tp_methods = py_spoolss_AddPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPrinter_new,
};

static bool pack_py_spoolss_AddPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPrinter *r)
{
	PyObject *py_server;
	PyObject *py_info_ctr;
	PyObject *py_devmode_ctr;
	PyObject *py_secdesc_ctr;
	const char *kwnames[] = {
		"server", "info_ctr", "devmode_ctr", "secdesc_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_AddPrinter", discard_const_p(char *, kwnames), &py_server, &py_info_ctr, &py_devmode_ctr, &py_secdesc_ctr)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	r->in.devmode_ctr = talloc_ptrtype(r, r->in.devmode_ctr);
	if (r->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	if (py_secdesc_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.secdesc_ctr");
		return false;
	}
	r->in.secdesc_ctr = talloc_ptrtype(r, r->in.secdesc_ctr);
	if (r->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, py_secdesc_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_secdesc_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(py_secdesc_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_AddPrinter_args_out(struct spoolss_AddPrinter *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_DeletePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_DeletePrinter_in_get_handle,
		.set = py_spoolss_DeletePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinter_get_result,
		.set = py_spoolss_DeletePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinter, type);
	struct spoolss_DeletePrinter *_self = (struct spoolss_DeletePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeletePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(6);
}

static PyObject *py_spoolss_DeletePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 7) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[6];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 7) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[6];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 7) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[6];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinter_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinter_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinter.opnum() -> 6 (0x06) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinter",
	.tp_getset = py_spoolss_DeletePrinter_getsetters,
	.tp_methods = py_spoolss_DeletePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinter_new,
};

static bool pack_py_spoolss_DeletePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_DeletePrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinter_args_out(struct spoolss_DeletePrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_SetPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_SetPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinter_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_SetPrinterInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_SetPrinter_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinter_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	if (object->in.devmode_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, object->in.devmode_ctr, object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_SetPrinter_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.devmode_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	object->in.devmode_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.devmode_ctr);
	if (object->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinter_in_get_secdesc_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc_ctr;
	if (object->in.secdesc_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_secdesc_ctr = pytalloc_reference_ex(sec_desc_buf_Type, object->in.secdesc_ctr, object->in.secdesc_ctr);
	return py_secdesc_ctr;
}

static int py_spoolss_SetPrinter_in_set_secdesc_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.secdesc_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.secdesc_ctr");
		return -1;
	}
	object->in.secdesc_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.secdesc_ctr);
	if (object->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinter_in_get_command(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_command;
	py_command = PyLong_FromUnsignedLongLong((uint32_t)(object->in.command));
	return py_command;
}

static int py_spoolss_SetPrinter_in_set_command(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.command");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.command));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.command = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_SetPrinter_in_get_handle,
		.set = py_spoolss_SetPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_SetPrinter_in_get_info_ctr,
		.set = py_spoolss_SetPrinter_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPrinterInfoCtr")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_SetPrinter_in_get_devmode_ctr,
		.set = py_spoolss_SetPrinter_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "in_secdesc_ctr"),
		.get = py_spoolss_SetPrinter_in_get_secdesc_ctr,
		.set = py_spoolss_SetPrinter_in_set_secdesc_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
	},
	{
		.name = discard_const_p(char, "in_command"),
		.get = py_spoolss_SetPrinter_in_get_command,
		.set = py_spoolss_SetPrinter_in_set_command,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterControl")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetPrinter_get_result,
		.set = py_spoolss_SetPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetPrinter, type);
	struct spoolss_SetPrinter *_self = (struct spoolss_SetPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_SetPrinterInfoCtr);
	_self->in.devmode_ctr = talloc_zero(mem_ctx, struct spoolss_DevmodeContainer);
	_self->in.secdesc_ctr = talloc_zero(mem_ctx, struct sec_desc_buf);
	return self;
}

static PyObject *py_spoolss_SetPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(7);
}

static PyObject *py_spoolss_SetPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 8) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[7];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 8) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[7];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 8) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[7];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_SetPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetPrinter.opnum() -> 7 (0x07) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinter",
	.tp_getset = py_spoolss_SetPrinter_getsetters,
	.tp_methods = py_spoolss_SetPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinter_new,
};

static bool pack_py_spoolss_SetPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_info_ctr;
	PyObject *py_devmode_ctr;
	PyObject *py_secdesc_ctr;
	PyObject *py_command;
	const char *kwnames[] = {
		"handle", "info_ctr", "devmode_ctr", "secdesc_ctr", "command", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_SetPrinter", discard_const_p(char *, kwnames), &py_handle, &py_info_ctr, &py_devmode_ctr, &py_secdesc_ctr, &py_command)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	r->in.devmode_ctr = talloc_ptrtype(r, r->in.devmode_ctr);
	if (r->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	if (py_secdesc_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.secdesc_ctr");
		return false;
	}
	r->in.secdesc_ctr = talloc_ptrtype(r, r->in.secdesc_ctr);
	if (r->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, py_secdesc_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_secdesc_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(py_secdesc_ctr);
	if (py_command == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.command");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.command));
		if (PyLong_Check(py_command)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_command);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.command = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_SetPrinter_args_out(struct spoolss_SetPrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetPrinter_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetPrinter_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinter_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetPrinter_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinter_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinter_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinter_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_PrinterInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_PrinterInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetPrinter_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_PrinterInfo *info_switch_2;
			info_switch_2 = (union spoolss_PrinterInfo *)pyrpc_export_union(&spoolss_PrinterInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_PrinterInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinter_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinter_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetPrinter_in_get_handle,
		.set = py_spoolss_GetPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetPrinter_in_get_level,
		.set = py_spoolss_GetPrinter_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetPrinter_in_get_buffer,
		.set = py_spoolss_GetPrinter_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinter_in_get_offered,
		.set = py_spoolss_GetPrinter_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetPrinter_out_get_info,
		.set = py_spoolss_GetPrinter_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinter_out_get_needed,
		.set = py_spoolss_GetPrinter_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinter_get_result,
		.set = py_spoolss_GetPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinter, type);
	struct spoolss_GetPrinter *_self = (struct spoolss_GetPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(8);
}

static PyObject *py_spoolss_GetPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 9) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[8];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 9) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[8];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 9) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[8];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinter.opnum() -> 8 (0x08) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinter",
	.tp_getset = py_spoolss_GetPrinter_getsetters,
	.tp_methods = py_spoolss_GetPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinter_new,
};

static bool pack_py_spoolss_GetPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_GetPrinter", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinter_args_out(struct spoolss_GetPrinter *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_PrinterInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_PrinterInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPrinterDriver_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_AddPrinterDriver_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrinterDriver_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_AddDriverInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_AddPrinterDriver_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_AddDriverInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_AddDriverInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterDriver_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPrinterDriver_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPrinterDriver_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_AddPrinterDriver_in_get_servername,
		.set = py_spoolss_AddPrinterDriver_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_AddPrinterDriver_in_get_info_ctr,
		.set = py_spoolss_AddPrinterDriver_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddDriverInfoCtr")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPrinterDriver_get_result,
		.set = py_spoolss_AddPrinterDriver_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPrinterDriver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPrinterDriver, type);
	struct spoolss_AddPrinterDriver *_self = (struct spoolss_AddPrinterDriver *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_AddDriverInfoCtr);
	return self;
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(9);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 10) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriver_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[9];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterDriver_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterDriver_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 10) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriver_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[9];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterDriver_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterDriver_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriver *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 10) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriver_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[9];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterDriver_in", NDR_IN);
}

static PyObject *py_spoolss_AddPrinterDriver_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterDriver_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPrinterDriver_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPrinterDriver_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPrinterDriver.opnum() -> 9 (0x09) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriver_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPrinterDriver_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPrinterDriver",
	.tp_getset = py_spoolss_AddPrinterDriver_getsetters,
	.tp_methods = py_spoolss_AddPrinterDriver_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPrinterDriver_new,
};

static bool pack_py_spoolss_AddPrinterDriver_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPrinterDriver *r)
{
	PyObject *py_servername;
	PyObject *py_info_ctr;
	const char *kwnames[] = {
		"servername", "info_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_AddPrinterDriver", discard_const_p(char *, kwnames), &py_servername, &py_info_ctr)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_AddDriverInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_AddDriverInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_AddPrinterDriver_args_out(struct spoolss_AddPrinterDriver *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumPrinterDrivers_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_EnumPrinterDrivers_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_in_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->in.environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		if (object->in.environment == NULL) {
			py_environment = Py_None;
			Py_INCREF(py_environment);
		} else {
			py_environment = PyUnicode_Decode(object->in.environment, strlen(object->in.environment), "utf-8", "ignore");
		}
	}
	return py_environment;
}

static int py_spoolss_EnumPrinterDrivers_in_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.environment");
		return -1;
	}
	if (value == Py_None) {
		object->in.environment = NULL;
	} else {
		object->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumPrinterDrivers_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPrinterDrivers_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrinterDrivers_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPrinterDrivers_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_DriverInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_DriverInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPrinterDrivers_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_DriverInfo *info_switch_3;
					info_switch_3 = (union spoolss_DriverInfo *)pyrpc_export_union(&spoolss_DriverInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_DriverInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrinterDrivers_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDrivers_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrinterDrivers_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrinterDrivers_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_EnumPrinterDrivers_in_get_server,
		.set = py_spoolss_EnumPrinterDrivers_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_environment"),
		.get = py_spoolss_EnumPrinterDrivers_in_get_environment,
		.set = py_spoolss_EnumPrinterDrivers_in_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumPrinterDrivers_in_get_level,
		.set = py_spoolss_EnumPrinterDrivers_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPrinterDrivers_in_get_buffer,
		.set = py_spoolss_EnumPrinterDrivers_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrinterDrivers_in_get_offered,
		.set = py_spoolss_EnumPrinterDrivers_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPrinterDrivers_out_get_count,
		.set = py_spoolss_EnumPrinterDrivers_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPrinterDrivers_out_get_info,
		.set = py_spoolss_EnumPrinterDrivers_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrinterDrivers_out_get_needed,
		.set = py_spoolss_EnumPrinterDrivers_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrinterDrivers_get_result,
		.set = py_spoolss_EnumPrinterDrivers_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrinterDrivers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrinterDrivers, type);
	struct spoolss_EnumPrinterDrivers *_self = (struct spoolss_EnumPrinterDrivers *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(10);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 11) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDrivers_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[10];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterDrivers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterDrivers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 11) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDrivers_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[10];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterDrivers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterDrivers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDrivers *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 11) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDrivers_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[10];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterDrivers_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterDrivers_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrinterDrivers_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterDrivers_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterDrivers_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrinterDrivers_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrinterDrivers_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrinterDrivers.opnum() -> 10 (0x0a) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDrivers_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrinterDrivers_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrinterDrivers",
	.tp_getset = py_spoolss_EnumPrinterDrivers_getsetters,
	.tp_methods = py_spoolss_EnumPrinterDrivers_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrinterDrivers_new,
};

static bool pack_py_spoolss_EnumPrinterDrivers_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrinterDrivers *r)
{
	PyObject *py_server;
	PyObject *py_environment;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"server", "environment", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_EnumPrinterDrivers", discard_const_p(char *, kwnames), &py_server, &py_environment, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_environment == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.environment");
		return false;
	}
	if (py_environment == Py_None) {
		r->in.environment = NULL;
	} else {
		r->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_environment)) {
				unicode = PyUnicode_AsEncodedString(py_environment, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_environment)) {
				test_str = PyBytes_AS_STRING(py_environment);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_environment)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.environment = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrinterDrivers_args_out(struct spoolss_EnumPrinterDrivers *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_DriverInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_DriverInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_GetPrinterDriver_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetPrinterDriver_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->in.architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_GetPrinterDriver_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	if (value == Py_None) {
		object->in.architecture = NULL;
	} else {
		object->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetPrinterDriver_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetPrinterDriver_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinterDriver_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_DriverInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetPrinterDriver_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_DriverInfo *info_switch_2;
			info_switch_2 = (union spoolss_DriverInfo *)pyrpc_export_union(&spoolss_DriverInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_DriverInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinterDriver_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterDriver_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterDriver_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetPrinterDriver_in_get_handle,
		.set = py_spoolss_GetPrinterDriver_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_GetPrinterDriver_in_get_architecture,
		.set = py_spoolss_GetPrinterDriver_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetPrinterDriver_in_get_level,
		.set = py_spoolss_GetPrinterDriver_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetPrinterDriver_in_get_buffer,
		.set = py_spoolss_GetPrinterDriver_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinterDriver_in_get_offered,
		.set = py_spoolss_GetPrinterDriver_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetPrinterDriver_out_get_info,
		.set = py_spoolss_GetPrinterDriver_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinterDriver_out_get_needed,
		.set = py_spoolss_GetPrinterDriver_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterDriver_get_result,
		.set = py_spoolss_GetPrinterDriver_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterDriver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterDriver, type);
	struct spoolss_GetPrinterDriver *_self = (struct spoolss_GetPrinterDriver *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(11);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 12) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[11];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriver_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriver_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 12) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[11];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriver_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriver_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 12) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[11];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriver_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterDriver_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriver_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterDriver_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterDriver_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterDriver.opnum() -> 11 (0x0b) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterDriver_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterDriver",
	.tp_getset = py_spoolss_GetPrinterDriver_getsetters,
	.tp_methods = py_spoolss_GetPrinterDriver_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterDriver_new,
};

static bool pack_py_spoolss_GetPrinterDriver_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterDriver *r)
{
	PyObject *py_handle;
	PyObject *py_architecture;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "architecture", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetPrinterDriver", discard_const_p(char *, kwnames), &py_handle, &py_architecture, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	if (py_architecture == Py_None) {
		r->in.architecture = NULL;
	} else {
		r->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_architecture)) {
				unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_architecture)) {
				test_str = PyBytes_AS_STRING(py_architecture);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.architecture = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterDriver_args_out(struct spoolss_GetPrinterDriver *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_DriverInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_GetPrinterDriverDirectory_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_GetPrinterDriverDirectory_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_in_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->in.environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		if (object->in.environment == NULL) {
			py_environment = Py_None;
			Py_INCREF(py_environment);
		} else {
			py_environment = PyUnicode_Decode(object->in.environment, strlen(object->in.environment), "utf-8", "ignore");
		}
	}
	return py_environment;
}

static int py_spoolss_GetPrinterDriverDirectory_in_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.environment");
		return -1;
	}
	if (value == Py_None) {
		object->in.environment = NULL;
	} else {
		object->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetPrinterDriverDirectory_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetPrinterDriverDirectory_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinterDriverDirectory_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverDirectoryInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_DriverDirectoryInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetPrinterDriverDirectory_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_DriverDirectoryInfo *info_switch_2;
			info_switch_2 = (union spoolss_DriverDirectoryInfo *)pyrpc_export_union(&spoolss_DriverDirectoryInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_DriverDirectoryInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinterDriverDirectory_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterDriverDirectory_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterDriverDirectory_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_GetPrinterDriverDirectory_in_get_server,
		.set = py_spoolss_GetPrinterDriverDirectory_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_environment"),
		.get = py_spoolss_GetPrinterDriverDirectory_in_get_environment,
		.set = py_spoolss_GetPrinterDriverDirectory_in_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetPrinterDriverDirectory_in_get_level,
		.set = py_spoolss_GetPrinterDriverDirectory_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetPrinterDriverDirectory_in_get_buffer,
		.set = py_spoolss_GetPrinterDriverDirectory_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinterDriverDirectory_in_get_offered,
		.set = py_spoolss_GetPrinterDriverDirectory_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetPrinterDriverDirectory_out_get_info,
		.set = py_spoolss_GetPrinterDriverDirectory_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverDirectoryInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinterDriverDirectory_out_get_needed,
		.set = py_spoolss_GetPrinterDriverDirectory_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterDriverDirectory_get_result,
		.set = py_spoolss_GetPrinterDriverDirectory_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterDriverDirectory_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterDriverDirectory, type);
	struct spoolss_GetPrinterDriverDirectory *_self = (struct spoolss_GetPrinterDriverDirectory *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(12);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 13) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverDirectory_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[12];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriverDirectory_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriverDirectory_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 13) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverDirectory_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[12];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriverDirectory_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriverDirectory_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverDirectory *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 13) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverDirectory_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[12];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriverDirectory_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriverDirectory_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterDriverDirectory_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriverDirectory_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriverDirectory_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterDriverDirectory_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterDriverDirectory_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterDriverDirectory.opnum() -> 12 (0x0c) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverDirectory_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterDriverDirectory_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterDriverDirectory",
	.tp_getset = py_spoolss_GetPrinterDriverDirectory_getsetters,
	.tp_methods = py_spoolss_GetPrinterDriverDirectory_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterDriverDirectory_new,
};

static bool pack_py_spoolss_GetPrinterDriverDirectory_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterDriverDirectory *r)
{
	PyObject *py_server;
	PyObject *py_environment;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"server", "environment", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetPrinterDriverDirectory", discard_const_p(char *, kwnames), &py_server, &py_environment, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_environment == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.environment");
		return false;
	}
	if (py_environment == Py_None) {
		r->in.environment = NULL;
	} else {
		r->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_environment)) {
				unicode = PyUnicode_AsEncodedString(py_environment, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_environment)) {
				test_str = PyBytes_AS_STRING(py_environment);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_environment)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.environment = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterDriverDirectory_args_out(struct spoolss_GetPrinterDriverDirectory *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverDirectoryInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_DriverDirectoryInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterDriver_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_DeletePrinterDriver_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriver_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
	}
	return py_architecture;
}

static int py_spoolss_DeletePrinterDriver_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.architecture = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriver_in_get_driver(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_driver;
	if (object->in.driver == NULL) {
		py_driver = Py_None;
		Py_INCREF(py_driver);
	} else {
		py_driver = PyUnicode_Decode(object->in.driver, strlen(object->in.driver), "utf-8", "ignore");
	}
	return py_driver;
}

static int py_spoolss_DeletePrinterDriver_in_set_driver(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.driver");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.driver = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriver_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterDriver_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterDriver_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_DeletePrinterDriver_in_get_server,
		.set = py_spoolss_DeletePrinterDriver_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_DeletePrinterDriver_in_get_architecture,
		.set = py_spoolss_DeletePrinterDriver_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_driver"),
		.get = py_spoolss_DeletePrinterDriver_in_get_driver,
		.set = py_spoolss_DeletePrinterDriver_in_set_driver,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterDriver_get_result,
		.set = py_spoolss_DeletePrinterDriver_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterDriver_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterDriver, type);
	return self;
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(13);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 14) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriver_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[13];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDriver_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDriver_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 14) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriver_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[13];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDriver_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDriver_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriver *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 14) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriver_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[13];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDriver_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterDriver_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDriver_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDriver_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterDriver_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterDriver_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterDriver.opnum() -> 13 (0x0d) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriver_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterDriver_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterDriver",
	.tp_getset = py_spoolss_DeletePrinterDriver_getsetters,
	.tp_methods = py_spoolss_DeletePrinterDriver_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterDriver_new,
};

static bool pack_py_spoolss_DeletePrinterDriver_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterDriver *r)
{
	PyObject *py_server;
	PyObject *py_architecture;
	PyObject *py_driver;
	const char *kwnames[] = {
		"server", "architecture", "driver", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_DeletePrinterDriver", discard_const_p(char *, kwnames), &py_server, &py_architecture, &py_driver)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_architecture)) {
			unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_architecture)) {
			test_str = PyBytes_AS_STRING(py_architecture);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.architecture = talloc_str;
	}
	if (py_driver == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.driver");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_driver)) {
			unicode = PyUnicode_AsEncodedString(py_driver, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_driver)) {
			test_str = PyBytes_AS_STRING(py_driver);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_driver)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.driver = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterDriver_args_out(struct spoolss_DeletePrinterDriver *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_AddPrintProcessor_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_AddPrintProcessor_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrintProcessor_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
	}
	return py_architecture;
}

static int py_spoolss_AddPrintProcessor_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.architecture = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPrintProcessor_in_get_path_name(PyObject *obj, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_path_name;
	if (object->in.path_name == NULL) {
		py_path_name = Py_None;
		Py_INCREF(py_path_name);
	} else {
		py_path_name = PyUnicode_Decode(object->in.path_name, strlen(object->in.path_name), "utf-8", "ignore");
	}
	return py_path_name;
}

static int py_spoolss_AddPrintProcessor_in_set_path_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.path_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.path_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPrintProcessor_in_get_print_processor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor_name;
	if (object->in.print_processor_name == NULL) {
		py_print_processor_name = Py_None;
		Py_INCREF(py_print_processor_name);
	} else {
		py_print_processor_name = PyUnicode_Decode(object->in.print_processor_name, strlen(object->in.print_processor_name), "utf-8", "ignore");
	}
	return py_print_processor_name;
}

static int py_spoolss_AddPrintProcessor_in_set_print_processor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.print_processor_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.print_processor_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPrintProcessor_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPrintProcessor_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPrintProcessor_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_AddPrintProcessor_in_get_server,
		.set = py_spoolss_AddPrintProcessor_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_AddPrintProcessor_in_get_architecture,
		.set = py_spoolss_AddPrintProcessor_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_path_name"),
		.get = py_spoolss_AddPrintProcessor_in_get_path_name,
		.set = py_spoolss_AddPrintProcessor_in_set_path_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_print_processor_name"),
		.get = py_spoolss_AddPrintProcessor_in_get_print_processor_name,
		.set = py_spoolss_AddPrintProcessor_in_set_print_processor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPrintProcessor_get_result,
		.set = py_spoolss_AddPrintProcessor_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPrintProcessor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPrintProcessor, type);
	return self;
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(14);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 15) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrintProcessor_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[14];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrintProcessor_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrintProcessor_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 15) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrintProcessor_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[14];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrintProcessor_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrintProcessor_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrintProcessor *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 15) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrintProcessor_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[14];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrintProcessor_ndr_print(py_obj, args, kwargs, "spoolss_AddPrintProcessor_in", NDR_IN);
}

static PyObject *py_spoolss_AddPrintProcessor_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrintProcessor_ndr_print(py_obj, args, kwargs, "spoolss_AddPrintProcessor_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPrintProcessor_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPrintProcessor_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPrintProcessor.opnum() -> 14 (0x0e) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrintProcessor_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPrintProcessor_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPrintProcessor",
	.tp_getset = py_spoolss_AddPrintProcessor_getsetters,
	.tp_methods = py_spoolss_AddPrintProcessor_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPrintProcessor_new,
};

static bool pack_py_spoolss_AddPrintProcessor_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPrintProcessor *r)
{
	PyObject *py_server;
	PyObject *py_architecture;
	PyObject *py_path_name;
	PyObject *py_print_processor_name;
	const char *kwnames[] = {
		"server", "architecture", "path_name", "print_processor_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_AddPrintProcessor", discard_const_p(char *, kwnames), &py_server, &py_architecture, &py_path_name, &py_print_processor_name)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_architecture)) {
			unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_architecture)) {
			test_str = PyBytes_AS_STRING(py_architecture);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.architecture = talloc_str;
	}
	if (py_path_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.path_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_path_name)) {
			unicode = PyUnicode_AsEncodedString(py_path_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_path_name)) {
			test_str = PyBytes_AS_STRING(py_path_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_path_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.path_name = talloc_str;
	}
	if (py_print_processor_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.print_processor_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_print_processor_name)) {
			unicode = PyUnicode_AsEncodedString(py_print_processor_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_print_processor_name)) {
			test_str = PyBytes_AS_STRING(py_print_processor_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_print_processor_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.print_processor_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_AddPrintProcessor_args_out(struct spoolss_AddPrintProcessor *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumPrintProcessors_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_EnumPrintProcessors_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_in_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->in.environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		if (object->in.environment == NULL) {
			py_environment = Py_None;
			Py_INCREF(py_environment);
		} else {
			py_environment = PyUnicode_Decode(object->in.environment, strlen(object->in.environment), "utf-8", "ignore");
		}
	}
	return py_environment;
}

static int py_spoolss_EnumPrintProcessors_in_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.environment");
		return -1;
	}
	if (value == Py_None) {
		object->in.environment = NULL;
	} else {
		object->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumPrintProcessors_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPrintProcessors_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrintProcessors_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPrintProcessors_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrintProcessorInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_PrintProcessorInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPrintProcessors_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_PrintProcessorInfo *info_switch_3;
					info_switch_3 = (union spoolss_PrintProcessorInfo *)pyrpc_export_union(&spoolss_PrintProcessorInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_PrintProcessorInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrintProcessors_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessors_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrintProcessors_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrintProcessors_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_EnumPrintProcessors_in_get_servername,
		.set = py_spoolss_EnumPrintProcessors_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_environment"),
		.get = py_spoolss_EnumPrintProcessors_in_get_environment,
		.set = py_spoolss_EnumPrintProcessors_in_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumPrintProcessors_in_get_level,
		.set = py_spoolss_EnumPrintProcessors_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPrintProcessors_in_get_buffer,
		.set = py_spoolss_EnumPrintProcessors_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrintProcessors_in_get_offered,
		.set = py_spoolss_EnumPrintProcessors_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPrintProcessors_out_get_count,
		.set = py_spoolss_EnumPrintProcessors_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPrintProcessors_out_get_info,
		.set = py_spoolss_EnumPrintProcessors_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintProcessorInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrintProcessors_out_get_needed,
		.set = py_spoolss_EnumPrintProcessors_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrintProcessors_get_result,
		.set = py_spoolss_EnumPrintProcessors_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrintProcessors_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrintProcessors, type);
	struct spoolss_EnumPrintProcessors *_self = (struct spoolss_EnumPrintProcessors *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(15);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 16) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessors_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[15];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrintProcessors_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrintProcessors_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 16) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessors_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[15];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrintProcessors_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrintProcessors_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessors *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 16) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessors_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[15];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrintProcessors_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrintProcessors_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrintProcessors_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrintProcessors_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrintProcessors_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrintProcessors_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrintProcessors_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrintProcessors.opnum() -> 15 (0x0f) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessors_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrintProcessors_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrintProcessors",
	.tp_getset = py_spoolss_EnumPrintProcessors_getsetters,
	.tp_methods = py_spoolss_EnumPrintProcessors_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrintProcessors_new,
};

static bool pack_py_spoolss_EnumPrintProcessors_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrintProcessors *r)
{
	PyObject *py_servername;
	PyObject *py_environment;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"servername", "environment", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_EnumPrintProcessors", discard_const_p(char *, kwnames), &py_servername, &py_environment, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_environment == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.environment");
		return false;
	}
	if (py_environment == Py_None) {
		r->in.environment = NULL;
	} else {
		r->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_environment)) {
				unicode = PyUnicode_AsEncodedString(py_environment, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_environment)) {
				test_str = PyBytes_AS_STRING(py_environment);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_environment)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.environment = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrintProcessors_args_out(struct spoolss_EnumPrintProcessors *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrintProcessorInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_PrintProcessorInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_GetPrintProcessorDirectory_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_GetPrintProcessorDirectory_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_in_get_environment(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_environment;
	if (object->in.environment == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.environment == NULL) {
		py_environment = Py_None;
		Py_INCREF(py_environment);
	} else {
		if (object->in.environment == NULL) {
			py_environment = Py_None;
			Py_INCREF(py_environment);
		} else {
			py_environment = PyUnicode_Decode(object->in.environment, strlen(object->in.environment), "utf-8", "ignore");
		}
	}
	return py_environment;
}

static int py_spoolss_GetPrintProcessorDirectory_in_set_environment(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.environment");
		return -1;
	}
	if (value == Py_None) {
		object->in.environment = NULL;
	} else {
		object->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.environment = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetPrintProcessorDirectory_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetPrintProcessorDirectory_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrintProcessorDirectory_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_PrintProcessorDirectoryInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_PrintProcessorDirectoryInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetPrintProcessorDirectory_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_PrintProcessorDirectoryInfo *info_switch_2;
			info_switch_2 = (union spoolss_PrintProcessorDirectoryInfo *)pyrpc_export_union(&spoolss_PrintProcessorDirectoryInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_PrintProcessorDirectoryInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrintProcessorDirectory_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrintProcessorDirectory_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrintProcessorDirectory_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_GetPrintProcessorDirectory_in_get_server,
		.set = py_spoolss_GetPrintProcessorDirectory_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_environment"),
		.get = py_spoolss_GetPrintProcessorDirectory_in_get_environment,
		.set = py_spoolss_GetPrintProcessorDirectory_in_set_environment,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetPrintProcessorDirectory_in_get_level,
		.set = py_spoolss_GetPrintProcessorDirectory_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetPrintProcessorDirectory_in_get_buffer,
		.set = py_spoolss_GetPrintProcessorDirectory_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrintProcessorDirectory_in_get_offered,
		.set = py_spoolss_GetPrintProcessorDirectory_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetPrintProcessorDirectory_out_get_info,
		.set = py_spoolss_GetPrintProcessorDirectory_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintProcessorDirectoryInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrintProcessorDirectory_out_get_needed,
		.set = py_spoolss_GetPrintProcessorDirectory_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrintProcessorDirectory_get_result,
		.set = py_spoolss_GetPrintProcessorDirectory_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrintProcessorDirectory_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrintProcessorDirectory, type);
	struct spoolss_GetPrintProcessorDirectory *_self = (struct spoolss_GetPrintProcessorDirectory *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(16);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 17) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrintProcessorDirectory_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[16];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrintProcessorDirectory_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrintProcessorDirectory_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 17) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrintProcessorDirectory_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[16];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrintProcessorDirectory_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrintProcessorDirectory_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrintProcessorDirectory *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 17) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrintProcessorDirectory_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[16];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrintProcessorDirectory_ndr_print(py_obj, args, kwargs, "spoolss_GetPrintProcessorDirectory_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrintProcessorDirectory_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrintProcessorDirectory_ndr_print(py_obj, args, kwargs, "spoolss_GetPrintProcessorDirectory_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrintProcessorDirectory_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrintProcessorDirectory_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrintProcessorDirectory.opnum() -> 16 (0x10) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrintProcessorDirectory_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrintProcessorDirectory_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrintProcessorDirectory",
	.tp_getset = py_spoolss_GetPrintProcessorDirectory_getsetters,
	.tp_methods = py_spoolss_GetPrintProcessorDirectory_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrintProcessorDirectory_new,
};

static bool pack_py_spoolss_GetPrintProcessorDirectory_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrintProcessorDirectory *r)
{
	PyObject *py_server;
	PyObject *py_environment;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"server", "environment", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetPrintProcessorDirectory", discard_const_p(char *, kwnames), &py_server, &py_environment, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_environment == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.environment");
		return false;
	}
	if (py_environment == Py_None) {
		r->in.environment = NULL;
	} else {
		r->in.environment = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_environment)) {
				unicode = PyUnicode_AsEncodedString(py_environment, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_environment)) {
				test_str = PyBytes_AS_STRING(py_environment);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_environment)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.environment = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrintProcessorDirectory_args_out(struct spoolss_GetPrintProcessorDirectory *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_PrintProcessorDirectoryInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_PrintProcessorDirectoryInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_StartDocPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_StartDocPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_StartDocPrinter_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_DocumentInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_StartDocPrinter_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DocumentInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_DocumentInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_StartDocPrinter_out_get_job_id(PyObject *obj, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_job_id;
	if (object->out.job_id == NULL) {
		Py_RETURN_NONE;
	}
	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.job_id));
	return py_job_id;
}

static int py_spoolss_StartDocPrinter_out_set_job_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.job_id));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.job_id");
		return -1;
	}
	object->out.job_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.job_id);
	if (object->out.job_id == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.job_id));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.job_id = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_StartDocPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_StartDocPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_StartDocPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_StartDocPrinter_in_get_handle,
		.set = py_spoolss_StartDocPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_StartDocPrinter_in_get_info_ctr,
		.set = py_spoolss_StartDocPrinter_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DocumentInfoCtr")
	},
	{
		.name = discard_const_p(char, "out_job_id"),
		.get = py_spoolss_StartDocPrinter_out_get_job_id,
		.set = py_spoolss_StartDocPrinter_out_set_job_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_StartDocPrinter_get_result,
		.set = py_spoolss_StartDocPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_StartDocPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_StartDocPrinter, type);
	struct spoolss_StartDocPrinter *_self = (struct spoolss_StartDocPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_DocumentInfoCtr);
	_self->out.job_id = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_StartDocPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(17);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 18) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartDocPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[17];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_StartDocPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_StartDocPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_StartDocPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 18) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartDocPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[17];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_StartDocPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_StartDocPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_StartDocPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartDocPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 18) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartDocPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[17];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_StartDocPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_StartDocPrinter_ndr_print(py_obj, args, kwargs, "spoolss_StartDocPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_StartDocPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_StartDocPrinter_ndr_print(py_obj, args, kwargs, "spoolss_StartDocPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_StartDocPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_StartDocPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.StartDocPrinter.opnum() -> 17 (0x11) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartDocPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_StartDocPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.StartDocPrinter",
	.tp_getset = py_spoolss_StartDocPrinter_getsetters,
	.tp_methods = py_spoolss_StartDocPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_StartDocPrinter_new,
};

static bool pack_py_spoolss_StartDocPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_StartDocPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_info_ctr;
	const char *kwnames[] = {
		"handle", "info_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_StartDocPrinter", discard_const_p(char *, kwnames), &py_handle, &py_info_ctr)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DocumentInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_DocumentInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_StartDocPrinter_args_out(struct spoolss_StartDocPrinter *r, bool raise_result_exception)
{
	PyObject *py_job_id = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_job_id = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.job_id));
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_job_id);
	}
	if (result_size == 1) {
		result = py_job_id;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_StartPagePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_StartPagePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_StartPagePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_StartPagePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_StartPagePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_StartPagePrinter_in_get_handle,
		.set = py_spoolss_StartPagePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_StartPagePrinter_get_result,
		.set = py_spoolss_StartPagePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_StartPagePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_StartPagePrinter, type);
	struct spoolss_StartPagePrinter *_self = (struct spoolss_StartPagePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_StartPagePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(18);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 19) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartPagePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[18];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_StartPagePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_StartPagePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_StartPagePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 19) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartPagePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[18];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_StartPagePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_StartPagePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_StartPagePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_StartPagePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 19) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_StartPagePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[18];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_StartPagePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_StartPagePrinter_ndr_print(py_obj, args, kwargs, "spoolss_StartPagePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_StartPagePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_StartPagePrinter_ndr_print(py_obj, args, kwargs, "spoolss_StartPagePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_StartPagePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_StartPagePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.StartPagePrinter.opnum() -> 18 (0x12) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_StartPagePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_StartPagePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.StartPagePrinter",
	.tp_getset = py_spoolss_StartPagePrinter_getsetters,
	.tp_methods = py_spoolss_StartPagePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_StartPagePrinter_new,
};

static bool pack_py_spoolss_StartPagePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_StartPagePrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_StartPagePrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_StartPagePrinter_args_out(struct spoolss_StartPagePrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_WritePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_WritePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_WritePrinter_in_get_data(PyObject *obj, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	py_data = PyBytes_FromStringAndSize((char *)(object->in.data).data, (object->in.data).length);
	return py_data;
}

static int py_spoolss_WritePrinter_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->in.data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyObject *py_spoolss_WritePrinter_in_get__data_size(PyObject *obj, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py__data_size;
	py__data_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in._data_size));
	return py__data_size;
}

static int py_spoolss_WritePrinter_in_set__data_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in._data_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in._data_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in._data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_WritePrinter_out_get_num_written(PyObject *obj, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_num_written;
	if (object->out.num_written == NULL) {
		Py_RETURN_NONE;
	}
	py_num_written = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.num_written));
	return py_num_written;
}

static int py_spoolss_WritePrinter_out_set_num_written(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.num_written));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.num_written");
		return -1;
	}
	object->out.num_written = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.num_written);
	if (object->out.num_written == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.num_written));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.num_written = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_WritePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_WritePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_WritePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_WritePrinter_in_get_handle,
		.set = py_spoolss_WritePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_data"),
		.get = py_spoolss_WritePrinter_in_get_data,
		.set = py_spoolss_WritePrinter_in_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in__data_size"),
		.get = py_spoolss_WritePrinter_in_get__data_size,
		.set = py_spoolss_WritePrinter_in_set__data_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_num_written"),
		.get = py_spoolss_WritePrinter_out_get_num_written,
		.set = py_spoolss_WritePrinter_out_set_num_written,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_WritePrinter_get_result,
		.set = py_spoolss_WritePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_WritePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_WritePrinter, type);
	struct spoolss_WritePrinter *_self = (struct spoolss_WritePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.num_written = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_WritePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(19);
}

static PyObject *py_spoolss_WritePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 20) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_WritePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[19];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_WritePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_WritePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_WritePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_WritePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_WritePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 20) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_WritePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[19];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_WritePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_WritePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_WritePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_WritePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_WritePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_WritePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 20) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_WritePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[19];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_WritePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_WritePrinter_ndr_print(py_obj, args, kwargs, "spoolss_WritePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_WritePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_WritePrinter_ndr_print(py_obj, args, kwargs, "spoolss_WritePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_WritePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_WritePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.WritePrinter.opnum() -> 19 (0x13) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_WritePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_WritePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.WritePrinter",
	.tp_getset = py_spoolss_WritePrinter_getsetters,
	.tp_methods = py_spoolss_WritePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_WritePrinter_new,
};

static bool pack_py_spoolss_WritePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_WritePrinter *r)
{
	PyObject *py_handle;
	PyObject *py_data;
	PyObject *py__data_size;
	const char *kwnames[] = {
		"handle", "data", "_data_size", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_WritePrinter", discard_const_p(char *, kwnames), &py_handle, &py_data, &py__data_size)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_data == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data");
		return false;
	}
	if (!PyBytes_Check(py_data)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_data)->tp_name);
		return false;
	}
	r->in.data = data_blob_talloc(r, PyBytes_AS_STRING(py_data), PyBytes_GET_SIZE(py_data));
	if (py__data_size == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in._data_size");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in._data_size));
		if (PyLong_Check(py__data_size)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py__data_size);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in._data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_WritePrinter_args_out(struct spoolss_WritePrinter *r, bool raise_result_exception)
{
	PyObject *py_num_written = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_num_written = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.num_written));
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_num_written);
	}
	if (result_size == 1) {
		result = py_num_written;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EndPagePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EndPagePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EndPagePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EndPagePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EndPagePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EndPagePrinter_in_get_handle,
		.set = py_spoolss_EndPagePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EndPagePrinter_get_result,
		.set = py_spoolss_EndPagePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EndPagePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EndPagePrinter, type);
	struct spoolss_EndPagePrinter *_self = (struct spoolss_EndPagePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_EndPagePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(20);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 21) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndPagePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[20];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EndPagePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EndPagePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EndPagePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 21) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndPagePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[20];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EndPagePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EndPagePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EndPagePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndPagePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 21) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndPagePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[20];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EndPagePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EndPagePrinter_ndr_print(py_obj, args, kwargs, "spoolss_EndPagePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_EndPagePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EndPagePrinter_ndr_print(py_obj, args, kwargs, "spoolss_EndPagePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EndPagePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EndPagePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EndPagePrinter.opnum() -> 20 (0x14) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndPagePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EndPagePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EndPagePrinter",
	.tp_getset = py_spoolss_EndPagePrinter_getsetters,
	.tp_methods = py_spoolss_EndPagePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EndPagePrinter_new,
};

static bool pack_py_spoolss_EndPagePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EndPagePrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_EndPagePrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_EndPagePrinter_args_out(struct spoolss_EndPagePrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_AbortPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_AbortPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AbortPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AbortPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AbortPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_AbortPrinter_in_get_handle,
		.set = py_spoolss_AbortPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AbortPrinter_get_result,
		.set = py_spoolss_AbortPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AbortPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AbortPrinter, type);
	struct spoolss_AbortPrinter *_self = (struct spoolss_AbortPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_AbortPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(21);
}

static PyObject *py_spoolss_AbortPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 22) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AbortPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[21];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AbortPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AbortPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AbortPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AbortPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AbortPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 22) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AbortPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[21];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AbortPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AbortPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AbortPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AbortPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AbortPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AbortPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 22) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AbortPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[21];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AbortPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AbortPrinter_ndr_print(py_obj, args, kwargs, "spoolss_AbortPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_AbortPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AbortPrinter_ndr_print(py_obj, args, kwargs, "spoolss_AbortPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AbortPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AbortPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AbortPrinter.opnum() -> 21 (0x15) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AbortPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AbortPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AbortPrinter",
	.tp_getset = py_spoolss_AbortPrinter_getsetters,
	.tp_methods = py_spoolss_AbortPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AbortPrinter_new,
};

static bool pack_py_spoolss_AbortPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AbortPrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_AbortPrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_AbortPrinter_args_out(struct spoolss_AbortPrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_ReadPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_ReadPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ReadPrinter_out_get_data(PyObject *obj, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->out.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.data_size);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.data_size); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_ReadPrinter_out_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.data");
		return -1;
	}
	object->out.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data);
	if (object->out.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->out.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data, PyList_GET_SIZE(value));
		if (!object->out.data) { return -1; }
		talloc_set_name_const(object->out.data, "ARRAY: object->out.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReadPrinter_in_get_data_size(PyObject *obj, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_data_size;
	py_data_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.data_size));
	return py_data_size;
}

static int py_spoolss_ReadPrinter_in_set_data_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.data_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReadPrinter_out_get__data_size(PyObject *obj, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py__data_size;
	if (object->out._data_size == NULL) {
		Py_RETURN_NONE;
	}
	py__data_size = PyLong_FromUnsignedLongLong((uint32_t)(*object->out._data_size));
	return py__data_size;
}

static int py_spoolss_ReadPrinter_out_set__data_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out._data_size));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out._data_size");
		return -1;
	}
	object->out._data_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out._data_size);
	if (object->out._data_size == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out._data_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out._data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReadPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ReadPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ReadPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_ReadPrinter_in_get_handle,
		.set = py_spoolss_ReadPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "out_data"),
		.get = py_spoolss_ReadPrinter_out_get_data,
		.set = py_spoolss_ReadPrinter_out_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_data_size"),
		.get = py_spoolss_ReadPrinter_in_get_data_size,
		.set = py_spoolss_ReadPrinter_in_set_data_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out__data_size"),
		.get = py_spoolss_ReadPrinter_out_get__data_size,
		.set = py_spoolss_ReadPrinter_out_set__data_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ReadPrinter_get_result,
		.set = py_spoolss_ReadPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ReadPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ReadPrinter, type);
	struct spoolss_ReadPrinter *_self = (struct spoolss_ReadPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.data = talloc_zero(mem_ctx, uint8_t);
	_self->out._data_size = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_ReadPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(22);
}

static PyObject *py_spoolss_ReadPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 23) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReadPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[22];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ReadPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReadPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ReadPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReadPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ReadPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 23) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReadPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[22];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ReadPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReadPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReadPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReadPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReadPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReadPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 23) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReadPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[22];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ReadPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReadPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReadPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_ReadPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReadPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReadPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ReadPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ReadPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ReadPrinter.opnum() -> 22 (0x16) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReadPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ReadPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ReadPrinter",
	.tp_getset = py_spoolss_ReadPrinter_getsetters,
	.tp_methods = py_spoolss_ReadPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ReadPrinter_new,
};

static bool pack_py_spoolss_ReadPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ReadPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_data_size;
	const char *kwnames[] = {
		"handle", "data_size", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_ReadPrinter", discard_const_p(char *, kwnames), &py_handle, &py_data_size)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_data_size == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data_size");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.data_size));
		if (PyLong_Check(py_data_size)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_data_size);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_ReadPrinter_args_out(struct spoolss_ReadPrinter *r, bool raise_result_exception)
{
	PyObject *py_data = NULL;
	PyObject *py__data_size = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_data = PyList_New(r->in.data_size);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (r->in.data_size); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((r->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	PyTuple_SetItem(result, 0, py_data);

	py__data_size = PyLong_FromUnsignedLongLong((uint32_t)(*r->out._data_size));
	PyTuple_SetItem(result, 1, py__data_size);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EndDocPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EndDocPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EndDocPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EndDocPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EndDocPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EndDocPrinter_in_get_handle,
		.set = py_spoolss_EndDocPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EndDocPrinter_get_result,
		.set = py_spoolss_EndDocPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EndDocPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EndDocPrinter, type);
	struct spoolss_EndDocPrinter *_self = (struct spoolss_EndDocPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_EndDocPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(23);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 24) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndDocPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[23];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EndDocPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EndDocPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EndDocPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 24) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndDocPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[23];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EndDocPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EndDocPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EndDocPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EndDocPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 24) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EndDocPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[23];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EndDocPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EndDocPrinter_ndr_print(py_obj, args, kwargs, "spoolss_EndDocPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_EndDocPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EndDocPrinter_ndr_print(py_obj, args, kwargs, "spoolss_EndDocPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EndDocPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EndDocPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EndDocPrinter.opnum() -> 23 (0x17) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EndDocPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EndDocPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EndDocPrinter",
	.tp_getset = py_spoolss_EndDocPrinter_getsetters,
	.tp_methods = py_spoolss_EndDocPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EndDocPrinter_new,
};

static bool pack_py_spoolss_EndDocPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EndDocPrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_EndDocPrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_EndDocPrinter_args_out(struct spoolss_EndDocPrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_AddJob_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_AddJob_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddJob_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_AddJob_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddJob_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyList_New(object->in.offered);
		if (py_buffer == NULL) {
			return NULL;
		}
		{
			int buffer_cntr_1;
			for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
				PyObject *py_buffer_1;
				py_buffer_1 = PyLong_FromLong((uint16_t)((object->in.buffer)[buffer_cntr_1]));
				PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
			}
		}
	}
	return py_buffer;
}

static int py_spoolss_AddJob_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int buffer_cntr_1;
			object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
			if (!object->in.buffer) { return -1; }
			talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
				if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.buffer)[buffer_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddJob_out_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->out.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyList_New(object->in.offered);
		if (py_buffer == NULL) {
			return NULL;
		}
		{
			int buffer_cntr_1;
			for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.offered); buffer_cntr_1++) {
				PyObject *py_buffer_1;
				py_buffer_1 = PyLong_FromLong((uint16_t)((object->out.buffer)[buffer_cntr_1]));
				PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
			}
		}
	}
	return py_buffer;
}

static int py_spoolss_AddJob_out_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->out.buffer = NULL;
	} else {
		object->out.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int buffer_cntr_1;
			object->out.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.buffer, PyList_GET_SIZE(value));
			if (!object->out.buffer) { return -1; }
			talloc_set_name_const(object->out.buffer, "ARRAY: object->out.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
				if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.buffer)[buffer_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->out.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddJob_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_AddJob_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddJob_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_AddJob_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddJob_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddJob_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddJob_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_AddJob_in_get_handle,
		.set = py_spoolss_AddJob_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_AddJob_in_get_level,
		.set = py_spoolss_AddJob_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_AddJob_in_get_buffer,
		.set = py_spoolss_AddJob_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "out_buffer"),
		.get = py_spoolss_AddJob_out_get_buffer,
		.set = py_spoolss_AddJob_out_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_AddJob_in_get_offered,
		.set = py_spoolss_AddJob_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_AddJob_out_get_needed,
		.set = py_spoolss_AddJob_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddJob_get_result,
		.set = py_spoolss_AddJob_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddJob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddJob, type);
	struct spoolss_AddJob *_self = (struct spoolss_AddJob *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_AddJob_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(24);
}

static PyObject *py_spoolss_AddJob_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 25) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddJob_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[24];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddJob_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddJob_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddJob_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddJob_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddJob_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 25) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddJob_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[24];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddJob_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddJob_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddJob_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddJob_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddJob_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddJob *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 25) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddJob_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[24];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddJob_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddJob_ndr_print(py_obj, args, kwargs, "spoolss_AddJob_in", NDR_IN);
}

static PyObject *py_spoolss_AddJob_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddJob_ndr_print(py_obj, args, kwargs, "spoolss_AddJob_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddJob_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddJob_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddJob.opnum() -> 24 (0x18) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddJob_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddJob_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddJob",
	.tp_getset = py_spoolss_AddJob_getsetters,
	.tp_methods = py_spoolss_AddJob_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddJob_new,
};

static bool pack_py_spoolss_AddJob_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddJob *r)
{
	PyObject *py_handle;
	PyObject *py_level;
	PyObject *py_buffer;
	const char *kwnames[] = {
		"handle", "level", "buffer", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_AddJob", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_buffer)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
		{
			int buffer_cntr_1;
			r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
			if (!r->in.buffer) { return false; }
			talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
				if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.buffer)[buffer_cntr_1]");
					return false;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return false;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return false;
						}
						(r->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return false;
					}
				}
			}
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
	r->in.offered = PyList_GET_SIZE(py_buffer);
	return true;
}

static PyObject *unpack_py_spoolss_AddJob_args_out(struct spoolss_AddJob *r, bool raise_result_exception)
{
	PyObject *py_buffer = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyList_New(r->in.offered);
		if (py_buffer == NULL) {
			return NULL;
		}
		{
			int buffer_cntr_1;
			for (buffer_cntr_1 = 0; buffer_cntr_1 < (r->in.offered); buffer_cntr_1++) {
				PyObject *py_buffer_1;
				py_buffer_1 = PyLong_FromLong((uint16_t)((r->out.buffer)[buffer_cntr_1]));
				PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
			}
		}
	}
	PyTuple_SetItem(result, 0, py_buffer);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_ScheduleJob_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_ScheduleJob_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ScheduleJob_in_get_jobid(PyObject *obj, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(obj);
	PyObject *py_jobid;
	py_jobid = PyLong_FromUnsignedLongLong((uint32_t)(object->in.jobid));
	return py_jobid;
}

static int py_spoolss_ScheduleJob_in_set_jobid(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.jobid");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.jobid));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.jobid = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ScheduleJob_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ScheduleJob_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ScheduleJob_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_ScheduleJob_in_get_handle,
		.set = py_spoolss_ScheduleJob_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_jobid"),
		.get = py_spoolss_ScheduleJob_in_get_jobid,
		.set = py_spoolss_ScheduleJob_in_set_jobid,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ScheduleJob_get_result,
		.set = py_spoolss_ScheduleJob_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ScheduleJob_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ScheduleJob, type);
	struct spoolss_ScheduleJob *_self = (struct spoolss_ScheduleJob *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_ScheduleJob_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(25);
}

static PyObject *py_spoolss_ScheduleJob_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 26) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ScheduleJob_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[25];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ScheduleJob_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ScheduleJob_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ScheduleJob_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ScheduleJob_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ScheduleJob_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 26) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ScheduleJob_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[25];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ScheduleJob_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ScheduleJob_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ScheduleJob_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ScheduleJob_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ScheduleJob_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ScheduleJob *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 26) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ScheduleJob_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[25];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ScheduleJob_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ScheduleJob_ndr_print(py_obj, args, kwargs, "spoolss_ScheduleJob_in", NDR_IN);
}

static PyObject *py_spoolss_ScheduleJob_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ScheduleJob_ndr_print(py_obj, args, kwargs, "spoolss_ScheduleJob_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ScheduleJob_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ScheduleJob_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ScheduleJob.opnum() -> 25 (0x19) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ScheduleJob_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ScheduleJob_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ScheduleJob",
	.tp_getset = py_spoolss_ScheduleJob_getsetters,
	.tp_methods = py_spoolss_ScheduleJob_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ScheduleJob_new,
};

static bool pack_py_spoolss_ScheduleJob_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ScheduleJob *r)
{
	PyObject *py_handle;
	PyObject *py_jobid;
	const char *kwnames[] = {
		"handle", "jobid", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_ScheduleJob", discard_const_p(char *, kwnames), &py_handle, &py_jobid)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_jobid == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.jobid");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.jobid));
		if (PyLong_Check(py_jobid)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_jobid);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.jobid = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_ScheduleJob_args_out(struct spoolss_ScheduleJob *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetPrinterData_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetPrinterData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_GetPrinterData_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_out_get_type(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	if (object->out.type == NULL) {
		Py_RETURN_NONE;
	}
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.type));
	return py_type;
}

static int py_spoolss_GetPrinterData_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.type");
		return -1;
	}
	object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
	if (object->out.type == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_out_get_data(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->out.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_GetPrinterData_out_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.data");
		return -1;
	}
	object->out.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data);
	if (object->out.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->out.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data, PyList_GET_SIZE(value));
		if (!object->out.data) { return -1; }
		talloc_set_name_const(object->out.data, "ARRAY: object->out.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinterData_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinterData_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetPrinterData_in_get_handle,
		.set = py_spoolss_GetPrinterData_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_GetPrinterData_in_get_value_name,
		.set = py_spoolss_GetPrinterData_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "out_type"),
		.get = py_spoolss_GetPrinterData_out_get_type,
		.set = py_spoolss_GetPrinterData_out_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "out_data"),
		.get = py_spoolss_GetPrinterData_out_get_data,
		.set = py_spoolss_GetPrinterData_out_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinterData_in_get_offered,
		.set = py_spoolss_GetPrinterData_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinterData_out_get_needed,
		.set = py_spoolss_GetPrinterData_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterData_get_result,
		.set = py_spoolss_GetPrinterData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterData, type);
	struct spoolss_GetPrinterData *_self = (struct spoolss_GetPrinterData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.type = talloc_zero(mem_ctx, enum winreg_Type);
	_self->out.data = talloc_zero(mem_ctx, uint8_t);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(26);
}

static PyObject *py_spoolss_GetPrinterData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 27) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[26];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 27) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[26];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 27) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[26];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterData_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterData.opnum() -> 26 (0x1a) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterData",
	.tp_getset = py_spoolss_GetPrinterData_getsetters,
	.tp_methods = py_spoolss_GetPrinterData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterData_new,
};

static bool pack_py_spoolss_GetPrinterData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterData *r)
{
	PyObject *py_handle;
	PyObject *py_value_name;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "value_name", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_GetPrinterData", discard_const_p(char *, kwnames), &py_handle, &py_value_name, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterData_args_out(struct spoolss_GetPrinterData *r, bool raise_result_exception)
{
	PyObject *py_type = NULL;
	PyObject *py_data = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.type));
	PyTuple_SetItem(result, 0, py_type);

	py_data = PyList_New(r->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (r->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((r->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	PyTuple_SetItem(result, 1, py_data);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_SetPrinterData_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_SetPrinterData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinterData_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_SetPrinterData_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterData_in_get_type(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(object->in.type));
	return py_type;
}

static int py_spoolss_SetPrinterData_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterData_in_get_data(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->in.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->in.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_SetPrinterData_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data");
		return -1;
	}
	object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
	if (object->in.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->in.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data, PyList_GET_SIZE(value));
		if (!object->in.data) { return -1; }
		talloc_set_name_const(object->in.data, "ARRAY: object->in.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->in.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterData_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_SetPrinterData_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetPrinterData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_SetPrinterData_in_get_handle,
		.set = py_spoolss_SetPrinterData_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_SetPrinterData_in_get_value_name,
		.set = py_spoolss_SetPrinterData_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_type"),
		.get = py_spoolss_SetPrinterData_in_get_type,
		.set = py_spoolss_SetPrinterData_in_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "in_data"),
		.get = py_spoolss_SetPrinterData_in_get_data,
		.set = py_spoolss_SetPrinterData_in_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_SetPrinterData_in_get_offered,
		.set = py_spoolss_SetPrinterData_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetPrinterData_get_result,
		.set = py_spoolss_SetPrinterData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetPrinterData, type);
	struct spoolss_SetPrinterData *_self = (struct spoolss_SetPrinterData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.data = talloc_zero(mem_ctx, uint8_t);
	return self;
}

static PyObject *py_spoolss_SetPrinterData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(27);
}

static PyObject *py_spoolss_SetPrinterData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 28) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[27];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetPrinterData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinterData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinterData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinterData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinterData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 28) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[27];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPrinterData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinterData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinterData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinterData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinterData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 28) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[27];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetPrinterData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinterData_in", NDR_IN);
}

static PyObject *py_spoolss_SetPrinterData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinterData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetPrinterData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetPrinterData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetPrinterData.opnum() -> 27 (0x1b) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPrinterData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterData",
	.tp_getset = py_spoolss_SetPrinterData_getsetters,
	.tp_methods = py_spoolss_SetPrinterData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterData_new,
};

static bool pack_py_spoolss_SetPrinterData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetPrinterData *r)
{
	PyObject *py_handle;
	PyObject *py_value_name;
	PyObject *py_type;
	PyObject *py_data;
	const char *kwnames[] = {
		"handle", "value_name", "type", "data", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_SetPrinterData", discard_const_p(char *, kwnames), &py_handle, &py_value_name, &py_type, &py_data)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	if (py_type == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.type");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
		if (PyLong_Check(py_type)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_type);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_data == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data");
		return false;
	}
	r->in.data = talloc_ptrtype(r, r->in.data);
	if (r->in.data == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
	{
		int data_cntr_1;
		r->in.data = talloc_array_ptrtype(r, r->in.data, PyList_GET_SIZE(py_data));
		if (!r->in.data) { return false; }
		talloc_set_name_const(r->in.data, "ARRAY: r->in.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(py_data); data_cntr_1++) {
			if (PyList_GET_ITEM(py_data, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.data)[data_cntr_1]");
				return false;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(py_data, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_data, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return false;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return false;
					}
					(r->in.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return false;
				}
			}
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
	r->in.offered = PyList_GET_SIZE(py_data);
	return true;
}

static PyObject *unpack_py_spoolss_SetPrinterData_args_out(struct spoolss_SetPrinterData *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_ClosePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_ClosePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ClosePrinter_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_ClosePrinter_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ClosePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ClosePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ClosePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_ClosePrinter_in_get_handle,
		.set = py_spoolss_ClosePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_ClosePrinter_out_get_handle,
		.set = py_spoolss_ClosePrinter_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ClosePrinter_get_result,
		.set = py_spoolss_ClosePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ClosePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ClosePrinter, type);
	struct spoolss_ClosePrinter *_self = (struct spoolss_ClosePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_ClosePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(29);
}

static PyObject *py_spoolss_ClosePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 30) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ClosePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[29];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ClosePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ClosePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ClosePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ClosePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ClosePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 30) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ClosePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[29];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ClosePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ClosePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ClosePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ClosePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ClosePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ClosePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 30) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ClosePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[29];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ClosePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ClosePrinter_ndr_print(py_obj, args, kwargs, "spoolss_ClosePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_ClosePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ClosePrinter_ndr_print(py_obj, args, kwargs, "spoolss_ClosePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ClosePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ClosePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ClosePrinter.opnum() -> 29 (0x1d) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ClosePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ClosePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ClosePrinter",
	.tp_getset = py_spoolss_ClosePrinter_getsetters,
	.tp_methods = py_spoolss_ClosePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ClosePrinter_new,
};

static bool pack_py_spoolss_ClosePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ClosePrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_ClosePrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_ClosePrinter_args_out(struct spoolss_ClosePrinter *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddForm_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_AddForm_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddForm_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_AddFormInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_AddForm_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_AddFormInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_AddFormInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddForm_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddForm_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddForm_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_AddForm_in_get_handle,
		.set = py_spoolss_AddForm_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_AddForm_in_get_info_ctr,
		.set = py_spoolss_AddForm_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddFormInfoCtr")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddForm_get_result,
		.set = py_spoolss_AddForm_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddForm_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddForm, type);
	struct spoolss_AddForm *_self = (struct spoolss_AddForm *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_AddFormInfoCtr);
	return self;
}

static PyObject *py_spoolss_AddForm_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(30);
}

static PyObject *py_spoolss_AddForm_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 31) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddForm_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[30];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddForm_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddForm_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddForm_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddForm_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddForm_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 31) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddForm_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[30];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddForm_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddForm_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddForm_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddForm_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddForm_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddForm *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 31) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddForm_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[30];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddForm_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddForm_ndr_print(py_obj, args, kwargs, "spoolss_AddForm_in", NDR_IN);
}

static PyObject *py_spoolss_AddForm_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddForm_ndr_print(py_obj, args, kwargs, "spoolss_AddForm_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddForm_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddForm_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddForm.opnum() -> 30 (0x1e) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddForm_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddForm_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddForm",
	.tp_getset = py_spoolss_AddForm_getsetters,
	.tp_methods = py_spoolss_AddForm_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddForm_new,
};

static bool pack_py_spoolss_AddForm_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddForm *r)
{
	PyObject *py_handle;
	PyObject *py_info_ctr;
	const char *kwnames[] = {
		"handle", "info_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_AddForm", discard_const_p(char *, kwnames), &py_handle, &py_info_ctr)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_AddFormInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_AddFormInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_AddForm_args_out(struct spoolss_AddForm *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeleteForm_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_DeleteForm_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeleteForm_in_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->in.form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		py_form_name = PyUnicode_Decode(object->in.form_name, strlen(object->in.form_name), "utf-8", "ignore");
	}
	return py_form_name;
}

static int py_spoolss_DeleteForm_in_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.form_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.form_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeleteForm_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeleteForm_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeleteForm_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_DeleteForm_in_get_handle,
		.set = py_spoolss_DeleteForm_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_form_name"),
		.get = py_spoolss_DeleteForm_in_get_form_name,
		.set = py_spoolss_DeleteForm_in_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeleteForm_get_result,
		.set = py_spoolss_DeleteForm_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeleteForm_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeleteForm, type);
	struct spoolss_DeleteForm *_self = (struct spoolss_DeleteForm *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeleteForm_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(31);
}

static PyObject *py_spoolss_DeleteForm_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 32) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteForm_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[31];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeleteForm_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeleteForm_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeleteForm_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeleteForm_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeleteForm_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 32) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteForm_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[31];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeleteForm_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeleteForm_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeleteForm_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeleteForm_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeleteForm_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteForm *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 32) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteForm_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[31];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeleteForm_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeleteForm_ndr_print(py_obj, args, kwargs, "spoolss_DeleteForm_in", NDR_IN);
}

static PyObject *py_spoolss_DeleteForm_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeleteForm_ndr_print(py_obj, args, kwargs, "spoolss_DeleteForm_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeleteForm_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeleteForm_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeleteForm.opnum() -> 31 (0x1f) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteForm_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeleteForm_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeleteForm",
	.tp_getset = py_spoolss_DeleteForm_getsetters,
	.tp_methods = py_spoolss_DeleteForm_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeleteForm_new,
};

static bool pack_py_spoolss_DeleteForm_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeleteForm *r)
{
	PyObject *py_handle;
	PyObject *py_form_name;
	const char *kwnames[] = {
		"handle", "form_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_DeleteForm", discard_const_p(char *, kwnames), &py_handle, &py_form_name)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_form_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.form_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_form_name)) {
			unicode = PyUnicode_AsEncodedString(py_form_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_form_name)) {
			test_str = PyBytes_AS_STRING(py_form_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_form_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.form_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeleteForm_args_out(struct spoolss_DeleteForm *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetForm_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetForm_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetForm_in_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->in.form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		py_form_name = PyUnicode_Decode(object->in.form_name, strlen(object->in.form_name), "utf-8", "ignore");
	}
	return py_form_name;
}

static int py_spoolss_GetForm_in_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.form_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.form_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetForm_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetForm_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetForm_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_FormInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_FormInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetForm_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_FormInfo *info_switch_2;
			info_switch_2 = (union spoolss_FormInfo *)pyrpc_export_union(&spoolss_FormInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_FormInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetForm_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetForm_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetForm_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetForm_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetForm_in_get_handle,
		.set = py_spoolss_GetForm_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_form_name"),
		.get = py_spoolss_GetForm_in_get_form_name,
		.set = py_spoolss_GetForm_in_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetForm_in_get_level,
		.set = py_spoolss_GetForm_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetForm_in_get_buffer,
		.set = py_spoolss_GetForm_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetForm_in_get_offered,
		.set = py_spoolss_GetForm_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetForm_out_get_info,
		.set = py_spoolss_GetForm_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetForm_out_get_needed,
		.set = py_spoolss_GetForm_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetForm_get_result,
		.set = py_spoolss_GetForm_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetForm_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetForm, type);
	struct spoolss_GetForm *_self = (struct spoolss_GetForm *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetForm_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(32);
}

static PyObject *py_spoolss_GetForm_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 33) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetForm_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[32];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetForm_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetForm_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetForm_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetForm_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetForm_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 33) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetForm_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[32];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetForm_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetForm_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetForm_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetForm_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetForm_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetForm *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 33) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetForm_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[32];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetForm_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetForm_ndr_print(py_obj, args, kwargs, "spoolss_GetForm_in", NDR_IN);
}

static PyObject *py_spoolss_GetForm_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetForm_ndr_print(py_obj, args, kwargs, "spoolss_GetForm_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetForm_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetForm_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetForm.opnum() -> 32 (0x20) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetForm_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetForm_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetForm",
	.tp_getset = py_spoolss_GetForm_getsetters,
	.tp_methods = py_spoolss_GetForm_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetForm_new,
};

static bool pack_py_spoolss_GetForm_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetForm *r)
{
	PyObject *py_handle;
	PyObject *py_form_name;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "form_name", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetForm", discard_const_p(char *, kwnames), &py_handle, &py_form_name, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_form_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.form_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_form_name)) {
			unicode = PyUnicode_AsEncodedString(py_form_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_form_name)) {
			test_str = PyBytes_AS_STRING(py_form_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_form_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.form_name = talloc_str;
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetForm_args_out(struct spoolss_GetForm *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_FormInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_FormInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_SetForm_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_SetForm_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetForm_in_get_form_name(PyObject *obj, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_form_name;
	if (object->in.form_name == NULL) {
		py_form_name = Py_None;
		Py_INCREF(py_form_name);
	} else {
		py_form_name = PyUnicode_Decode(object->in.form_name, strlen(object->in.form_name), "utf-8", "ignore");
	}
	return py_form_name;
}

static int py_spoolss_SetForm_in_set_form_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.form_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.form_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_SetForm_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_AddFormInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_SetForm_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_AddFormInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_AddFormInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetForm_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetForm_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetForm_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_SetForm_in_get_handle,
		.set = py_spoolss_SetForm_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_form_name"),
		.get = py_spoolss_SetForm_in_get_form_name,
		.set = py_spoolss_SetForm_in_set_form_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_SetForm_in_get_info_ctr,
		.set = py_spoolss_SetForm_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddFormInfoCtr")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetForm_get_result,
		.set = py_spoolss_SetForm_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetForm_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetForm, type);
	struct spoolss_SetForm *_self = (struct spoolss_SetForm *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_AddFormInfoCtr);
	return self;
}

static PyObject *py_spoolss_SetForm_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(33);
}

static PyObject *py_spoolss_SetForm_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 34) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetForm_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[33];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetForm_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetForm_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetForm_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetForm_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetForm_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 34) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetForm_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[33];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetForm_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetForm_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetForm_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetForm_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetForm_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetForm *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 34) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetForm_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[33];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetForm_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetForm_ndr_print(py_obj, args, kwargs, "spoolss_SetForm_in", NDR_IN);
}

static PyObject *py_spoolss_SetForm_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetForm_ndr_print(py_obj, args, kwargs, "spoolss_SetForm_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetForm_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetForm_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetForm.opnum() -> 33 (0x21) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetForm_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetForm_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetForm",
	.tp_getset = py_spoolss_SetForm_getsetters,
	.tp_methods = py_spoolss_SetForm_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetForm_new,
};

static bool pack_py_spoolss_SetForm_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetForm *r)
{
	PyObject *py_handle;
	PyObject *py_form_name;
	PyObject *py_info_ctr;
	const char *kwnames[] = {
		"handle", "form_name", "info_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_SetForm", discard_const_p(char *, kwnames), &py_handle, &py_form_name, &py_info_ctr)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_form_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.form_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_form_name)) {
			unicode = PyUnicode_AsEncodedString(py_form_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_form_name)) {
			test_str = PyBytes_AS_STRING(py_form_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_form_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.form_name = talloc_str;
	}
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_AddFormInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_AddFormInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_SetForm_args_out(struct spoolss_SetForm *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumForms_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EnumForms_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumForms_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumForms_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumForms_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumForms_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumForms_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_FormInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_FormInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumForms_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_FormInfo *info_switch_3;
					info_switch_3 = (union spoolss_FormInfo *)pyrpc_export_union(&spoolss_FormInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_FormInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumForms_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumForms_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumForms_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumForms_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EnumForms_in_get_handle,
		.set = py_spoolss_EnumForms_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumForms_in_get_level,
		.set = py_spoolss_EnumForms_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumForms_in_get_buffer,
		.set = py_spoolss_EnumForms_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumForms_in_get_offered,
		.set = py_spoolss_EnumForms_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumForms_out_get_count,
		.set = py_spoolss_EnumForms_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumForms_out_get_info,
		.set = py_spoolss_EnumForms_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_FormInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumForms_out_get_needed,
		.set = py_spoolss_EnumForms_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumForms_get_result,
		.set = py_spoolss_EnumForms_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumForms_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumForms, type);
	struct spoolss_EnumForms *_self = (struct spoolss_EnumForms *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumForms_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(34);
}

static PyObject *py_spoolss_EnumForms_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 35) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumForms_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[34];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumForms_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumForms_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumForms_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumForms_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumForms_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 35) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumForms_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[34];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumForms_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumForms_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumForms_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumForms_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumForms_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumForms *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 35) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumForms_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[34];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumForms_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumForms_ndr_print(py_obj, args, kwargs, "spoolss_EnumForms_in", NDR_IN);
}

static PyObject *py_spoolss_EnumForms_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumForms_ndr_print(py_obj, args, kwargs, "spoolss_EnumForms_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumForms_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumForms_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumForms.opnum() -> 34 (0x22) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumForms_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumForms_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumForms",
	.tp_getset = py_spoolss_EnumForms_getsetters,
	.tp_methods = py_spoolss_EnumForms_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumForms_new,
};

static bool pack_py_spoolss_EnumForms_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumForms *r)
{
	PyObject *py_handle;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_EnumForms", discard_const_p(char *, kwnames), &py_handle, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumForms_args_out(struct spoolss_EnumForms *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_FormInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_FormInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EnumPorts_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_EnumPorts_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumPorts_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPorts_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPorts_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPorts_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PortInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_PortInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPorts_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_PortInfo *info_switch_3;
					info_switch_3 = (union spoolss_PortInfo *)pyrpc_export_union(&spoolss_PortInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_PortInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPorts_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPorts_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPorts_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPorts_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_EnumPorts_in_get_servername,
		.set = py_spoolss_EnumPorts_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumPorts_in_get_level,
		.set = py_spoolss_EnumPorts_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPorts_in_get_buffer,
		.set = py_spoolss_EnumPorts_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPorts_in_get_offered,
		.set = py_spoolss_EnumPorts_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPorts_out_get_count,
		.set = py_spoolss_EnumPorts_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPorts_out_get_info,
		.set = py_spoolss_EnumPorts_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPorts_out_get_needed,
		.set = py_spoolss_EnumPorts_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPorts_get_result,
		.set = py_spoolss_EnumPorts_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPorts_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPorts, type);
	struct spoolss_EnumPorts *_self = (struct spoolss_EnumPorts *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_PortInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPorts_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(35);
}

static PyObject *py_spoolss_EnumPorts_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 36) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPorts_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[35];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPorts_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPorts_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPorts_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPorts_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPorts_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 36) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPorts_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[35];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPorts_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPorts_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPorts_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPorts_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPorts_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPorts *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 36) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPorts_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[35];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPorts_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPorts_ndr_print(py_obj, args, kwargs, "spoolss_EnumPorts_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPorts_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPorts_ndr_print(py_obj, args, kwargs, "spoolss_EnumPorts_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPorts_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPorts_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPorts.opnum() -> 35 (0x23) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPorts_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPorts_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPorts",
	.tp_getset = py_spoolss_EnumPorts_getsetters,
	.tp_methods = py_spoolss_EnumPorts_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPorts_new,
};

static bool pack_py_spoolss_EnumPorts_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPorts *r)
{
	PyObject *py_servername;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"servername", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_EnumPorts", discard_const_p(char *, kwnames), &py_servername, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPorts_args_out(struct spoolss_EnumPorts *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PortInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_PortInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EnumMonitors_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_EnumMonitors_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumMonitors_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumMonitors_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumMonitors_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumMonitors_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_MonitorInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_MonitorInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumMonitors_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_MonitorInfo *info_switch_3;
					info_switch_3 = (union spoolss_MonitorInfo *)pyrpc_export_union(&spoolss_MonitorInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_MonitorInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumMonitors_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumMonitors_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumMonitors_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumMonitors_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_EnumMonitors_in_get_servername,
		.set = py_spoolss_EnumMonitors_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumMonitors_in_get_level,
		.set = py_spoolss_EnumMonitors_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumMonitors_in_get_buffer,
		.set = py_spoolss_EnumMonitors_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumMonitors_in_get_offered,
		.set = py_spoolss_EnumMonitors_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumMonitors_out_get_count,
		.set = py_spoolss_EnumMonitors_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumMonitors_out_get_info,
		.set = py_spoolss_EnumMonitors_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_MonitorInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumMonitors_out_get_needed,
		.set = py_spoolss_EnumMonitors_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumMonitors_get_result,
		.set = py_spoolss_EnumMonitors_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumMonitors_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumMonitors, type);
	struct spoolss_EnumMonitors *_self = (struct spoolss_EnumMonitors *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_MonitorInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumMonitors_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(36);
}

static PyObject *py_spoolss_EnumMonitors_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 37) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumMonitors_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[36];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumMonitors_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumMonitors_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumMonitors_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumMonitors_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumMonitors_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 37) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumMonitors_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[36];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumMonitors_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumMonitors_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumMonitors_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumMonitors_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumMonitors_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumMonitors *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 37) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumMonitors_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[36];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumMonitors_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumMonitors_ndr_print(py_obj, args, kwargs, "spoolss_EnumMonitors_in", NDR_IN);
}

static PyObject *py_spoolss_EnumMonitors_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumMonitors_ndr_print(py_obj, args, kwargs, "spoolss_EnumMonitors_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumMonitors_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumMonitors_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumMonitors.opnum() -> 36 (0x24) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumMonitors_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumMonitors_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumMonitors",
	.tp_getset = py_spoolss_EnumMonitors_getsetters,
	.tp_methods = py_spoolss_EnumMonitors_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumMonitors_new,
};

static bool pack_py_spoolss_EnumMonitors_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumMonitors *r)
{
	PyObject *py_servername;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"servername", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_EnumMonitors", discard_const_p(char *, kwnames), &py_servername, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumMonitors_args_out(struct spoolss_EnumMonitors *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_MonitorInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_MonitorInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPort_in_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->in.server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		if (object->in.server_name == NULL) {
			py_server_name = Py_None;
			Py_INCREF(py_server_name);
		} else {
			py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
		}
	}
	return py_server_name;
}

static int py_spoolss_AddPort_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server_name");
		return -1;
	}
	if (value == Py_None) {
		object->in.server_name = NULL;
	} else {
		object->in.server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPort_in_get_unknown(PyObject *obj, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(obj);
	PyObject *py_unknown;
	py_unknown = PyLong_FromUnsignedLongLong((uint32_t)(object->in.unknown));
	return py_unknown;
}

static int py_spoolss_AddPort_in_set_unknown(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.unknown");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.unknown));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.unknown = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPort_in_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->in.monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		py_monitor_name = PyUnicode_Decode(object->in.monitor_name, strlen(object->in.monitor_name), "utf-8", "ignore");
	}
	return py_monitor_name;
}

static int py_spoolss_AddPort_in_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.monitor_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.monitor_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPort_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPort_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPort_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server_name"),
		.get = py_spoolss_AddPort_in_get_server_name,
		.set = py_spoolss_AddPort_in_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_unknown"),
		.get = py_spoolss_AddPort_in_get_unknown,
		.set = py_spoolss_AddPort_in_set_unknown,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_monitor_name"),
		.get = py_spoolss_AddPort_in_get_monitor_name,
		.set = py_spoolss_AddPort_in_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPort_get_result,
		.set = py_spoolss_AddPort_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPort_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPort, type);
	return self;
}

static PyObject *py_spoolss_AddPort_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(37);
}

static PyObject *py_spoolss_AddPort_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 38) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPort_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[37];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPort_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPort_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPort_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPort_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPort_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 38) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPort_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[37];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPort_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPort_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPort_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPort_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPort_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPort *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 38) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPort_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[37];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPort_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPort_ndr_print(py_obj, args, kwargs, "spoolss_AddPort_in", NDR_IN);
}

static PyObject *py_spoolss_AddPort_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPort_ndr_print(py_obj, args, kwargs, "spoolss_AddPort_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPort_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPort_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPort.opnum() -> 37 (0x25) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPort_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPort_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPort",
	.tp_getset = py_spoolss_AddPort_getsetters,
	.tp_methods = py_spoolss_AddPort_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPort_new,
};

static bool pack_py_spoolss_AddPort_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPort *r)
{
	PyObject *py_server_name;
	PyObject *py_unknown;
	PyObject *py_monitor_name;
	const char *kwnames[] = {
		"server_name", "unknown", "monitor_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_AddPort", discard_const_p(char *, kwnames), &py_server_name, &py_unknown, &py_monitor_name)) {
		return false;
	}

	if (py_server_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server_name");
		return false;
	}
	if (py_server_name == Py_None) {
		r->in.server_name = NULL;
	} else {
		r->in.server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server_name)) {
				unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server_name)) {
				test_str = PyBytes_AS_STRING(py_server_name);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server_name = talloc_str;
		}
	}
	if (py_unknown == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.unknown");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.unknown));
		if (PyLong_Check(py_unknown)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_unknown);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.unknown = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_monitor_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.monitor_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_monitor_name)) {
			unicode = PyUnicode_AsEncodedString(py_monitor_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_monitor_name)) {
			test_str = PyBytes_AS_STRING(py_monitor_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_monitor_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.monitor_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_AddPort_args_out(struct spoolss_AddPort *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeletePort_in_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->in.server_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		if (object->in.server_name == NULL) {
			py_server_name = Py_None;
			Py_INCREF(py_server_name);
		} else {
			py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
		}
	}
	return py_server_name;
}

static int py_spoolss_DeletePort_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server_name");
		return -1;
	}
	if (value == Py_None) {
		object->in.server_name = NULL;
	} else {
		object->in.server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePort_in_get_ptr(PyObject *obj, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(obj);
	PyObject *py_ptr;
	py_ptr = PyLong_FromUnsignedLongLong((uint32_t)(object->in.ptr));
	return py_ptr;
}

static int py_spoolss_DeletePort_in_set_ptr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.ptr");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.ptr));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePort_in_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->in.port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		py_port_name = PyUnicode_Decode(object->in.port_name, strlen(object->in.port_name), "utf-8", "ignore");
	}
	return py_port_name;
}

static int py_spoolss_DeletePort_in_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.port_name");
		return -1;
	}
	object->in.port_name = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.port_name);
	if (object->in.port_name == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.port_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePort_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePort_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePort_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server_name"),
		.get = py_spoolss_DeletePort_in_get_server_name,
		.set = py_spoolss_DeletePort_in_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_ptr"),
		.get = py_spoolss_DeletePort_in_get_ptr,
		.set = py_spoolss_DeletePort_in_set_ptr,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint3264")
	},
	{
		.name = discard_const_p(char, "in_port_name"),
		.get = py_spoolss_DeletePort_in_get_port_name,
		.set = py_spoolss_DeletePort_in_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePort_get_result,
		.set = py_spoolss_DeletePort_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePort_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePort, type);
	return self;
}

static PyObject *py_spoolss_DeletePort_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(39);
}

static PyObject *py_spoolss_DeletePort_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 40) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePort_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[39];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePort_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePort_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePort_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePort_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePort_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 40) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePort_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[39];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePort_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePort_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePort_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePort_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePort_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePort *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 40) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePort_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[39];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePort_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePort_ndr_print(py_obj, args, kwargs, "spoolss_DeletePort_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePort_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePort_ndr_print(py_obj, args, kwargs, "spoolss_DeletePort_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePort_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePort_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePort.opnum() -> 39 (0x27) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePort_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePort_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePort",
	.tp_getset = py_spoolss_DeletePort_getsetters,
	.tp_methods = py_spoolss_DeletePort_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePort_new,
};

static bool pack_py_spoolss_DeletePort_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePort *r)
{
	PyObject *py_server_name;
	PyObject *py_ptr;
	PyObject *py_port_name;
	const char *kwnames[] = {
		"server_name", "ptr", "port_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_DeletePort", discard_const_p(char *, kwnames), &py_server_name, &py_ptr, &py_port_name)) {
		return false;
	}

	if (py_server_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server_name");
		return false;
	}
	if (py_server_name == Py_None) {
		r->in.server_name = NULL;
	} else {
		r->in.server_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server_name)) {
				unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server_name)) {
				test_str = PyBytes_AS_STRING(py_server_name);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server_name = talloc_str;
		}
	}
	if (py_ptr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.ptr");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.ptr));
		if (PyLong_Check(py_ptr)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_ptr);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.ptr = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_port_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.port_name");
		return false;
	}
	r->in.port_name = talloc_ptrtype(r, r->in.port_name);
	if (r->in.port_name == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_port_name)) {
			unicode = PyUnicode_AsEncodedString(py_port_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_port_name)) {
			test_str = PyBytes_AS_STRING(py_port_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_port_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.port_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePort_args_out(struct spoolss_DeletePort *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_CreatePrinterIC_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_CreatePrinterIC_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_CreatePrinterIC_out_get_gdi_handle(PyObject *obj, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_gdi_handle;
	if (object->out.gdi_handle == NULL) {
		Py_RETURN_NONE;
	}
	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, object->out.gdi_handle, object->out.gdi_handle);
	return py_gdi_handle;
}

static int py_spoolss_CreatePrinterIC_out_set_gdi_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gdi_handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.gdi_handle");
		return -1;
	}
	object->out.gdi_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gdi_handle);
	if (object->out.gdi_handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_CreatePrinterIC_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	if (object->in.devmode_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, object->in.devmode_ctr, object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_CreatePrinterIC_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.devmode_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	object->in.devmode_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.devmode_ctr);
	if (object->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_CreatePrinterIC_get_result(PyObject *obj, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_CreatePrinterIC_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_CreatePrinterIC_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_CreatePrinterIC_in_get_handle,
		.set = py_spoolss_CreatePrinterIC_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "out_gdi_handle"),
		.get = py_spoolss_CreatePrinterIC_out_get_gdi_handle,
		.set = py_spoolss_CreatePrinterIC_out_set_gdi_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_CreatePrinterIC_in_get_devmode_ctr,
		.set = py_spoolss_CreatePrinterIC_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_CreatePrinterIC_get_result,
		.set = py_spoolss_CreatePrinterIC_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_CreatePrinterIC_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_CreatePrinterIC, type);
	struct spoolss_CreatePrinterIC *_self = (struct spoolss_CreatePrinterIC *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.devmode_ctr = talloc_zero(mem_ctx, struct spoolss_DevmodeContainer);
	return self;
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(40);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 41) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_CreatePrinterIC_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[40];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_CreatePrinterIC_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_CreatePrinterIC_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 41) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_CreatePrinterIC_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[40];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_CreatePrinterIC_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_CreatePrinterIC_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_CreatePrinterIC *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 41) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_CreatePrinterIC_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[40];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_CreatePrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_CreatePrinterIC_in", NDR_IN);
}

static PyObject *py_spoolss_CreatePrinterIC_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_CreatePrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_CreatePrinterIC_out", NDR_OUT);
}

static PyMethodDef py_spoolss_CreatePrinterIC_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_CreatePrinterIC_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.CreatePrinterIC.opnum() -> 40 (0x28) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_CreatePrinterIC_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_CreatePrinterIC_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.CreatePrinterIC",
	.tp_getset = py_spoolss_CreatePrinterIC_getsetters,
	.tp_methods = py_spoolss_CreatePrinterIC_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_CreatePrinterIC_new,
};

static bool pack_py_spoolss_CreatePrinterIC_args_in(PyObject *args, PyObject *kwargs, struct spoolss_CreatePrinterIC *r)
{
	PyObject *py_handle;
	PyObject *py_devmode_ctr;
	const char *kwnames[] = {
		"handle", "devmode_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_CreatePrinterIC", discard_const_p(char *, kwnames), &py_handle, &py_devmode_ctr)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	r->in.devmode_ctr = talloc_ptrtype(r, r->in.devmode_ctr);
	if (r->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_CreatePrinterIC_args_out(struct spoolss_CreatePrinterIC *r, bool raise_result_exception)
{
	PyObject *py_gdi_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, r->out.gdi_handle, r->out.gdi_handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_gdi_handle);
	}
	if (result_size == 1) {
		result = py_gdi_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_in_get_gdi_handle(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_gdi_handle;
	if (object->in.gdi_handle == NULL) {
		Py_RETURN_NONE;
	}
	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, object->in.gdi_handle, object->in.gdi_handle);
	return py_gdi_handle;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_in_set_gdi_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.gdi_handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.gdi_handle");
		return -1;
	}
	object->in.gdi_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.gdi_handle);
	if (object->in.gdi_handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_in_get_pIn(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_pIn;
	if (object->in.pIn == NULL) {
		Py_RETURN_NONE;
	}
	py_pIn = PyList_New(object->in.cIn);
	if (py_pIn == NULL) {
		return NULL;
	}
	{
		int pIn_cntr_1;
		for (pIn_cntr_1 = 0; pIn_cntr_1 < (object->in.cIn); pIn_cntr_1++) {
			PyObject *py_pIn_1;
			py_pIn_1 = PyLong_FromLong((uint16_t)((object->in.pIn)[pIn_cntr_1]));
			PyList_SetItem(py_pIn, pIn_cntr_1, py_pIn_1);
		}
	}
	return py_pIn;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_in_set_pIn(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pIn));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pIn");
		return -1;
	}
	object->in.pIn = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pIn);
	if (object->in.pIn == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int pIn_cntr_1;
		object->in.pIn = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pIn, PyList_GET_SIZE(value));
		if (!object->in.pIn) { return -1; }
		talloc_set_name_const(object->in.pIn, "ARRAY: object->in.pIn");
		for (pIn_cntr_1 = 0; pIn_cntr_1 < PyList_GET_SIZE(value); pIn_cntr_1++) {
			if (PyList_GET_ITEM(value, pIn_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.pIn)[pIn_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.pIn)[pIn_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, pIn_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pIn_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->in.pIn)[pIn_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_in_get_cIn(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_cIn;
	py_cIn = PyLong_FromUnsignedLongLong((uint32_t)(object->in.cIn));
	return py_cIn;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_in_set_cIn(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.cIn");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cIn));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.cIn = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_out_get_pOut(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_pOut;
	if (object->out.pOut == NULL) {
		Py_RETURN_NONE;
	}
	py_pOut = PyList_New(object->in.cOut);
	if (py_pOut == NULL) {
		return NULL;
	}
	{
		int pOut_cntr_1;
		for (pOut_cntr_1 = 0; pOut_cntr_1 < (object->in.cOut); pOut_cntr_1++) {
			PyObject *py_pOut_1;
			py_pOut_1 = PyLong_FromLong((uint16_t)((object->out.pOut)[pOut_cntr_1]));
			PyList_SetItem(py_pOut, pOut_cntr_1, py_pOut_1);
		}
	}
	return py_pOut;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_out_set_pOut(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pOut));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.pOut");
		return -1;
	}
	object->out.pOut = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pOut);
	if (object->out.pOut == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int pOut_cntr_1;
		object->out.pOut = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pOut, PyList_GET_SIZE(value));
		if (!object->out.pOut) { return -1; }
		talloc_set_name_const(object->out.pOut, "ARRAY: object->out.pOut");
		for (pOut_cntr_1 = 0; pOut_cntr_1 < PyList_GET_SIZE(value); pOut_cntr_1++) {
			if (PyList_GET_ITEM(value, pOut_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.pOut)[pOut_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.pOut)[pOut_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, pOut_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, pOut_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.pOut)[pOut_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_in_get_cOut(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_cOut;
	py_cOut = PyLong_FromUnsignedLongLong((uint32_t)(object->in.cOut));
	return py_cOut;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_in_set_cOut(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.cOut");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.cOut));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.cOut = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_in_get_ul(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_ul;
	py_ul = PyLong_FromUnsignedLongLong((uint32_t)(object->in.ul));
	return py_ul;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_in_set_ul(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.ul");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.ul));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.ul = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_get_result(PyObject *obj, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_PlayGDIScriptOnPrinterIC_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_PlayGDIScriptOnPrinterIC_getsetters[] = {
	{
		.name = discard_const_p(char, "in_gdi_handle"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_in_get_gdi_handle,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_in_set_gdi_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_pIn"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_in_get_pIn,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_in_set_pIn,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_cIn"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_in_get_cIn,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_in_set_cIn,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_pOut"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_out_get_pOut,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_out_set_pOut,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_cOut"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_in_get_cOut,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_in_set_cOut,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_ul"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_in_get_ul,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_in_set_ul,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_PlayGDIScriptOnPrinterIC_get_result,
		.set = py_spoolss_PlayGDIScriptOnPrinterIC_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_PlayGDIScriptOnPrinterIC, type);
	struct spoolss_PlayGDIScriptOnPrinterIC *_self = (struct spoolss_PlayGDIScriptOnPrinterIC *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.pIn = talloc_zero(mem_ctx, uint8_t);
	_self->out.pOut = talloc_zero(mem_ctx, uint8_t);
	return self;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(41);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 42) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[41];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 42) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[41];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_PlayGDIScriptOnPrinterIC *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 42) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[41];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_PlayGDIScriptOnPrinterIC_in", NDR_IN);
}

static PyObject *py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_PlayGDIScriptOnPrinterIC_out", NDR_OUT);
}

static PyMethodDef py_spoolss_PlayGDIScriptOnPrinterIC_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_PlayGDIScriptOnPrinterIC_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.PlayGDIScriptOnPrinterIC.opnum() -> 41 (0x29) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_PlayGDIScriptOnPrinterIC_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_PlayGDIScriptOnPrinterIC_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.PlayGDIScriptOnPrinterIC",
	.tp_getset = py_spoolss_PlayGDIScriptOnPrinterIC_getsetters,
	.tp_methods = py_spoolss_PlayGDIScriptOnPrinterIC_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_PlayGDIScriptOnPrinterIC_new,
};

static bool pack_py_spoolss_PlayGDIScriptOnPrinterIC_args_in(PyObject *args, PyObject *kwargs, struct spoolss_PlayGDIScriptOnPrinterIC *r)
{
	PyObject *py_gdi_handle;
	PyObject *py_pIn;
	PyObject *py_cOut;
	PyObject *py_ul;
	const char *kwnames[] = {
		"gdi_handle", "pIn", "cOut", "ul", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_PlayGDIScriptOnPrinterIC", discard_const_p(char *, kwnames), &py_gdi_handle, &py_pIn, &py_cOut, &py_ul)) {
		return false;
	}

	if (py_gdi_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.gdi_handle");
		return false;
	}
	r->in.gdi_handle = talloc_ptrtype(r, r->in.gdi_handle);
	if (r->in.gdi_handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_gdi_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_gdi_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(py_gdi_handle);
	if (py_pIn == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pIn");
		return false;
	}
	r->in.pIn = talloc_ptrtype(r, r->in.pIn);
	if (r->in.pIn == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&PyList_Type, py_pIn, return false;);
	{
		int pIn_cntr_1;
		r->in.pIn = talloc_array_ptrtype(r, r->in.pIn, PyList_GET_SIZE(py_pIn));
		if (!r->in.pIn) { return false; }
		talloc_set_name_const(r->in.pIn, "ARRAY: r->in.pIn");
		for (pIn_cntr_1 = 0; pIn_cntr_1 < PyList_GET_SIZE(py_pIn); pIn_cntr_1++) {
			if (PyList_GET_ITEM(py_pIn, pIn_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.pIn)[pIn_cntr_1]");
				return false;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.pIn)[pIn_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(py_pIn, pIn_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_pIn, pIn_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return false;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return false;
					}
					(r->in.pIn)[pIn_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return false;
				}
			}
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_pIn, return false;);
	r->in.cIn = PyList_GET_SIZE(py_pIn);
	if (py_cOut == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.cOut");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.cOut));
		if (PyLong_Check(py_cOut)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_cOut);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.cOut = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_ul == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.ul");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.ul));
		if (PyLong_Check(py_ul)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_ul);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.ul = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_PlayGDIScriptOnPrinterIC_args_out(struct spoolss_PlayGDIScriptOnPrinterIC *r, bool raise_result_exception)
{
	PyObject *py_pOut = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_pOut = PyList_New(r->in.cOut);
	if (py_pOut == NULL) {
		return NULL;
	}
	{
		int pOut_cntr_1;
		for (pOut_cntr_1 = 0; pOut_cntr_1 < (r->in.cOut); pOut_cntr_1++) {
			PyObject *py_pOut_1;
			py_pOut_1 = PyLong_FromLong((uint16_t)((r->out.pOut)[pOut_cntr_1]));
			PyList_SetItem(py_pOut, pOut_cntr_1, py_pOut_1);
		}
	}
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_pOut);
	}
	if (result_size == 1) {
		result = py_pOut;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterIC_in_get_gdi_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_gdi_handle;
	if (object->in.gdi_handle == NULL) {
		Py_RETURN_NONE;
	}
	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, object->in.gdi_handle, object->in.gdi_handle);
	return py_gdi_handle;
}

static int py_spoolss_DeletePrinterIC_in_set_gdi_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.gdi_handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.gdi_handle");
		return -1;
	}
	object->in.gdi_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.gdi_handle);
	if (object->in.gdi_handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinterIC_out_get_gdi_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_gdi_handle;
	if (object->out.gdi_handle == NULL) {
		Py_RETURN_NONE;
	}
	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, object->out.gdi_handle, object->out.gdi_handle);
	return py_gdi_handle;
}

static int py_spoolss_DeletePrinterIC_out_set_gdi_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.gdi_handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.gdi_handle");
		return -1;
	}
	object->out.gdi_handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.gdi_handle);
	if (object->out.gdi_handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinterIC_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterIC_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterIC_getsetters[] = {
	{
		.name = discard_const_p(char, "in_gdi_handle"),
		.get = py_spoolss_DeletePrinterIC_in_get_gdi_handle,
		.set = py_spoolss_DeletePrinterIC_in_set_gdi_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "out_gdi_handle"),
		.get = py_spoolss_DeletePrinterIC_out_get_gdi_handle,
		.set = py_spoolss_DeletePrinterIC_out_set_gdi_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterIC_get_result,
		.set = py_spoolss_DeletePrinterIC_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterIC_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterIC, type);
	struct spoolss_DeletePrinterIC *_self = (struct spoolss_DeletePrinterIC *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.gdi_handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(42);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 43) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterIC_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[42];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterIC_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterIC_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 43) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterIC_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[42];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterIC_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterIC_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterIC *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 43) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterIC_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[42];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterIC_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterIC_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterIC_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterIC_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterIC_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterIC_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterIC.opnum() -> 42 (0x2a) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterIC_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterIC_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterIC",
	.tp_getset = py_spoolss_DeletePrinterIC_getsetters,
	.tp_methods = py_spoolss_DeletePrinterIC_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterIC_new,
};

static bool pack_py_spoolss_DeletePrinterIC_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterIC *r)
{
	PyObject *py_gdi_handle;
	const char *kwnames[] = {
		"gdi_handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_DeletePrinterIC", discard_const_p(char *, kwnames), &py_gdi_handle)) {
		return false;
	}

	if (py_gdi_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.gdi_handle");
		return false;
	}
	r->in.gdi_handle = talloc_ptrtype(r, r->in.gdi_handle);
	if (r->in.gdi_handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_gdi_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_gdi_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.gdi_handle = (struct policy_handle *)pytalloc_get_ptr(py_gdi_handle);
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterIC_args_out(struct spoolss_DeletePrinterIC *r, bool raise_result_exception)
{
	PyObject *py_gdi_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_gdi_handle = pytalloc_reference_ex(policy_handle_Type, r->out.gdi_handle, r->out.gdi_handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_gdi_handle);
	}
	if (result_size == 1) {
		result = py_gdi_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrintProcessor_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_DeletePrintProcessor_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrintProcessor_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->in.architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_DeletePrintProcessor_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	if (value == Py_None) {
		object->in.architecture = NULL;
	} else {
		object->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrintProcessor_in_get_print_processor_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor_name;
	if (object->in.print_processor_name == NULL) {
		py_print_processor_name = Py_None;
		Py_INCREF(py_print_processor_name);
	} else {
		py_print_processor_name = PyUnicode_Decode(object->in.print_processor_name, strlen(object->in.print_processor_name), "utf-8", "ignore");
	}
	return py_print_processor_name;
}

static int py_spoolss_DeletePrintProcessor_in_set_print_processor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.print_processor_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.print_processor_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrintProcessor_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrintProcessor_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrintProcessor_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_DeletePrintProcessor_in_get_server,
		.set = py_spoolss_DeletePrintProcessor_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_DeletePrintProcessor_in_get_architecture,
		.set = py_spoolss_DeletePrintProcessor_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_print_processor_name"),
		.get = py_spoolss_DeletePrintProcessor_in_get_print_processor_name,
		.set = py_spoolss_DeletePrintProcessor_in_set_print_processor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrintProcessor_get_result,
		.set = py_spoolss_DeletePrintProcessor_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrintProcessor_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrintProcessor, type);
	return self;
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(48);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 49) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrintProcessor_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[48];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrintProcessor_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrintProcessor_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 49) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrintProcessor_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[48];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrintProcessor_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrintProcessor_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrintProcessor *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 49) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrintProcessor_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[48];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrintProcessor_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrintProcessor_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrintProcessor_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrintProcessor_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrintProcessor_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrintProcessor_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrintProcessor_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrintProcessor.opnum() -> 48 (0x30) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrintProcessor_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrintProcessor_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrintProcessor",
	.tp_getset = py_spoolss_DeletePrintProcessor_getsetters,
	.tp_methods = py_spoolss_DeletePrintProcessor_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrintProcessor_new,
};

static bool pack_py_spoolss_DeletePrintProcessor_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrintProcessor *r)
{
	PyObject *py_server;
	PyObject *py_architecture;
	PyObject *py_print_processor_name;
	const char *kwnames[] = {
		"server", "architecture", "print_processor_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_DeletePrintProcessor", discard_const_p(char *, kwnames), &py_server, &py_architecture, &py_print_processor_name)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	if (py_architecture == Py_None) {
		r->in.architecture = NULL;
	} else {
		r->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_architecture)) {
				unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_architecture)) {
				test_str = PyBytes_AS_STRING(py_architecture);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.architecture = talloc_str;
		}
	}
	if (py_print_processor_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.print_processor_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_print_processor_name)) {
			unicode = PyUnicode_AsEncodedString(py_print_processor_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_print_processor_name)) {
			test_str = PyBytes_AS_STRING(py_print_processor_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_print_processor_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.print_processor_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrintProcessor_args_out(struct spoolss_DeletePrintProcessor *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumPrintProcessorDataTypes_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_EnumPrintProcessorDataTypes_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_in_get_print_processor_name(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_print_processor_name;
	if (object->in.print_processor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.print_processor_name == NULL) {
		py_print_processor_name = Py_None;
		Py_INCREF(py_print_processor_name);
	} else {
		if (object->in.print_processor_name == NULL) {
			py_print_processor_name = Py_None;
			Py_INCREF(py_print_processor_name);
		} else {
			py_print_processor_name = PyUnicode_Decode(object->in.print_processor_name, strlen(object->in.print_processor_name), "utf-8", "ignore");
		}
	}
	return py_print_processor_name;
}

static int py_spoolss_EnumPrintProcessorDataTypes_in_set_print_processor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.print_processor_name");
		return -1;
	}
	if (value == Py_None) {
		object->in.print_processor_name = NULL;
	} else {
		object->in.print_processor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.print_processor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_EnumPrintProcessorDataTypes_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPrintProcessorDataTypes_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrintProcessorDataTypes_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPrintProcessorDataTypes_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrintProcDataTypesInfo_Type, *object->out.info, object->in.level, &(*object->out.info)[info_cntr_2], "union spoolss_PrintProcDataTypesInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPrintProcessorDataTypes_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				{
					union spoolss_PrintProcDataTypesInfo *info_switch_3;
					info_switch_3 = (union spoolss_PrintProcDataTypesInfo *)pyrpc_export_union(&spoolss_PrintProcDataTypesInfo_Type, *object->out.info, object->in.level, PyList_GET_ITEM(value, info_cntr_2), "union spoolss_PrintProcDataTypesInfo");
					if (info_switch_3 == NULL) {
						return -1;
					}
					(*object->out.info)[info_cntr_2] = *info_switch_3;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrintProcessorDataTypes_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrintProcessorDataTypes_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrintProcessorDataTypes_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_in_get_servername,
		.set = py_spoolss_EnumPrintProcessorDataTypes_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_print_processor_name"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_in_get_print_processor_name,
		.set = py_spoolss_EnumPrintProcessorDataTypes_in_set_print_processor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_in_get_level,
		.set = py_spoolss_EnumPrintProcessorDataTypes_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_in_get_buffer,
		.set = py_spoolss_EnumPrintProcessorDataTypes_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_in_get_offered,
		.set = py_spoolss_EnumPrintProcessorDataTypes_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_out_get_count,
		.set = py_spoolss_EnumPrintProcessorDataTypes_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_out_get_info,
		.set = py_spoolss_EnumPrintProcessorDataTypes_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintProcDataTypesInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_out_get_needed,
		.set = py_spoolss_EnumPrintProcessorDataTypes_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrintProcessorDataTypes_get_result,
		.set = py_spoolss_EnumPrintProcessorDataTypes_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrintProcessorDataTypes, type);
	struct spoolss_EnumPrintProcessorDataTypes *_self = (struct spoolss_EnumPrintProcessorDataTypes *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(51);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 52) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessorDataTypes_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[51];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrintProcessorDataTypes_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrintProcessorDataTypes_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 52) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[51];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrintProcessorDataTypes *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 52) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrintProcessorDataTypes_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[51];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrintProcessorDataTypes_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrintProcessorDataTypes_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrintProcessorDataTypes_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrintProcessorDataTypes_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrintProcessorDataTypes_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrintProcessorDataTypes_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrintProcessorDataTypes_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrintProcessorDataTypes.opnum() -> 51 (0x33) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrintProcessorDataTypes_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrintProcessorDataTypes_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrintProcessorDataTypes",
	.tp_getset = py_spoolss_EnumPrintProcessorDataTypes_getsetters,
	.tp_methods = py_spoolss_EnumPrintProcessorDataTypes_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrintProcessorDataTypes_new,
};

static bool pack_py_spoolss_EnumPrintProcessorDataTypes_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrintProcessorDataTypes *r)
{
	PyObject *py_servername;
	PyObject *py_print_processor_name;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"servername", "print_processor_name", "level", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_EnumPrintProcessorDataTypes", discard_const_p(char *, kwnames), &py_servername, &py_print_processor_name, &py_level, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_print_processor_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.print_processor_name");
		return false;
	}
	if (py_print_processor_name == Py_None) {
		r->in.print_processor_name = NULL;
	} else {
		r->in.print_processor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_print_processor_name)) {
				unicode = PyUnicode_AsEncodedString(py_print_processor_name, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_print_processor_name)) {
				test_str = PyBytes_AS_STRING(py_print_processor_name);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_print_processor_name)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.print_processor_name = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrintProcessorDataTypes_args_out(struct spoolss_EnumPrintProcessorDataTypes *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pyrpc_import_union(&spoolss_PrintProcDataTypesInfo_Type, *r->out.info, r->in.level, &(*r->out.info)[info_cntr_2], "union spoolss_PrintProcDataTypesInfo");
				if (py_info_2 == NULL) {
					return NULL;
				}
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_ResetPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_ResetPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ResetPrinter_in_get_data_type(PyObject *obj, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_data_type;
	if (object->in.data_type == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.data_type == NULL) {
		py_data_type = Py_None;
		Py_INCREF(py_data_type);
	} else {
		if (object->in.data_type == NULL) {
			py_data_type = Py_None;
			Py_INCREF(py_data_type);
		} else {
			py_data_type = PyUnicode_Decode(object->in.data_type, strlen(object->in.data_type), "utf-8", "ignore");
		}
	}
	return py_data_type;
}

static int py_spoolss_ResetPrinter_in_set_data_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data_type");
		return -1;
	}
	if (value == Py_None) {
		object->in.data_type = NULL;
	} else {
		object->in.data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.data_type = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ResetPrinter_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	if (object->in.devmode_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, object->in.devmode_ctr, object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_ResetPrinter_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.devmode_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	object->in.devmode_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.devmode_ctr);
	if (object->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ResetPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ResetPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ResetPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_ResetPrinter_in_get_handle,
		.set = py_spoolss_ResetPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_data_type"),
		.get = py_spoolss_ResetPrinter_in_get_data_type,
		.set = py_spoolss_ResetPrinter_in_set_data_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_ResetPrinter_in_get_devmode_ctr,
		.set = py_spoolss_ResetPrinter_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ResetPrinter_get_result,
		.set = py_spoolss_ResetPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ResetPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ResetPrinter, type);
	struct spoolss_ResetPrinter *_self = (struct spoolss_ResetPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.devmode_ctr = talloc_zero(mem_ctx, struct spoolss_DevmodeContainer);
	return self;
}

static PyObject *py_spoolss_ResetPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(52);
}

static PyObject *py_spoolss_ResetPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 53) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ResetPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[52];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ResetPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ResetPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ResetPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ResetPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ResetPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 53) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ResetPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[52];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ResetPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ResetPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ResetPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ResetPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ResetPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ResetPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 53) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ResetPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[52];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ResetPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ResetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ResetPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_ResetPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ResetPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ResetPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ResetPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ResetPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ResetPrinter.opnum() -> 52 (0x34) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ResetPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ResetPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ResetPrinter",
	.tp_getset = py_spoolss_ResetPrinter_getsetters,
	.tp_methods = py_spoolss_ResetPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ResetPrinter_new,
};

static bool pack_py_spoolss_ResetPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ResetPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_data_type;
	PyObject *py_devmode_ctr;
	const char *kwnames[] = {
		"handle", "data_type", "devmode_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_ResetPrinter", discard_const_p(char *, kwnames), &py_handle, &py_data_type, &py_devmode_ctr)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_data_type == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data_type");
		return false;
	}
	if (py_data_type == Py_None) {
		r->in.data_type = NULL;
	} else {
		r->in.data_type = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_data_type)) {
				unicode = PyUnicode_AsEncodedString(py_data_type, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_data_type)) {
				test_str = PyBytes_AS_STRING(py_data_type);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_data_type)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.data_type = talloc_str;
		}
	}
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	r->in.devmode_ctr = talloc_ptrtype(r, r->in.devmode_ctr);
	if (r->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_ResetPrinter_args_out(struct spoolss_ResetPrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetPrinterDriver2_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetPrinterDriver2_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		if (object->in.architecture == NULL) {
			py_architecture = Py_None;
			Py_INCREF(py_architecture);
		} else {
			py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
		}
	}
	return py_architecture;
}

static int py_spoolss_GetPrinterDriver2_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	if (value == Py_None) {
		object->in.architecture = NULL;
	} else {
		object->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.architecture = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_level(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_level;
	py_level = PyLong_FromUnsignedLongLong((uint32_t)(object->in.level));
	return py_level;
}

static int py_spoolss_GetPrinterDriver2_in_set_level(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.level");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.level));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_GetPrinterDriver2_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinterDriver2_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_client_major_version(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_client_major_version;
	py_client_major_version = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_major_version));
	return py_client_major_version;
}

static int py_spoolss_GetPrinterDriver2_in_set_client_major_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_major_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_major_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.client_major_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_in_get_client_minor_version(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_client_minor_version;
	py_client_minor_version = PyLong_FromUnsignedLongLong((uint32_t)(object->in.client_minor_version));
	return py_client_minor_version;
}

static int py_spoolss_GetPrinterDriver2_in_set_client_minor_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.client_minor_version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.client_minor_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.client_minor_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverInfo_Type, object->out.info, object->in.level, object->out.info, "union spoolss_DriverInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	return py_info;
}

static int py_spoolss_GetPrinterDriver2_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	if (value == Py_None) {
		object->out.info = NULL;
	} else {
		object->out.info = NULL;
		{
			union spoolss_DriverInfo *info_switch_2;
			info_switch_2 = (union spoolss_DriverInfo *)pyrpc_export_union(&spoolss_DriverInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.level, value, "union spoolss_DriverInfo");
			if (info_switch_2 == NULL) {
				return -1;
			}
			object->out.info = info_switch_2;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinterDriver2_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_out_get_server_major_version(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_major_version;
	if (object->out.server_major_version == NULL) {
		Py_RETURN_NONE;
	}
	py_server_major_version = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.server_major_version));
	return py_server_major_version;
}

static int py_spoolss_GetPrinterDriver2_out_set_server_major_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.server_major_version));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.server_major_version");
		return -1;
	}
	object->out.server_major_version = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.server_major_version);
	if (object->out.server_major_version == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.server_major_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.server_major_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_out_get_server_minor_version(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_server_minor_version;
	if (object->out.server_minor_version == NULL) {
		Py_RETURN_NONE;
	}
	py_server_minor_version = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.server_minor_version));
	return py_server_minor_version;
}

static int py_spoolss_GetPrinterDriver2_out_set_server_minor_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.server_minor_version));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.server_minor_version");
		return -1;
	}
	object->out.server_minor_version = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.server_minor_version);
	if (object->out.server_minor_version == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.server_minor_version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.server_minor_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriver2_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterDriver2_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterDriver2_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetPrinterDriver2_in_get_handle,
		.set = py_spoolss_GetPrinterDriver2_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_GetPrinterDriver2_in_get_architecture,
		.set = py_spoolss_GetPrinterDriver2_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_level"),
		.get = py_spoolss_GetPrinterDriver2_in_get_level,
		.set = py_spoolss_GetPrinterDriver2_in_set_level,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_GetPrinterDriver2_in_get_buffer,
		.set = py_spoolss_GetPrinterDriver2_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinterDriver2_in_get_offered,
		.set = py_spoolss_GetPrinterDriver2_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_client_major_version"),
		.get = py_spoolss_GetPrinterDriver2_in_get_client_major_version,
		.set = py_spoolss_GetPrinterDriver2_in_set_client_major_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_client_minor_version"),
		.get = py_spoolss_GetPrinterDriver2_in_get_client_minor_version,
		.set = py_spoolss_GetPrinterDriver2_in_set_client_minor_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_GetPrinterDriver2_out_get_info,
		.set = py_spoolss_GetPrinterDriver2_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DriverInfo")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinterDriver2_out_get_needed,
		.set = py_spoolss_GetPrinterDriver2_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_server_major_version"),
		.get = py_spoolss_GetPrinterDriver2_out_get_server_major_version,
		.set = py_spoolss_GetPrinterDriver2_out_set_server_major_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_server_minor_version"),
		.get = py_spoolss_GetPrinterDriver2_out_get_server_minor_version,
		.set = py_spoolss_GetPrinterDriver2_out_set_server_minor_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterDriver2_get_result,
		.set = py_spoolss_GetPrinterDriver2_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterDriver2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterDriver2, type);
	struct spoolss_GetPrinterDriver2 *_self = (struct spoolss_GetPrinterDriver2 *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	_self->out.server_major_version = talloc_zero(mem_ctx, uint32_t);
	_self->out.server_minor_version = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(53);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 54) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver2_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[53];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriver2_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriver2_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 54) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver2_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[53];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriver2_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriver2_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriver2 *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 54) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriver2_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[53];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriver2_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriver2_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterDriver2_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriver2_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriver2_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterDriver2_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterDriver2_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterDriver2.opnum() -> 53 (0x35) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriver2_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterDriver2_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterDriver2",
	.tp_getset = py_spoolss_GetPrinterDriver2_getsetters,
	.tp_methods = py_spoolss_GetPrinterDriver2_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterDriver2_new,
};

static bool pack_py_spoolss_GetPrinterDriver2_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterDriver2 *r)
{
	PyObject *py_handle;
	PyObject *py_architecture;
	PyObject *py_level;
	PyObject *py_buffer;
	PyObject *py_offered;
	PyObject *py_client_major_version;
	PyObject *py_client_minor_version;
	const char *kwnames[] = {
		"handle", "architecture", "level", "buffer", "offered", "client_major_version", "client_minor_version", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOO:spoolss_GetPrinterDriver2", discard_const_p(char *, kwnames), &py_handle, &py_architecture, &py_level, &py_buffer, &py_offered, &py_client_major_version, &py_client_minor_version)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	if (py_architecture == Py_None) {
		r->in.architecture = NULL;
	} else {
		r->in.architecture = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_architecture)) {
				unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_architecture)) {
				test_str = PyBytes_AS_STRING(py_architecture);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.architecture = talloc_str;
		}
	}
	if (py_level == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.level");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.level));
		if (PyLong_Check(py_level)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_level);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.level = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_client_major_version == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_major_version");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_major_version));
		if (PyLong_Check(py_client_major_version)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_client_major_version);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.client_major_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_client_minor_version == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.client_minor_version");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.client_minor_version));
		if (PyLong_Check(py_client_minor_version)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_client_minor_version);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.client_minor_version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterDriver2_args_out(struct spoolss_GetPrinterDriver2 *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *py_server_major_version = NULL;
	PyObject *py_server_minor_version = NULL;
	PyObject *result = NULL;
	size_t result_size = 4;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pyrpc_import_union(&spoolss_DriverInfo_Type, r->out.info, r->in.level, r->out.info, "union spoolss_DriverInfo");
		if (py_info == NULL) {
			return NULL;
		}
	}
	PyTuple_SetItem(result, 0, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	py_server_major_version = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.server_major_version));
	PyTuple_SetItem(result, 2, py_server_major_version);

	py_server_minor_version = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.server_minor_version));
	PyTuple_SetItem(result, 3, py_server_minor_version);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 4, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_FindClosePrinterNotify_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_FindClosePrinterNotify_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_FindClosePrinterNotify_get_result(PyObject *obj, void *closure)
{
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_FindClosePrinterNotify_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_FindClosePrinterNotify_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_FindClosePrinterNotify_in_get_handle,
		.set = py_spoolss_FindClosePrinterNotify_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_FindClosePrinterNotify_get_result,
		.set = py_spoolss_FindClosePrinterNotify_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_FindClosePrinterNotify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_FindClosePrinterNotify, type);
	struct spoolss_FindClosePrinterNotify *_self = (struct spoolss_FindClosePrinterNotify *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(56);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 57) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_FindClosePrinterNotify_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[56];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_FindClosePrinterNotify_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_FindClosePrinterNotify_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 57) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_FindClosePrinterNotify_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[56];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_FindClosePrinterNotify_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_FindClosePrinterNotify_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_FindClosePrinterNotify *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 57) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_FindClosePrinterNotify_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[56];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_FindClosePrinterNotify_ndr_print(py_obj, args, kwargs, "spoolss_FindClosePrinterNotify_in", NDR_IN);
}

static PyObject *py_spoolss_FindClosePrinterNotify_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_FindClosePrinterNotify_ndr_print(py_obj, args, kwargs, "spoolss_FindClosePrinterNotify_out", NDR_OUT);
}

static PyMethodDef py_spoolss_FindClosePrinterNotify_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_FindClosePrinterNotify_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.FindClosePrinterNotify.opnum() -> 56 (0x38) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_FindClosePrinterNotify_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_FindClosePrinterNotify_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.FindClosePrinterNotify",
	.tp_getset = py_spoolss_FindClosePrinterNotify_getsetters,
	.tp_methods = py_spoolss_FindClosePrinterNotify_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_FindClosePrinterNotify_new,
};

static bool pack_py_spoolss_FindClosePrinterNotify_args_in(PyObject *args, PyObject *kwargs, struct spoolss_FindClosePrinterNotify *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_FindClosePrinterNotify", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_FindClosePrinterNotify_args_out(struct spoolss_FindClosePrinterNotify *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_ReplyOpenPrinter_in_get_server_name(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_server_name;
	if (object->in.server_name == NULL) {
		py_server_name = Py_None;
		Py_INCREF(py_server_name);
	} else {
		py_server_name = PyUnicode_Decode(object->in.server_name, strlen(object->in.server_name), "utf-8", "ignore");
	}
	return py_server_name;
}

static int py_spoolss_ReplyOpenPrinter_in_set_server_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.server_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_in_get_printer_local(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_local;
	py_printer_local = PyLong_FromUnsignedLongLong((uint32_t)(object->in.printer_local));
	return py_printer_local;
}

static int py_spoolss_ReplyOpenPrinter_in_set_printer_local(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printer_local");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.printer_local));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.printer_local = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_in_get_type(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(object->in.type));
	return py_type;
}

static int py_spoolss_ReplyOpenPrinter_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_in_get_bufsize(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_bufsize;
	py_bufsize = PyLong_FromUnsignedLongLong((uint32_t)(object->in.bufsize));
	return py_bufsize;
}

static int py_spoolss_ReplyOpenPrinter_in_set_bufsize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.bufsize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bufsize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.bufsize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyList_New(object->in.bufsize);
		if (py_buffer == NULL) {
			return NULL;
		}
		{
			int buffer_cntr_1;
			for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.bufsize); buffer_cntr_1++) {
				PyObject *py_buffer_1;
				py_buffer_1 = PyLong_FromLong((uint16_t)((object->in.buffer)[buffer_cntr_1]));
				PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
			}
		}
	}
	return py_buffer;
}

static int py_spoolss_ReplyOpenPrinter_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int buffer_cntr_1;
			object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
			if (!object->in.buffer) { return -1; }
			talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
				if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.buffer)[buffer_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_ReplyOpenPrinter_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ReplyOpenPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ReplyOpenPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ReplyOpenPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server_name"),
		.get = py_spoolss_ReplyOpenPrinter_in_get_server_name,
		.set = py_spoolss_ReplyOpenPrinter_in_set_server_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_printer_local"),
		.get = py_spoolss_ReplyOpenPrinter_in_get_printer_local,
		.set = py_spoolss_ReplyOpenPrinter_in_set_printer_local,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_type"),
		.get = py_spoolss_ReplyOpenPrinter_in_get_type,
		.set = py_spoolss_ReplyOpenPrinter_in_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "in_bufsize"),
		.get = py_spoolss_ReplyOpenPrinter_in_get_bufsize,
		.set = py_spoolss_ReplyOpenPrinter_in_set_bufsize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_ReplyOpenPrinter_in_get_buffer,
		.set = py_spoolss_ReplyOpenPrinter_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_ReplyOpenPrinter_out_get_handle,
		.set = py_spoolss_ReplyOpenPrinter_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ReplyOpenPrinter_get_result,
		.set = py_spoolss_ReplyOpenPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ReplyOpenPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ReplyOpenPrinter, type);
	struct spoolss_ReplyOpenPrinter *_self = (struct spoolss_ReplyOpenPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(58);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 59) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyOpenPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[58];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReplyOpenPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReplyOpenPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 59) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyOpenPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[58];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReplyOpenPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReplyOpenPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyOpenPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 59) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyOpenPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[58];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReplyOpenPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReplyOpenPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_ReplyOpenPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReplyOpenPrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReplyOpenPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ReplyOpenPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ReplyOpenPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ReplyOpenPrinter.opnum() -> 58 (0x3a) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyOpenPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ReplyOpenPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ReplyOpenPrinter",
	.tp_getset = py_spoolss_ReplyOpenPrinter_getsetters,
	.tp_methods = py_spoolss_ReplyOpenPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ReplyOpenPrinter_new,
};

static bool pack_py_spoolss_ReplyOpenPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ReplyOpenPrinter *r)
{
	PyObject *py_server_name;
	PyObject *py_printer_local;
	PyObject *py_type;
	PyObject *py_buffer;
	const char *kwnames[] = {
		"server_name", "printer_local", "type", "buffer", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_ReplyOpenPrinter", discard_const_p(char *, kwnames), &py_server_name, &py_printer_local, &py_type, &py_buffer)) {
		return false;
	}

	if (py_server_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_server_name)) {
			unicode = PyUnicode_AsEncodedString(py_server_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_server_name)) {
			test_str = PyBytes_AS_STRING(py_server_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.server_name = talloc_str;
	}
	if (py_printer_local == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printer_local");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.printer_local));
		if (PyLong_Check(py_printer_local)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_printer_local);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.printer_local = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_type == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.type");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
		if (PyLong_Check(py_type)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_type);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
	r->in.bufsize = PyList_GET_SIZE(py_buffer);
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
		{
			int buffer_cntr_1;
			r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
			if (!r->in.buffer) { return false; }
			talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
				if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.buffer)[buffer_cntr_1]");
					return false;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return false;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return false;
						}
						(r->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return false;
					}
				}
			}
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_ReplyOpenPrinter_args_out(struct spoolss_ReplyOpenPrinter *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_RouterReplyPrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_RouterReplyPrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinter_in_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
	return py_flags;
}

static int py_spoolss_RouterReplyPrinter_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinter_in_get_bufsize(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_bufsize;
	py_bufsize = PyLong_FromUnsignedLongLong((uint32_t)(object->in.bufsize));
	return py_bufsize;
}

static int py_spoolss_RouterReplyPrinter_in_set_bufsize(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.bufsize");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.bufsize));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.bufsize = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinter_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyList_New(object->in.bufsize);
		if (py_buffer == NULL) {
			return NULL;
		}
		{
			int buffer_cntr_1;
			for (buffer_cntr_1 = 0; buffer_cntr_1 < (object->in.bufsize); buffer_cntr_1++) {
				PyObject *py_buffer_1;
				py_buffer_1 = PyLong_FromLong((uint16_t)((object->in.buffer)[buffer_cntr_1]));
				PyList_SetItem(py_buffer, buffer_cntr_1, py_buffer_1);
			}
		}
	}
	return py_buffer;
}

static int py_spoolss_RouterReplyPrinter_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int buffer_cntr_1;
			object->in.buffer = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer, PyList_GET_SIZE(value));
			if (!object->in.buffer) { return -1; }
			talloc_set_name_const(object->in.buffer, "ARRAY: object->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(value); buffer_cntr_1++) {
				if (PyList_GET_ITEM(value, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.buffer)[buffer_cntr_1]");
					return -1;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(value, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return -1;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return -1;
						}
						(object->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return -1;
					}
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_RouterReplyPrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_RouterReplyPrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_RouterReplyPrinter_in_get_handle,
		.set = py_spoolss_RouterReplyPrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_flags"),
		.get = py_spoolss_RouterReplyPrinter_in_get_flags,
		.set = py_spoolss_RouterReplyPrinter_in_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterChangeFlags")
	},
	{
		.name = discard_const_p(char, "in_bufsize"),
		.get = py_spoolss_RouterReplyPrinter_in_get_bufsize,
		.set = py_spoolss_RouterReplyPrinter_in_set_bufsize,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_RouterReplyPrinter_in_get_buffer,
		.set = py_spoolss_RouterReplyPrinter_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_RouterReplyPrinter_get_result,
		.set = py_spoolss_RouterReplyPrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_RouterReplyPrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_RouterReplyPrinter, type);
	struct spoolss_RouterReplyPrinter *_self = (struct spoolss_RouterReplyPrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(59);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 60) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[59];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterReplyPrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterReplyPrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 60) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[59];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterReplyPrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterReplyPrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 60) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[59];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterReplyPrinter_ndr_print(py_obj, args, kwargs, "spoolss_RouterReplyPrinter_in", NDR_IN);
}

static PyObject *py_spoolss_RouterReplyPrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterReplyPrinter_ndr_print(py_obj, args, kwargs, "spoolss_RouterReplyPrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_RouterReplyPrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_RouterReplyPrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.RouterReplyPrinter.opnum() -> 59 (0x3b) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_RouterReplyPrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RouterReplyPrinter",
	.tp_getset = py_spoolss_RouterReplyPrinter_getsetters,
	.tp_methods = py_spoolss_RouterReplyPrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_RouterReplyPrinter_new,
};

static bool pack_py_spoolss_RouterReplyPrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_RouterReplyPrinter *r)
{
	PyObject *py_handle;
	PyObject *py_flags;
	PyObject *py_buffer;
	const char *kwnames[] = {
		"handle", "flags", "buffer", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_RouterReplyPrinter", discard_const_p(char *, kwnames), &py_handle, &py_flags, &py_buffer)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
		if (PyLong_Check(py_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
	r->in.bufsize = PyList_GET_SIZE(py_buffer);
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = NULL;
		PY_CHECK_TYPE(&PyList_Type, py_buffer, return false;);
		{
			int buffer_cntr_1;
			r->in.buffer = talloc_array_ptrtype(r, r->in.buffer, PyList_GET_SIZE(py_buffer));
			if (!r->in.buffer) { return false; }
			talloc_set_name_const(r->in.buffer, "ARRAY: r->in.buffer");
			for (buffer_cntr_1 = 0; buffer_cntr_1 < PyList_GET_SIZE(py_buffer); buffer_cntr_1++) {
				if (PyList_GET_ITEM(py_buffer, buffer_cntr_1) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.buffer)[buffer_cntr_1]");
					return false;
				}
				{
					const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.buffer)[buffer_cntr_1]));
					if (PyLong_Check(PyList_GET_ITEM(py_buffer, buffer_cntr_1))) {
						unsigned long long test_var;
						test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_buffer, buffer_cntr_1));
						if (PyErr_Occurred() != NULL) {
							return false;
						}
						if (test_var > uint_max) {
							PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
							  PyLong_Type.tp_name, uint_max, test_var);
							return false;
						}
						(r->in.buffer)[buffer_cntr_1] = test_var;
					} else {
						PyErr_Format(PyExc_TypeError, "Expected type %s",
						  PyLong_Type.tp_name);
						return false;
					}
				}
			}
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_RouterReplyPrinter_args_out(struct spoolss_RouterReplyPrinter *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_ReplyClosePrinter_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_ReplyClosePrinter_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ReplyClosePrinter_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_ReplyClosePrinter_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_ReplyClosePrinter_get_result(PyObject *obj, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_ReplyClosePrinter_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_ReplyClosePrinter_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_ReplyClosePrinter_in_get_handle,
		.set = py_spoolss_ReplyClosePrinter_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_ReplyClosePrinter_out_get_handle,
		.set = py_spoolss_ReplyClosePrinter_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_ReplyClosePrinter_get_result,
		.set = py_spoolss_ReplyClosePrinter_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_ReplyClosePrinter_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_ReplyClosePrinter, type);
	struct spoolss_ReplyClosePrinter *_self = (struct spoolss_ReplyClosePrinter *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(60);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 61) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyClosePrinter_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[60];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReplyClosePrinter_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_ReplyClosePrinter_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 61) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyClosePrinter_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[60];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReplyClosePrinter_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_ReplyClosePrinter_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_ReplyClosePrinter *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 61) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_ReplyClosePrinter_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[60];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReplyClosePrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReplyClosePrinter_in", NDR_IN);
}

static PyObject *py_spoolss_ReplyClosePrinter_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_ReplyClosePrinter_ndr_print(py_obj, args, kwargs, "spoolss_ReplyClosePrinter_out", NDR_OUT);
}

static PyMethodDef py_spoolss_ReplyClosePrinter_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_ReplyClosePrinter_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.ReplyClosePrinter.opnum() -> 60 (0x3c) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_ReplyClosePrinter_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_ReplyClosePrinter_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.ReplyClosePrinter",
	.tp_getset = py_spoolss_ReplyClosePrinter_getsetters,
	.tp_methods = py_spoolss_ReplyClosePrinter_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_ReplyClosePrinter_new,
};

static bool pack_py_spoolss_ReplyClosePrinter_args_in(PyObject *args, PyObject *kwargs, struct spoolss_ReplyClosePrinter *r)
{
	PyObject *py_handle;
	const char *kwnames[] = {
		"handle", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:spoolss_ReplyClosePrinter", discard_const_p(char *, kwnames), &py_handle)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	return true;
}

static PyObject *unpack_py_spoolss_ReplyClosePrinter_args_out(struct spoolss_ReplyClosePrinter *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPortEx_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_AddPortEx_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPortEx_in_get_port_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(obj);
	PyObject *py_port_ctr;
	if (object->in.port_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_port_ctr = pytalloc_reference_ex(&spoolss_SetPortInfoContainer_Type, object->in.port_ctr, object->in.port_ctr);
	return py_port_ctr;
}

static int py_spoolss_AddPortEx_in_set_port_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.port_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.port_ctr");
		return -1;
	}
	object->in.port_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.port_ctr);
	if (object->in.port_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_SetPortInfoContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.port_ctr = (struct spoolss_SetPortInfoContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPortEx_in_get_port_var_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(obj);
	PyObject *py_port_var_ctr;
	if (object->in.port_var_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_port_var_ctr = pytalloc_reference_ex(&spoolss_PortVarContainer_Type, object->in.port_var_ctr, object->in.port_var_ctr);
	return py_port_var_ctr;
}

static int py_spoolss_AddPortEx_in_set_port_var_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.port_var_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.port_var_ctr");
		return -1;
	}
	object->in.port_var_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.port_var_ctr);
	if (object->in.port_var_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_PortVarContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.port_var_ctr = (struct spoolss_PortVarContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPortEx_in_get_monitor_name(PyObject *obj, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(obj);
	PyObject *py_monitor_name;
	if (object->in.monitor_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.monitor_name == NULL) {
		py_monitor_name = Py_None;
		Py_INCREF(py_monitor_name);
	} else {
		if (object->in.monitor_name == NULL) {
			py_monitor_name = Py_None;
			Py_INCREF(py_monitor_name);
		} else {
			py_monitor_name = PyUnicode_Decode(object->in.monitor_name, strlen(object->in.monitor_name), "utf-8", "ignore");
		}
	}
	return py_monitor_name;
}

static int py_spoolss_AddPortEx_in_set_monitor_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.monitor_name");
		return -1;
	}
	if (value == Py_None) {
		object->in.monitor_name = NULL;
	} else {
		object->in.monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.monitor_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPortEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPortEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPortEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_AddPortEx_in_get_servername,
		.set = py_spoolss_AddPortEx_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_port_ctr"),
		.get = py_spoolss_AddPortEx_in_get_port_ctr,
		.set = py_spoolss_AddPortEx_in_set_port_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPortInfoContainer")
	},
	{
		.name = discard_const_p(char, "in_port_var_ctr"),
		.get = py_spoolss_AddPortEx_in_get_port_var_ctr,
		.set = py_spoolss_AddPortEx_in_set_port_var_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PortVarContainer")
	},
	{
		.name = discard_const_p(char, "in_monitor_name"),
		.get = py_spoolss_AddPortEx_in_get_monitor_name,
		.set = py_spoolss_AddPortEx_in_set_monitor_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPortEx_get_result,
		.set = py_spoolss_AddPortEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPortEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPortEx, type);
	struct spoolss_AddPortEx *_self = (struct spoolss_AddPortEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.port_ctr = talloc_zero(mem_ctx, struct spoolss_SetPortInfoContainer);
	_self->in.port_var_ctr = talloc_zero(mem_ctx, struct spoolss_PortVarContainer);
	return self;
}

static PyObject *py_spoolss_AddPortEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(61);
}

static PyObject *py_spoolss_AddPortEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 62) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPortEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[61];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPortEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPortEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPortEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPortEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPortEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 62) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPortEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[61];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPortEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPortEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPortEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPortEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPortEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPortEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 62) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPortEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[61];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPortEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPortEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPortEx_in", NDR_IN);
}

static PyObject *py_spoolss_AddPortEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPortEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPortEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPortEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPortEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPortEx.opnum() -> 61 (0x3d) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPortEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPortEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPortEx",
	.tp_getset = py_spoolss_AddPortEx_getsetters,
	.tp_methods = py_spoolss_AddPortEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPortEx_new,
};

static bool pack_py_spoolss_AddPortEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPortEx *r)
{
	PyObject *py_servername;
	PyObject *py_port_ctr;
	PyObject *py_port_var_ctr;
	PyObject *py_monitor_name;
	const char *kwnames[] = {
		"servername", "port_ctr", "port_var_ctr", "monitor_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_AddPortEx", discard_const_p(char *, kwnames), &py_servername, &py_port_ctr, &py_port_var_ctr, &py_monitor_name)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_port_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.port_ctr");
		return false;
	}
	r->in.port_ctr = talloc_ptrtype(r, r->in.port_ctr);
	if (r->in.port_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_SetPortInfoContainer_Type, py_port_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_port_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.port_ctr = (struct spoolss_SetPortInfoContainer *)pytalloc_get_ptr(py_port_ctr);
	if (py_port_var_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.port_var_ctr");
		return false;
	}
	r->in.port_var_ctr = talloc_ptrtype(r, r->in.port_var_ctr);
	if (r->in.port_var_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_PortVarContainer_Type, py_port_var_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_port_var_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.port_var_ctr = (struct spoolss_PortVarContainer *)pytalloc_get_ptr(py_port_var_ctr);
	if (py_monitor_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.monitor_name");
		return false;
	}
	if (py_monitor_name == Py_None) {
		r->in.monitor_name = NULL;
	} else {
		r->in.monitor_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_monitor_name)) {
				unicode = PyUnicode_AsEncodedString(py_monitor_name, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_monitor_name)) {
				test_str = PyBytes_AS_STRING(py_monitor_name);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_monitor_name)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.monitor_name = talloc_str;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_AddPortEx_args_out(struct spoolss_AddPortEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
	return py_flags;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_options(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_options;
	py_options = PyLong_FromUnsignedLongLong((uint32_t)(object->in.options));
	return py_options;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_options(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.options");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.options));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.options = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_local_machine(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_local_machine;
	if (object->in.local_machine == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.local_machine == NULL) {
		py_local_machine = Py_None;
		Py_INCREF(py_local_machine);
	} else {
		if (object->in.local_machine == NULL) {
			py_local_machine = Py_None;
			Py_INCREF(py_local_machine);
		} else {
			py_local_machine = PyUnicode_Decode(object->in.local_machine, strlen(object->in.local_machine), "utf-8", "ignore");
		}
	}
	return py_local_machine;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_local_machine(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.local_machine");
		return -1;
	}
	if (value == Py_None) {
		object->in.local_machine = NULL;
	} else {
		object->in.local_machine = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.local_machine = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_printer_local(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_printer_local;
	py_printer_local = PyLong_FromUnsignedLongLong((uint32_t)(object->in.printer_local));
	return py_printer_local;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_printer_local(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printer_local");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.printer_local));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.printer_local = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_notify_options(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_notify_options;
	if (object->in.notify_options == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.notify_options == NULL) {
		py_notify_options = Py_None;
		Py_INCREF(py_notify_options);
	} else {
		py_notify_options = pytalloc_reference_ex(&spoolss_NotifyOption_Type, object->in.notify_options, object->in.notify_options);
	}
	return py_notify_options;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_notify_options(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.notify_options));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.notify_options");
		return -1;
	}
	if (value == Py_None) {
		object->in.notify_options = NULL;
	} else {
		object->in.notify_options = NULL;
		PY_CHECK_TYPE(&spoolss_NotifyOption_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.notify_options = (struct spoolss_NotifyOption *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_handle,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_flags"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_flags,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterChangeFlags")
	},
	{
		.name = discard_const_p(char, "in_options"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_options,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_options,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_local_machine"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_local_machine,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_local_machine,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_printer_local"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_printer_local,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_printer_local,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_notify_options"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_get_notify_options,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_in_set_notify_options,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyOption")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_get_result,
		.set = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_RemoteFindFirstPrinterChangeNotifyEx, type);
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *_self = (struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(65);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 66) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[65];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 66) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[65];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 66) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[65];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print(py_obj, args, kwargs, "spoolss_RemoteFindFirstPrinterChangeNotifyEx_in", NDR_IN);
}

static PyObject *py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print(py_obj, args, kwargs, "spoolss_RemoteFindFirstPrinterChangeNotifyEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.RemoteFindFirstPrinterChangeNotifyEx.opnum() -> 65 (0x41) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RemoteFindFirstPrinterChangeNotifyEx",
	.tp_getset = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_getsetters,
	.tp_methods = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_new,
};

static bool pack_py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r)
{
	PyObject *py_handle;
	PyObject *py_flags;
	PyObject *py_options;
	PyObject *py_local_machine;
	PyObject *py_printer_local;
	PyObject *py_notify_options;
	const char *kwnames[] = {
		"handle", "flags", "options", "local_machine", "printer_local", "notify_options", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:spoolss_RemoteFindFirstPrinterChangeNotifyEx", discard_const_p(char *, kwnames), &py_handle, &py_flags, &py_options, &py_local_machine, &py_printer_local, &py_notify_options)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
		if (PyLong_Check(py_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_options == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.options");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.options));
		if (PyLong_Check(py_options)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_options);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.options = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_local_machine == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.local_machine");
		return false;
	}
	if (py_local_machine == Py_None) {
		r->in.local_machine = NULL;
	} else {
		r->in.local_machine = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_local_machine)) {
				unicode = PyUnicode_AsEncodedString(py_local_machine, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_local_machine)) {
				test_str = PyBytes_AS_STRING(py_local_machine);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_local_machine)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.local_machine = talloc_str;
		}
	}
	if (py_printer_local == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printer_local");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.printer_local));
		if (PyLong_Check(py_printer_local)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_printer_local);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.printer_local = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_notify_options == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.notify_options");
		return false;
	}
	if (py_notify_options == Py_None) {
		r->in.notify_options = NULL;
	} else {
		r->in.notify_options = NULL;
		PY_CHECK_TYPE(&spoolss_NotifyOption_Type, py_notify_options, return false;);
		if (talloc_reference(r, pytalloc_get_mem_ctx(py_notify_options)) == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.notify_options = (struct spoolss_NotifyOption *)pytalloc_get_ptr(py_notify_options);
	}
	return true;
}

static PyObject *unpack_py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_args_out(struct spoolss_RemoteFindFirstPrinterChangeNotifyEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_RouterReplyPrinterEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_RouterReplyPrinterEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_in_get_color(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_color;
	py_color = PyLong_FromUnsignedLongLong((uint32_t)(object->in.color));
	return py_color;
}

static int py_spoolss_RouterReplyPrinterEx_in_set_color(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.color");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.color));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.color = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_in_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
	return py_flags;
}

static int py_spoolss_RouterReplyPrinterEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_out_get_reply_result(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_reply_result;
	if (object->out.reply_result == NULL) {
		Py_RETURN_NONE;
	}
	py_reply_result = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.reply_result));
	return py_reply_result;
}

static int py_spoolss_RouterReplyPrinterEx_out_set_reply_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.reply_result));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.reply_result");
		return -1;
	}
	object->out.reply_result = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.reply_result);
	if (object->out.reply_result == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.reply_result));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.reply_result = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_in_get_reply_type(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_reply_type;
	py_reply_type = PyLong_FromUnsignedLongLong((uint32_t)(object->in.reply_type));
	return py_reply_type;
}

static int py_spoolss_RouterReplyPrinterEx_in_set_reply_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.reply_type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.reply_type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.reply_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_in_get_info(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	py_info = pyrpc_import_union(&spoolss_ReplyPrinterInfo_Type, pytalloc_get_mem_ctx(obj), object->in.reply_type, &object->in.info, "union spoolss_ReplyPrinterInfo");
	if (py_info == NULL) {
		return NULL;
	}
	return py_info;
}

static int py_spoolss_RouterReplyPrinterEx_in_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info");
		return -1;
	}
	{
		union spoolss_ReplyPrinterInfo *info_switch_0;
		info_switch_0 = (union spoolss_ReplyPrinterInfo *)pyrpc_export_union(&spoolss_ReplyPrinterInfo_Type, pytalloc_get_mem_ctx(py_obj), object->in.reply_type, value, "union spoolss_ReplyPrinterInfo");
		if (info_switch_0 == NULL) {
			return -1;
		}
		object->in.info = *info_switch_0;
	}
	return 0;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_RouterReplyPrinterEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_RouterReplyPrinterEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_RouterReplyPrinterEx_in_get_handle,
		.set = py_spoolss_RouterReplyPrinterEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_color"),
		.get = py_spoolss_RouterReplyPrinterEx_in_get_color,
		.set = py_spoolss_RouterReplyPrinterEx_in_set_color,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_flags"),
		.get = py_spoolss_RouterReplyPrinterEx_in_get_flags,
		.set = py_spoolss_RouterReplyPrinterEx_in_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterChangeFlags")
	},
	{
		.name = discard_const_p(char, "out_reply_result"),
		.get = py_spoolss_RouterReplyPrinterEx_out_get_reply_result,
		.set = py_spoolss_RouterReplyPrinterEx_out_set_reply_result,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterNotifyFlags")
	},
	{
		.name = discard_const_p(char, "in_reply_type"),
		.get = py_spoolss_RouterReplyPrinterEx_in_get_reply_type,
		.set = py_spoolss_RouterReplyPrinterEx_in_set_reply_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_info"),
		.get = py_spoolss_RouterReplyPrinterEx_in_get_info,
		.set = py_spoolss_RouterReplyPrinterEx_in_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_ReplyPrinterInfo")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_RouterReplyPrinterEx_get_result,
		.set = py_spoolss_RouterReplyPrinterEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_RouterReplyPrinterEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_RouterReplyPrinterEx, type);
	struct spoolss_RouterReplyPrinterEx *_self = (struct spoolss_RouterReplyPrinterEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.reply_result = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(66);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 67) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinterEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[66];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterReplyPrinterEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterReplyPrinterEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 67) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinterEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[66];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterReplyPrinterEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterReplyPrinterEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterReplyPrinterEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 67) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterReplyPrinterEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[66];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterReplyPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_RouterReplyPrinterEx_in", NDR_IN);
}

static PyObject *py_spoolss_RouterReplyPrinterEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterReplyPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_RouterReplyPrinterEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_RouterReplyPrinterEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_RouterReplyPrinterEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.RouterReplyPrinterEx.opnum() -> 66 (0x42) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterReplyPrinterEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_RouterReplyPrinterEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RouterReplyPrinterEx",
	.tp_getset = py_spoolss_RouterReplyPrinterEx_getsetters,
	.tp_methods = py_spoolss_RouterReplyPrinterEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_RouterReplyPrinterEx_new,
};

static bool pack_py_spoolss_RouterReplyPrinterEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_RouterReplyPrinterEx *r)
{
	PyObject *py_handle;
	PyObject *py_color;
	PyObject *py_flags;
	PyObject *py_reply_type;
	PyObject *py_info;
	const char *kwnames[] = {
		"handle", "color", "flags", "reply_type", "info", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_RouterReplyPrinterEx", discard_const_p(char *, kwnames), &py_handle, &py_color, &py_flags, &py_reply_type, &py_info)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_color == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.color");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.color));
		if (PyLong_Check(py_color)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_color);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.color = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
		if (PyLong_Check(py_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_reply_type == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.reply_type");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.reply_type));
		if (PyLong_Check(py_reply_type)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_reply_type);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.reply_type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_info == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info");
		return false;
	}
	{
		union spoolss_ReplyPrinterInfo *info_switch_0;
		info_switch_0 = (union spoolss_ReplyPrinterInfo *)pyrpc_export_union(&spoolss_ReplyPrinterInfo_Type, r, r->in.reply_type, py_info, "union spoolss_ReplyPrinterInfo");
		if (info_switch_0 == NULL) {
			return false;
		}
		r->in.info = *info_switch_0;
	}
	return true;
}

static PyObject *unpack_py_spoolss_RouterReplyPrinterEx_args_out(struct spoolss_RouterReplyPrinterEx *r, bool raise_result_exception)
{
	PyObject *py_reply_result = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_reply_result = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.reply_result));
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_reply_result);
	}
	if (result_size == 1) {
		result = py_reply_result;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_RouterRefreshPrinterChangeNotify_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_in_get_change_low(PyObject *obj, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_change_low;
	py_change_low = PyLong_FromUnsignedLongLong((uint32_t)(object->in.change_low));
	return py_change_low;
}

static int py_spoolss_RouterRefreshPrinterChangeNotify_in_set_change_low(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.change_low");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.change_low));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.change_low = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_in_get_options(PyObject *obj, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_options;
	if (object->in.options == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.options == NULL) {
		py_options = Py_None;
		Py_INCREF(py_options);
	} else {
		py_options = pytalloc_reference_ex(&spoolss_NotifyOption_Type, object->in.options, object->in.options);
	}
	return py_options;
}

static int py_spoolss_RouterRefreshPrinterChangeNotify_in_set_options(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.options));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.options");
		return -1;
	}
	if (value == Py_None) {
		object->in.options = NULL;
	} else {
		object->in.options = NULL;
		PY_CHECK_TYPE(&spoolss_NotifyOption_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.options = (struct spoolss_NotifyOption *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pytalloc_reference_ex(&spoolss_NotifyInfo_Type, *object->out.info, *object->out.info);
	}
	return py_info;
}

static int py_spoolss_RouterRefreshPrinterChangeNotify_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&spoolss_NotifyInfo_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		*object->out.info = (struct spoolss_NotifyInfo *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_get_result(PyObject *obj, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_RouterRefreshPrinterChangeNotify_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_RouterRefreshPrinterChangeNotify_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_RouterRefreshPrinterChangeNotify_in_get_handle,
		.set = py_spoolss_RouterRefreshPrinterChangeNotify_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_change_low"),
		.get = py_spoolss_RouterRefreshPrinterChangeNotify_in_get_change_low,
		.set = py_spoolss_RouterRefreshPrinterChangeNotify_in_set_change_low,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_options"),
		.get = py_spoolss_RouterRefreshPrinterChangeNotify_in_get_options,
		.set = py_spoolss_RouterRefreshPrinterChangeNotify_in_set_options,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyOption")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_RouterRefreshPrinterChangeNotify_out_get_info,
		.set = py_spoolss_RouterRefreshPrinterChangeNotify_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_NotifyInfo")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_RouterRefreshPrinterChangeNotify_get_result,
		.set = py_spoolss_RouterRefreshPrinterChangeNotify_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_RouterRefreshPrinterChangeNotify, type);
	struct spoolss_RouterRefreshPrinterChangeNotify *_self = (struct spoolss_RouterRefreshPrinterChangeNotify *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, struct spoolss_NotifyInfo *);
	return self;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(67);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 68) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[67];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 68) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[67];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_RouterRefreshPrinterChangeNotify *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 68) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[67];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print(py_obj, args, kwargs, "spoolss_RouterRefreshPrinterChangeNotify_in", NDR_IN);
}

static PyObject *py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print(py_obj, args, kwargs, "spoolss_RouterRefreshPrinterChangeNotify_out", NDR_OUT);
}

static PyMethodDef py_spoolss_RouterRefreshPrinterChangeNotify_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_RouterRefreshPrinterChangeNotify_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.RouterRefreshPrinterChangeNotify.opnum() -> 67 (0x43) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_RouterRefreshPrinterChangeNotify_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_RouterRefreshPrinterChangeNotify_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.RouterRefreshPrinterChangeNotify",
	.tp_getset = py_spoolss_RouterRefreshPrinterChangeNotify_getsetters,
	.tp_methods = py_spoolss_RouterRefreshPrinterChangeNotify_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_RouterRefreshPrinterChangeNotify_new,
};

static bool pack_py_spoolss_RouterRefreshPrinterChangeNotify_args_in(PyObject *args, PyObject *kwargs, struct spoolss_RouterRefreshPrinterChangeNotify *r)
{
	PyObject *py_handle;
	PyObject *py_change_low;
	PyObject *py_options;
	const char *kwnames[] = {
		"handle", "change_low", "options", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_RouterRefreshPrinterChangeNotify", discard_const_p(char *, kwnames), &py_handle, &py_change_low, &py_options)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_change_low == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.change_low");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.change_low));
		if (PyLong_Check(py_change_low)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_change_low);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.change_low = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_options == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.options");
		return false;
	}
	if (py_options == Py_None) {
		r->in.options = NULL;
	} else {
		r->in.options = NULL;
		PY_CHECK_TYPE(&spoolss_NotifyOption_Type, py_options, return false;);
		if (talloc_reference(r, pytalloc_get_mem_ctx(py_options)) == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.options = (struct spoolss_NotifyOption *)pytalloc_get_ptr(py_options);
	}
	return true;
}

static PyObject *unpack_py_spoolss_RouterRefreshPrinterChangeNotify_args_out(struct spoolss_RouterRefreshPrinterChangeNotify *r, bool raise_result_exception)
{
	PyObject *py_info = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = pytalloc_reference_ex(&spoolss_NotifyInfo_Type, *r->out.info, *r->out.info);
	}
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_info);
	}
	if (result_size == 1) {
		result = py_info;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_OpenPrinterEx_in_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->in.printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		if (object->in.printername == NULL) {
			py_printername = Py_None;
			Py_INCREF(py_printername);
		} else {
			py_printername = PyUnicode_Decode(object->in.printername, strlen(object->in.printername), "utf-8", "ignore");
		}
	}
	return py_printername;
}

static int py_spoolss_OpenPrinterEx_in_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printername");
		return -1;
	}
	if (value == Py_None) {
		object->in.printername = NULL;
	} else {
		object->in.printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.printername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_in_get_datatype(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_datatype;
	if (object->in.datatype == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.datatype == NULL) {
		py_datatype = Py_None;
		Py_INCREF(py_datatype);
	} else {
		if (object->in.datatype == NULL) {
			py_datatype = Py_None;
			Py_INCREF(py_datatype);
		} else {
			py_datatype = PyUnicode_Decode(object->in.datatype, strlen(object->in.datatype), "utf-8", "ignore");
		}
	}
	return py_datatype;
}

static int py_spoolss_OpenPrinterEx_in_set_datatype(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.datatype");
		return -1;
	}
	if (value == Py_None) {
		object->in.datatype = NULL;
	} else {
		object->in.datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.datatype = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, pytalloc_get_mem_ctx(obj), &object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_OpenPrinterEx_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = *(struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_in_get_access_mask(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_access_mask;
	py_access_mask = PyLong_FromUnsignedLongLong((uint32_t)(object->in.access_mask));
	return py_access_mask;
}

static int py_spoolss_OpenPrinterEx_in_set_access_mask(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.access_mask");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.access_mask));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.access_mask = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_in_get_userlevel_ctr(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_userlevel_ctr;
	py_userlevel_ctr = pytalloc_reference_ex(&spoolss_UserLevelCtr_Type, pytalloc_get_mem_ctx(obj), &object->in.userlevel_ctr);
	return py_userlevel_ctr;
}

static int py_spoolss_OpenPrinterEx_in_set_userlevel_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.userlevel_ctr");
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_UserLevelCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.userlevel_ctr = *(struct spoolss_UserLevelCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_OpenPrinterEx_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_OpenPrinterEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_OpenPrinterEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_OpenPrinterEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_printername"),
		.get = py_spoolss_OpenPrinterEx_in_get_printername,
		.set = py_spoolss_OpenPrinterEx_in_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_datatype"),
		.get = py_spoolss_OpenPrinterEx_in_get_datatype,
		.set = py_spoolss_OpenPrinterEx_in_set_datatype,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_OpenPrinterEx_in_get_devmode_ctr,
		.set = py_spoolss_OpenPrinterEx_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "in_access_mask"),
		.get = py_spoolss_OpenPrinterEx_in_get_access_mask,
		.set = py_spoolss_OpenPrinterEx_in_set_access_mask,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AccessRights")
	},
	{
		.name = discard_const_p(char, "in_userlevel_ctr"),
		.get = py_spoolss_OpenPrinterEx_in_get_userlevel_ctr,
		.set = py_spoolss_OpenPrinterEx_in_set_userlevel_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_UserLevelCtr")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_OpenPrinterEx_out_get_handle,
		.set = py_spoolss_OpenPrinterEx_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_OpenPrinterEx_get_result,
		.set = py_spoolss_OpenPrinterEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_OpenPrinterEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_OpenPrinterEx, type);
	struct spoolss_OpenPrinterEx *_self = (struct spoolss_OpenPrinterEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(69);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 70) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinterEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[69];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_OpenPrinterEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_OpenPrinterEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 70) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinterEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[69];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_OpenPrinterEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_OpenPrinterEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_OpenPrinterEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 70) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_OpenPrinterEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[69];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_OpenPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_OpenPrinterEx_in", NDR_IN);
}

static PyObject *py_spoolss_OpenPrinterEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_OpenPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_OpenPrinterEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_OpenPrinterEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_OpenPrinterEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.OpenPrinterEx.opnum() -> 69 (0x45) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_OpenPrinterEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_OpenPrinterEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.OpenPrinterEx",
	.tp_getset = py_spoolss_OpenPrinterEx_getsetters,
	.tp_methods = py_spoolss_OpenPrinterEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_OpenPrinterEx_new,
};

static bool pack_py_spoolss_OpenPrinterEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_OpenPrinterEx *r)
{
	PyObject *py_printername;
	PyObject *py_datatype;
	PyObject *py_devmode_ctr;
	PyObject *py_access_mask;
	PyObject *py_userlevel_ctr;
	const char *kwnames[] = {
		"printername", "datatype", "devmode_ctr", "access_mask", "userlevel_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_OpenPrinterEx", discard_const_p(char *, kwnames), &py_printername, &py_datatype, &py_devmode_ctr, &py_access_mask, &py_userlevel_ctr)) {
		return false;
	}

	if (py_printername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printername");
		return false;
	}
	if (py_printername == Py_None) {
		r->in.printername = NULL;
	} else {
		r->in.printername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_printername)) {
				unicode = PyUnicode_AsEncodedString(py_printername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_printername)) {
				test_str = PyBytes_AS_STRING(py_printername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_printername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.printername = talloc_str;
		}
	}
	if (py_datatype == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.datatype");
		return false;
	}
	if (py_datatype == Py_None) {
		r->in.datatype = NULL;
	} else {
		r->in.datatype = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_datatype)) {
				unicode = PyUnicode_AsEncodedString(py_datatype, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_datatype)) {
				test_str = PyBytes_AS_STRING(py_datatype);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_datatype)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.datatype = talloc_str;
		}
	}
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = *(struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	if (py_access_mask == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.access_mask");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.access_mask));
		if (PyLong_Check(py_access_mask)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_access_mask);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.access_mask = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_userlevel_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.userlevel_ctr");
		return false;
	}
	PY_CHECK_TYPE(&spoolss_UserLevelCtr_Type, py_userlevel_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_userlevel_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.userlevel_ctr = *(struct spoolss_UserLevelCtr *)pytalloc_get_ptr(py_userlevel_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_OpenPrinterEx_args_out(struct spoolss_OpenPrinterEx *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPrinterEx_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_AddPrinterEx_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_SetPrinterInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_AddPrinterEx_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_in_get_devmode_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_devmode_ctr;
	if (object->in.devmode_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_devmode_ctr = pytalloc_reference_ex(&spoolss_DevmodeContainer_Type, object->in.devmode_ctr, object->in.devmode_ctr);
	return py_devmode_ctr;
}

static int py_spoolss_AddPrinterEx_in_set_devmode_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.devmode_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.devmode_ctr");
		return -1;
	}
	object->in.devmode_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.devmode_ctr);
	if (object->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_in_get_secdesc_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_secdesc_ctr;
	if (object->in.secdesc_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_secdesc_ctr = pytalloc_reference_ex(sec_desc_buf_Type, object->in.secdesc_ctr, object->in.secdesc_ctr);
	return py_secdesc_ctr;
}

static int py_spoolss_AddPrinterEx_in_set_secdesc_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.secdesc_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.secdesc_ctr");
		return -1;
	}
	object->in.secdesc_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.secdesc_ctr);
	if (object->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_in_get_userlevel_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_userlevel_ctr;
	if (object->in.userlevel_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_userlevel_ctr = pytalloc_reference_ex(&spoolss_UserLevelCtr_Type, object->in.userlevel_ctr, object->in.userlevel_ctr);
	return py_userlevel_ctr;
}

static int py_spoolss_AddPrinterEx_in_set_userlevel_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.userlevel_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.userlevel_ctr");
		return -1;
	}
	object->in.userlevel_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.userlevel_ctr);
	if (object->in.userlevel_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_UserLevelCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.userlevel_ctr = (struct spoolss_UserLevelCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_out_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->out.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->out.handle, object->out.handle);
	return py_handle;
}

static int py_spoolss_AddPrinterEx_out_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.handle");
		return -1;
	}
	object->out.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.handle);
	if (object->out.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPrinterEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPrinterEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_AddPrinterEx_in_get_server,
		.set = py_spoolss_AddPrinterEx_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_AddPrinterEx_in_get_info_ctr,
		.set = py_spoolss_AddPrinterEx_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPrinterInfoCtr")
	},
	{
		.name = discard_const_p(char, "in_devmode_ctr"),
		.get = py_spoolss_AddPrinterEx_in_get_devmode_ctr,
		.set = py_spoolss_AddPrinterEx_in_set_devmode_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DevmodeContainer")
	},
	{
		.name = discard_const_p(char, "in_secdesc_ctr"),
		.get = py_spoolss_AddPrinterEx_in_get_secdesc_ctr,
		.set = py_spoolss_AddPrinterEx_in_set_secdesc_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
	},
	{
		.name = discard_const_p(char, "in_userlevel_ctr"),
		.get = py_spoolss_AddPrinterEx_in_get_userlevel_ctr,
		.set = py_spoolss_AddPrinterEx_in_set_userlevel_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_UserLevelCtr")
	},
	{
		.name = discard_const_p(char, "out_handle"),
		.get = py_spoolss_AddPrinterEx_out_get_handle,
		.set = py_spoolss_AddPrinterEx_out_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPrinterEx_get_result,
		.set = py_spoolss_AddPrinterEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPrinterEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPrinterEx, type);
	struct spoolss_AddPrinterEx *_self = (struct spoolss_AddPrinterEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_SetPrinterInfoCtr);
	_self->in.devmode_ctr = talloc_zero(mem_ctx, struct spoolss_DevmodeContainer);
	_self->in.secdesc_ctr = talloc_zero(mem_ctx, struct sec_desc_buf);
	_self->in.userlevel_ctr = talloc_zero(mem_ctx, struct spoolss_UserLevelCtr);
	_self->out.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_AddPrinterEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(70);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 71) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[70];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPrinterEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 71) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[70];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPrinterEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 71) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[70];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPrinterEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterEx_in", NDR_IN);
}

static PyObject *py_spoolss_AddPrinterEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPrinterEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPrinterEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPrinterEx.opnum() -> 70 (0x46) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPrinterEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPrinterEx",
	.tp_getset = py_spoolss_AddPrinterEx_getsetters,
	.tp_methods = py_spoolss_AddPrinterEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPrinterEx_new,
};

static bool pack_py_spoolss_AddPrinterEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPrinterEx *r)
{
	PyObject *py_server;
	PyObject *py_info_ctr;
	PyObject *py_devmode_ctr;
	PyObject *py_secdesc_ctr;
	PyObject *py_userlevel_ctr;
	const char *kwnames[] = {
		"server", "info_ctr", "devmode_ctr", "secdesc_ctr", "userlevel_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_AddPrinterEx", discard_const_p(char *, kwnames), &py_server, &py_info_ctr, &py_devmode_ctr, &py_secdesc_ctr, &py_userlevel_ctr)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_SetPrinterInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_SetPrinterInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	if (py_devmode_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.devmode_ctr");
		return false;
	}
	r->in.devmode_ctr = talloc_ptrtype(r, r->in.devmode_ctr);
	if (r->in.devmode_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_DevmodeContainer_Type, py_devmode_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_devmode_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.devmode_ctr = (struct spoolss_DevmodeContainer *)pytalloc_get_ptr(py_devmode_ctr);
	if (py_secdesc_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.secdesc_ctr");
		return false;
	}
	r->in.secdesc_ctr = talloc_ptrtype(r, r->in.secdesc_ctr);
	if (r->in.secdesc_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(sec_desc_buf_Type, py_secdesc_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_secdesc_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.secdesc_ctr = (struct sec_desc_buf *)pytalloc_get_ptr(py_secdesc_ctr);
	if (py_userlevel_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.userlevel_ctr");
		return false;
	}
	r->in.userlevel_ctr = talloc_ptrtype(r, r->in.userlevel_ctr);
	if (r->in.userlevel_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_UserLevelCtr_Type, py_userlevel_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_userlevel_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.userlevel_ctr = (struct spoolss_UserLevelCtr *)pytalloc_get_ptr(py_userlevel_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_AddPrinterEx_args_out(struct spoolss_AddPrinterEx *r, bool raise_result_exception)
{
	PyObject *py_handle = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_handle = pytalloc_reference_ex(policy_handle_Type, r->out.handle, r->out.handle);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_handle);
	}
	if (result_size == 1) {
		result = py_handle;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_SetPort_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_SetPort_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPort_in_get_port_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(obj);
	PyObject *py_port_name;
	if (object->in.port_name == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.port_name == NULL) {
		py_port_name = Py_None;
		Py_INCREF(py_port_name);
	} else {
		if (object->in.port_name == NULL) {
			py_port_name = Py_None;
			Py_INCREF(py_port_name);
		} else {
			py_port_name = PyUnicode_Decode(object->in.port_name, strlen(object->in.port_name), "utf-8", "ignore");
		}
	}
	return py_port_name;
}

static int py_spoolss_SetPort_in_set_port_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.port_name");
		return -1;
	}
	if (value == Py_None) {
		object->in.port_name = NULL;
	} else {
		object->in.port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.port_name = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPort_in_get_port_ctr(PyObject *obj, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(obj);
	PyObject *py_port_ctr;
	if (object->in.port_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_port_ctr = pytalloc_reference_ex(&spoolss_SetPortInfoContainer_Type, object->in.port_ctr, object->in.port_ctr);
	return py_port_ctr;
}

static int py_spoolss_SetPort_in_set_port_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.port_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.port_ctr");
		return -1;
	}
	object->in.port_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.port_ctr);
	if (object->in.port_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_SetPortInfoContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.port_ctr = (struct spoolss_SetPortInfoContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPort_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetPort_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetPort_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_SetPort_in_get_servername,
		.set = py_spoolss_SetPort_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_port_name"),
		.get = py_spoolss_SetPort_in_get_port_name,
		.set = py_spoolss_SetPort_in_set_port_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_port_ctr"),
		.get = py_spoolss_SetPort_in_get_port_ctr,
		.set = py_spoolss_SetPort_in_set_port_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_SetPortInfoContainer")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetPort_get_result,
		.set = py_spoolss_SetPort_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPort_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetPort, type);
	struct spoolss_SetPort *_self = (struct spoolss_SetPort *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.port_ctr = talloc_zero(mem_ctx, struct spoolss_SetPortInfoContainer);
	return self;
}

static PyObject *py_spoolss_SetPort_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(71);
}

static PyObject *py_spoolss_SetPort_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 72) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPort_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[71];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetPort_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPort_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetPort_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPort_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetPort_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 72) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPort_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[71];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPort_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPort_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPort_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPort_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPort_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPort *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 72) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPort_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[71];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetPort_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPort_ndr_print(py_obj, args, kwargs, "spoolss_SetPort_in", NDR_IN);
}

static PyObject *py_spoolss_SetPort_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPort_ndr_print(py_obj, args, kwargs, "spoolss_SetPort_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetPort_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetPort_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetPort.opnum() -> 71 (0x47) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPort_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPort_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPort",
	.tp_getset = py_spoolss_SetPort_getsetters,
	.tp_methods = py_spoolss_SetPort_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPort_new,
};

static bool pack_py_spoolss_SetPort_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetPort *r)
{
	PyObject *py_servername;
	PyObject *py_port_name;
	PyObject *py_port_ctr;
	const char *kwnames[] = {
		"servername", "port_name", "port_ctr", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_SetPort", discard_const_p(char *, kwnames), &py_servername, &py_port_name, &py_port_ctr)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_port_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.port_name");
		return false;
	}
	if (py_port_name == Py_None) {
		r->in.port_name = NULL;
	} else {
		r->in.port_name = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_port_name)) {
				unicode = PyUnicode_AsEncodedString(py_port_name, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_port_name)) {
				test_str = PyBytes_AS_STRING(py_port_name);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_port_name)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.port_name = talloc_str;
		}
	}
	if (py_port_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.port_ctr");
		return false;
	}
	r->in.port_ctr = talloc_ptrtype(r, r->in.port_ctr);
	if (r->in.port_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_SetPortInfoContainer_Type, py_port_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_port_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.port_ctr = (struct spoolss_SetPortInfoContainer *)pytalloc_get_ptr(py_port_ctr);
	return true;
}

static PyObject *unpack_py_spoolss_SetPort_args_out(struct spoolss_SetPort *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumPrinterData_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EnumPrinterData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_in_get_enum_index(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_enum_index;
	py_enum_index = PyLong_FromUnsignedLongLong((uint32_t)(object->in.enum_index));
	return py_enum_index;
}

static int py_spoolss_EnumPrinterData_in_set_enum_index(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.enum_index");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.enum_index));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.enum_index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_out_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->out.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->out.value_name, strlen(object->out.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_EnumPrinterData_out_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->out.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_in_get_value_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_offered;
	py_value_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.value_offered));
	return py_value_offered;
}

static int py_spoolss_EnumPrinterData_in_set_value_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.value_offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.value_offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_out_get_value_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_needed;
	if (object->out.value_needed == NULL) {
		Py_RETURN_NONE;
	}
	py_value_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.value_needed));
	return py_value_needed;
}

static int py_spoolss_EnumPrinterData_out_set_value_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.value_needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.value_needed");
		return -1;
	}
	object->out.value_needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.value_needed);
	if (object->out.value_needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.value_needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.value_needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_out_get_type(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	if (object->out.type == NULL) {
		Py_RETURN_NONE;
	}
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.type));
	return py_type;
}

static int py_spoolss_EnumPrinterData_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.type");
		return -1;
	}
	object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
	if (object->out.type == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_out_get_data(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->out.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.data_offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.data_offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_EnumPrinterData_out_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.data");
		return -1;
	}
	object->out.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data);
	if (object->out.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->out.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data, PyList_GET_SIZE(value));
		if (!object->out.data) { return -1; }
		talloc_set_name_const(object->out.data, "ARRAY: object->out.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_in_get_data_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_data_offered;
	py_data_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.data_offered));
	return py_data_offered;
}

static int py_spoolss_EnumPrinterData_in_set_data_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data_offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.data_offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.data_offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_out_get_data_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_data_needed;
	if (object->out.data_needed == NULL) {
		Py_RETURN_NONE;
	}
	py_data_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.data_needed));
	return py_data_needed;
}

static int py_spoolss_EnumPrinterData_out_set_data_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.data_needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.data_needed");
		return -1;
	}
	object->out.data_needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data_needed);
	if (object->out.data_needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.data_needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.data_needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrinterData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrinterData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EnumPrinterData_in_get_handle,
		.set = py_spoolss_EnumPrinterData_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_enum_index"),
		.get = py_spoolss_EnumPrinterData_in_get_enum_index,
		.set = py_spoolss_EnumPrinterData_in_set_enum_index,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_value_name"),
		.get = py_spoolss_EnumPrinterData_out_get_value_name,
		.set = py_spoolss_EnumPrinterData_out_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_value_offered"),
		.get = py_spoolss_EnumPrinterData_in_get_value_offered,
		.set = py_spoolss_EnumPrinterData_in_set_value_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_value_needed"),
		.get = py_spoolss_EnumPrinterData_out_get_value_needed,
		.set = py_spoolss_EnumPrinterData_out_set_value_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_type"),
		.get = py_spoolss_EnumPrinterData_out_get_type,
		.set = py_spoolss_EnumPrinterData_out_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "out_data"),
		.get = py_spoolss_EnumPrinterData_out_get_data,
		.set = py_spoolss_EnumPrinterData_out_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_data_offered"),
		.get = py_spoolss_EnumPrinterData_in_get_data_offered,
		.set = py_spoolss_EnumPrinterData_in_set_data_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_data_needed"),
		.get = py_spoolss_EnumPrinterData_out_get_data_needed,
		.set = py_spoolss_EnumPrinterData_out_set_data_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrinterData_get_result,
		.set = py_spoolss_EnumPrinterData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrinterData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrinterData, type);
	struct spoolss_EnumPrinterData *_self = (struct spoolss_EnumPrinterData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.value_needed = talloc_zero(mem_ctx, uint32_t);
	_self->out.type = talloc_zero(mem_ctx, enum winreg_Type);
	_self->out.data = talloc_zero(mem_ctx, uint8_t);
	_self->out.data_needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrinterData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(72);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 73) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[72];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrinterData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 73) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[72];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrinterData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 73) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[72];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrinterData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterData_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrinterData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterData_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrinterData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrinterData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrinterData.opnum() -> 72 (0x48) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrinterData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrinterData",
	.tp_getset = py_spoolss_EnumPrinterData_getsetters,
	.tp_methods = py_spoolss_EnumPrinterData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrinterData_new,
};

static bool pack_py_spoolss_EnumPrinterData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrinterData *r)
{
	PyObject *py_handle;
	PyObject *py_enum_index;
	PyObject *py_value_offered;
	PyObject *py_data_offered;
	const char *kwnames[] = {
		"handle", "enum_index", "value_offered", "data_offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_EnumPrinterData", discard_const_p(char *, kwnames), &py_handle, &py_enum_index, &py_value_offered, &py_data_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_enum_index == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.enum_index");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.enum_index));
		if (PyLong_Check(py_enum_index)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_enum_index);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.enum_index = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_value_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.value_offered));
		if (PyLong_Check(py_value_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_value_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.value_offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_data_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data_offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.data_offered));
		if (PyLong_Check(py_data_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_data_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.data_offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrinterData_args_out(struct spoolss_EnumPrinterData *r, bool raise_result_exception)
{
	PyObject *py_value_name = NULL;
	PyObject *py_value_needed = NULL;
	PyObject *py_type = NULL;
	PyObject *py_data = NULL;
	PyObject *py_data_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 5;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (r->out.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(r->out.value_name, strlen(r->out.value_name), "utf-8", "ignore");
	}
	PyTuple_SetItem(result, 0, py_value_name);

	py_value_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.value_needed));
	PyTuple_SetItem(result, 1, py_value_needed);

	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.type));
	PyTuple_SetItem(result, 2, py_type);

	py_data = PyList_New(r->in.data_offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (r->in.data_offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((r->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	PyTuple_SetItem(result, 3, py_data);

	py_data_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.data_needed));
	PyTuple_SetItem(result, 4, py_data_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 5, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterData_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_DeletePrinterData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinterData_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_DeletePrinterData_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_DeletePrinterData_in_get_handle,
		.set = py_spoolss_DeletePrinterData_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_DeletePrinterData_in_get_value_name,
		.set = py_spoolss_DeletePrinterData_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterData_get_result,
		.set = py_spoolss_DeletePrinterData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterData, type);
	struct spoolss_DeletePrinterData *_self = (struct spoolss_DeletePrinterData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeletePrinterData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(73);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 74) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[73];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 74) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[73];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 74) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[73];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterData_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterData_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterData_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterData.opnum() -> 73 (0x49) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterData",
	.tp_getset = py_spoolss_DeletePrinterData_getsetters,
	.tp_methods = py_spoolss_DeletePrinterData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterData_new,
};

static bool pack_py_spoolss_DeletePrinterData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterData *r)
{
	PyObject *py_handle;
	PyObject *py_value_name;
	const char *kwnames[] = {
		"handle", "value_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_DeletePrinterData", discard_const_p(char *, kwnames), &py_handle, &py_value_name)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterData_args_out(struct spoolss_DeletePrinterData *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_SetPrinterDataEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_SetPrinterDataEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_SetPrinterDataEx_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_SetPrinterDataEx_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_in_get_type(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(object->in.type));
	return py_type;
}

static int py_spoolss_SetPrinterDataEx_in_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.type");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_in_get_data(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->in.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->in.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_SetPrinterDataEx_in_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.data");
		return -1;
	}
	object->in.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data);
	if (object->in.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->in.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.data, PyList_GET_SIZE(value));
		if (!object->in.data) { return -1; }
		talloc_set_name_const(object->in.data, "ARRAY: object->in.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->in.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_SetPrinterDataEx_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetPrinterDataEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetPrinterDataEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetPrinterDataEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_SetPrinterDataEx_in_get_handle,
		.set = py_spoolss_SetPrinterDataEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_SetPrinterDataEx_in_get_key_name,
		.set = py_spoolss_SetPrinterDataEx_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_SetPrinterDataEx_in_get_value_name,
		.set = py_spoolss_SetPrinterDataEx_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_type"),
		.get = py_spoolss_SetPrinterDataEx_in_get_type,
		.set = py_spoolss_SetPrinterDataEx_in_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "in_data"),
		.get = py_spoolss_SetPrinterDataEx_in_get_data,
		.set = py_spoolss_SetPrinterDataEx_in_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_SetPrinterDataEx_in_get_offered,
		.set = py_spoolss_SetPrinterDataEx_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetPrinterDataEx_get_result,
		.set = py_spoolss_SetPrinterDataEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetPrinterDataEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetPrinterDataEx, type);
	struct spoolss_SetPrinterDataEx *_self = (struct spoolss_SetPrinterDataEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.data = talloc_zero(mem_ctx, uint8_t);
	return self;
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(77);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 78) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterDataEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[77];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinterDataEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetPrinterDataEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 78) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterDataEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[77];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 78) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetPrinterDataEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[77];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinterDataEx_in", NDR_IN);
}

static PyObject *py_spoolss_SetPrinterDataEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_SetPrinterDataEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetPrinterDataEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetPrinterDataEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetPrinterDataEx.opnum() -> 77 (0x4d) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetPrinterDataEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetPrinterDataEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetPrinterDataEx",
	.tp_getset = py_spoolss_SetPrinterDataEx_getsetters,
	.tp_methods = py_spoolss_SetPrinterDataEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetPrinterDataEx_new,
};

static bool pack_py_spoolss_SetPrinterDataEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetPrinterDataEx *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	PyObject *py_value_name;
	PyObject *py_type;
	PyObject *py_data;
	const char *kwnames[] = {
		"handle", "key_name", "value_name", "type", "data", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_SetPrinterDataEx", discard_const_p(char *, kwnames), &py_handle, &py_key_name, &py_value_name, &py_type, &py_data)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	if (py_type == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.type");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.type));
		if (PyLong_Check(py_type)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_type);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_data == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.data");
		return false;
	}
	r->in.data = talloc_ptrtype(r, r->in.data);
	if (r->in.data == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
	{
		int data_cntr_1;
		r->in.data = talloc_array_ptrtype(r, r->in.data, PyList_GET_SIZE(py_data));
		if (!r->in.data) { return false; }
		talloc_set_name_const(r->in.data, "ARRAY: r->in.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(py_data); data_cntr_1++) {
			if (PyList_GET_ITEM(py_data, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.data)[data_cntr_1]");
				return false;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(py_data, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_data, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return false;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return false;
					}
					(r->in.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return false;
				}
			}
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_data, return false;);
	r->in.offered = PyList_GET_SIZE(py_data);
	return true;
}

static PyObject *unpack_py_spoolss_SetPrinterDataEx_args_out(struct spoolss_SetPrinterDataEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_GetPrinterDataEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_GetPrinterDataEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_GetPrinterDataEx_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_GetPrinterDataEx_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_out_get_type(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_type;
	if (object->out.type == NULL) {
		Py_RETURN_NONE;
	}
	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.type));
	return py_type;
}

static int py_spoolss_GetPrinterDataEx_out_set_type(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.type));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.type");
		return -1;
	}
	object->out.type = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.type);
	if (object->out.type == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.type));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.type = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_out_get_data(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_data;
	if (object->out.data == NULL) {
		Py_RETURN_NONE;
	}
	py_data = PyList_New(object->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (object->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((object->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	return py_data;
}

static int py_spoolss_GetPrinterDataEx_out_set_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.data");
		return -1;
	}
	object->out.data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data);
	if (object->out.data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int data_cntr_1;
		object->out.data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.data, PyList_GET_SIZE(value));
		if (!object->out.data) { return -1; }
		talloc_set_name_const(object->out.data, "ARRAY: object->out.data");
		for (data_cntr_1 = 0; data_cntr_1 < PyList_GET_SIZE(value); data_cntr_1++) {
			if (PyList_GET_ITEM(value, data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.data)[data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.data)[data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.data)[data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_GetPrinterDataEx_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_GetPrinterDataEx_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDataEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterDataEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterDataEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_GetPrinterDataEx_in_get_handle,
		.set = py_spoolss_GetPrinterDataEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_GetPrinterDataEx_in_get_key_name,
		.set = py_spoolss_GetPrinterDataEx_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_GetPrinterDataEx_in_get_value_name,
		.set = py_spoolss_GetPrinterDataEx_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "out_type"),
		.get = py_spoolss_GetPrinterDataEx_out_get_type,
		.set = py_spoolss_GetPrinterDataEx_out_set_type,
		.doc = discard_const_p(char, "PIDL-generated element of base type winreg_Type")
	},
	{
		.name = discard_const_p(char, "out_data"),
		.get = py_spoolss_GetPrinterDataEx_out_get_data,
		.set = py_spoolss_GetPrinterDataEx_out_set_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_GetPrinterDataEx_in_get_offered,
		.set = py_spoolss_GetPrinterDataEx_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_GetPrinterDataEx_out_get_needed,
		.set = py_spoolss_GetPrinterDataEx_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterDataEx_get_result,
		.set = py_spoolss_GetPrinterDataEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterDataEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterDataEx, type);
	struct spoolss_GetPrinterDataEx *_self = (struct spoolss_GetPrinterDataEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.type = talloc_zero(mem_ctx, enum winreg_Type);
	_self->out.data = talloc_zero(mem_ctx, uint8_t);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(78);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 79) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDataEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[78];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDataEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDataEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 79) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDataEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[78];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 79) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDataEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[78];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDataEx_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterDataEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDataEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterDataEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterDataEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterDataEx.opnum() -> 78 (0x4e) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDataEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterDataEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterDataEx",
	.tp_getset = py_spoolss_GetPrinterDataEx_getsetters,
	.tp_methods = py_spoolss_GetPrinterDataEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterDataEx_new,
};

static bool pack_py_spoolss_GetPrinterDataEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterDataEx *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	PyObject *py_value_name;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "key_name", "value_name", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_GetPrinterDataEx", discard_const_p(char *, kwnames), &py_handle, &py_key_name, &py_value_name, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterDataEx_args_out(struct spoolss_GetPrinterDataEx *r, bool raise_result_exception)
{
	PyObject *py_type = NULL;
	PyObject *py_data = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_type = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.type));
	PyTuple_SetItem(result, 0, py_type);

	py_data = PyList_New(r->in.offered);
	if (py_data == NULL) {
		return NULL;
	}
	{
		int data_cntr_1;
		for (data_cntr_1 = 0; data_cntr_1 < (r->in.offered); data_cntr_1++) {
			PyObject *py_data_1;
			py_data_1 = PyLong_FromLong((uint16_t)((r->out.data)[data_cntr_1]));
			PyList_SetItem(py_data, data_cntr_1, py_data_1);
		}
	}
	PyTuple_SetItem(result, 1, py_data);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EnumPrinterDataEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EnumPrinterDataEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_EnumPrinterDataEx_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrinterDataEx_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPrinterDataEx_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pytalloc_reference_ex(&spoolss_PrinterEnumValues_Type, *object->out.info, &(*object->out.info)[info_cntr_2]);
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPrinterDataEx_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				PY_CHECK_TYPE(&spoolss_PrinterEnumValues_Type, PyList_GET_ITEM(value, info_cntr_2), return -1;);
				if (talloc_reference(*object->out.info, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, info_cntr_2))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(*object->out.info)[info_cntr_2] = *(struct spoolss_PrinterEnumValues *)pytalloc_get_ptr(PyList_GET_ITEM(value, info_cntr_2));
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrinterDataEx_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterDataEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrinterDataEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrinterDataEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EnumPrinterDataEx_in_get_handle,
		.set = py_spoolss_EnumPrinterDataEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_EnumPrinterDataEx_in_get_key_name,
		.set = py_spoolss_EnumPrinterDataEx_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrinterDataEx_in_get_offered,
		.set = py_spoolss_EnumPrinterDataEx_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPrinterDataEx_out_get_count,
		.set = py_spoolss_EnumPrinterDataEx_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPrinterDataEx_out_get_info,
		.set = py_spoolss_EnumPrinterDataEx_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterEnumValues")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrinterDataEx_out_get_needed,
		.set = py_spoolss_EnumPrinterDataEx_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrinterDataEx_get_result,
		.set = py_spoolss_EnumPrinterDataEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrinterDataEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrinterDataEx, type);
	struct spoolss_EnumPrinterDataEx *_self = (struct spoolss_EnumPrinterDataEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(79);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 80) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDataEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[79];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterDataEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterDataEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 80) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDataEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[79];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterDataEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterDataEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 80) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterDataEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[79];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterDataEx_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrinterDataEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterDataEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrinterDataEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrinterDataEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrinterDataEx.opnum() -> 79 (0x4f) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterDataEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrinterDataEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrinterDataEx",
	.tp_getset = py_spoolss_EnumPrinterDataEx_getsetters,
	.tp_methods = py_spoolss_EnumPrinterDataEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrinterDataEx_new,
};

static bool pack_py_spoolss_EnumPrinterDataEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrinterDataEx *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "key_name", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_EnumPrinterDataEx", discard_const_p(char *, kwnames), &py_handle, &py_key_name, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrinterDataEx_args_out(struct spoolss_EnumPrinterDataEx *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pytalloc_reference_ex(&spoolss_PrinterEnumValues_Type, *r->out.info, &(*r->out.info)[info_cntr_2]);
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_EnumPrinterKey_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_EnumPrinterKey_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_EnumPrinterKey_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_out_get__ndr_size(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py__ndr_size;
	if (object->out._ndr_size == NULL) {
		Py_RETURN_NONE;
	}
	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(*object->out._ndr_size));
	return py__ndr_size;
}

static int py_spoolss_EnumPrinterKey_out_set__ndr_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out._ndr_size));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out._ndr_size");
		return -1;
	}
	object->out._ndr_size = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out._ndr_size);
	if (object->out._ndr_size == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out._ndr_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out._ndr_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_out_get_key_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_key_buffer;
	if (object->out.key_buffer == NULL) {
		Py_RETURN_NONE;
	}
	py_key_buffer = pyrpc_import_union(&spoolss_KeyNames_Type, object->out.key_buffer, *object->out._ndr_size, object->out.key_buffer, "union spoolss_KeyNames");
	if (py_key_buffer == NULL) {
		return NULL;
	}
	return py_key_buffer;
}

static int py_spoolss_EnumPrinterKey_out_set_key_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.key_buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.key_buffer");
		return -1;
	}
	object->out.key_buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.key_buffer);
	if (object->out.key_buffer == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		union spoolss_KeyNames *key_buffer_switch_2;
		key_buffer_switch_2 = (union spoolss_KeyNames *)pyrpc_export_union(&spoolss_KeyNames_Type, pytalloc_get_mem_ctx(py_obj), *object->out._ndr_size, value, "union spoolss_KeyNames");
		if (key_buffer_switch_2 == NULL) {
			return -1;
		}
		object->out.key_buffer = key_buffer_switch_2;
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPrinterKey_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPrinterKey_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPrinterKey_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPrinterKey_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPrinterKey_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_EnumPrinterKey_in_get_handle,
		.set = py_spoolss_EnumPrinterKey_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_EnumPrinterKey_in_get_key_name,
		.set = py_spoolss_EnumPrinterKey_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "out__ndr_size"),
		.get = py_spoolss_EnumPrinterKey_out_get__ndr_size,
		.set = py_spoolss_EnumPrinterKey_out_set__ndr_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_key_buffer"),
		.get = py_spoolss_EnumPrinterKey_out_get_key_buffer,
		.set = py_spoolss_EnumPrinterKey_out_set_key_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_KeyNames")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPrinterKey_in_get_offered,
		.set = py_spoolss_EnumPrinterKey_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPrinterKey_out_get_needed,
		.set = py_spoolss_EnumPrinterKey_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPrinterKey_get_result,
		.set = py_spoolss_EnumPrinterKey_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPrinterKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPrinterKey, type);
	struct spoolss_EnumPrinterKey *_self = (struct spoolss_EnumPrinterKey *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out._ndr_size = talloc_zero(mem_ctx, uint32_t);
	_self->out.key_buffer = talloc_zero(mem_ctx, union spoolss_KeyNames);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(80);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 81) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterKey_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[80];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterKey_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPrinterKey_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 81) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterKey_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[80];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterKey_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPrinterKey_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPrinterKey *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 81) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPrinterKey_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[80];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterKey_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterKey_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPrinterKey_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPrinterKey_ndr_print(py_obj, args, kwargs, "spoolss_EnumPrinterKey_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPrinterKey_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPrinterKey_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPrinterKey.opnum() -> 80 (0x50) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPrinterKey_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPrinterKey_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPrinterKey",
	.tp_getset = py_spoolss_EnumPrinterKey_getsetters,
	.tp_methods = py_spoolss_EnumPrinterKey_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPrinterKey_new,
};

static bool pack_py_spoolss_EnumPrinterKey_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPrinterKey *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	PyObject *py_offered;
	const char *kwnames[] = {
		"handle", "key_name", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_EnumPrinterKey", discard_const_p(char *, kwnames), &py_handle, &py_key_name, &py_offered)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPrinterKey_args_out(struct spoolss_EnumPrinterKey *r, bool raise_result_exception)
{
	PyObject *py__ndr_size = NULL;
	PyObject *py_key_buffer = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py__ndr_size = PyLong_FromUnsignedLongLong((uint32_t)(*r->out._ndr_size));
	PyTuple_SetItem(result, 0, py__ndr_size);

	py_key_buffer = pyrpc_import_union(&spoolss_KeyNames_Type, r->out.key_buffer, *r->out._ndr_size, r->out.key_buffer, "union spoolss_KeyNames");
	if (py_key_buffer == NULL) {
		return NULL;
	}
	PyTuple_SetItem(result, 1, py_key_buffer);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterDataEx_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_DeletePrinterDataEx_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDataEx_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_DeletePrinterDataEx_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDataEx_in_get_value_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_value_name;
	if (object->in.value_name == NULL) {
		py_value_name = Py_None;
		Py_INCREF(py_value_name);
	} else {
		py_value_name = PyUnicode_Decode(object->in.value_name, strlen(object->in.value_name), "utf-8", "ignore");
	}
	return py_value_name;
}

static int py_spoolss_DeletePrinterDataEx_in_set_value_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.value_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.value_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDataEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterDataEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterDataEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_DeletePrinterDataEx_in_get_handle,
		.set = py_spoolss_DeletePrinterDataEx_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_DeletePrinterDataEx_in_get_key_name,
		.set = py_spoolss_DeletePrinterDataEx_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_value_name"),
		.get = py_spoolss_DeletePrinterDataEx_in_get_value_name,
		.set = py_spoolss_DeletePrinterDataEx_in_set_value_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterDataEx_get_result,
		.set = py_spoolss_DeletePrinterDataEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterDataEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterDataEx, type);
	struct spoolss_DeletePrinterDataEx *_self = (struct spoolss_DeletePrinterDataEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(81);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 82) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDataEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[81];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDataEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDataEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 82) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDataEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[81];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDataEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDataEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDataEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 82) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDataEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[81];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDataEx_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterDataEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDataEx_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDataEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterDataEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterDataEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterDataEx.opnum() -> 81 (0x51) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDataEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterDataEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterDataEx",
	.tp_getset = py_spoolss_DeletePrinterDataEx_getsetters,
	.tp_methods = py_spoolss_DeletePrinterDataEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterDataEx_new,
};

static bool pack_py_spoolss_DeletePrinterDataEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterDataEx *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	PyObject *py_value_name;
	const char *kwnames[] = {
		"handle", "key_name", "value_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_DeletePrinterDataEx", discard_const_p(char *, kwnames), &py_handle, &py_key_name, &py_value_name)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	if (py_value_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.value_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_value_name)) {
			unicode = PyUnicode_AsEncodedString(py_value_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_value_name)) {
			test_str = PyBytes_AS_STRING(py_value_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_value_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.value_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterDataEx_args_out(struct spoolss_DeletePrinterDataEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterKey_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_DeletePrinterKey_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeletePrinterKey_in_get_key_name(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_key_name;
	if (object->in.key_name == NULL) {
		py_key_name = Py_None;
		Py_INCREF(py_key_name);
	} else {
		py_key_name = PyUnicode_Decode(object->in.key_name, strlen(object->in.key_name), "utf-8", "ignore");
	}
	return py_key_name;
}

static int py_spoolss_DeletePrinterKey_in_set_key_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.key_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.key_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterKey_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterKey_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterKey_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_DeletePrinterKey_in_get_handle,
		.set = py_spoolss_DeletePrinterKey_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_key_name"),
		.get = py_spoolss_DeletePrinterKey_in_get_key_name,
		.set = py_spoolss_DeletePrinterKey_in_set_key_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterKey_get_result,
		.set = py_spoolss_DeletePrinterKey_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterKey_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterKey, type);
	struct spoolss_DeletePrinterKey *_self = (struct spoolss_DeletePrinterKey *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(82);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 83) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterKey_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[82];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterKey_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterKey_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 83) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterKey_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[82];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterKey_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterKey_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterKey *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 83) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterKey_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[82];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterKey_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterKey_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterKey_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterKey_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterKey_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterKey_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterKey_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterKey.opnum() -> 82 (0x52) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterKey_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterKey_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterKey",
	.tp_getset = py_spoolss_DeletePrinterKey_getsetters,
	.tp_methods = py_spoolss_DeletePrinterKey_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterKey_new,
};

static bool pack_py_spoolss_DeletePrinterKey_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterKey *r)
{
	PyObject *py_handle;
	PyObject *py_key_name;
	const char *kwnames[] = {
		"handle", "key_name", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_DeletePrinterKey", discard_const_p(char *, kwnames), &py_handle, &py_key_name)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_key_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.key_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_key_name)) {
			unicode = PyUnicode_AsEncodedString(py_key_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_key_name)) {
			test_str = PyBytes_AS_STRING(py_key_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_key_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.key_name = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterKey_args_out(struct spoolss_DeletePrinterKey *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeletePrinterDriverEx_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_DeletePrinterDriverEx_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
	}
	return py_architecture;
}

static int py_spoolss_DeletePrinterDriverEx_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.architecture = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_in_get_driver(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_driver;
	if (object->in.driver == NULL) {
		py_driver = Py_None;
		Py_INCREF(py_driver);
	} else {
		py_driver = PyUnicode_Decode(object->in.driver, strlen(object->in.driver), "utf-8", "ignore");
	}
	return py_driver;
}

static int py_spoolss_DeletePrinterDriverEx_in_set_driver(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.driver");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.driver = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_in_get_delete_flags(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_delete_flags;
	py_delete_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.delete_flags));
	return py_delete_flags;
}

static int py_spoolss_DeletePrinterDriverEx_in_set_delete_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.delete_flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.delete_flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.delete_flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_in_get_version(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_version;
	py_version = PyLong_FromUnsignedLongLong((uint32_t)(object->in.version));
	return py_version;
}

static int py_spoolss_DeletePrinterDriverEx_in_set_version(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.version");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.version));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePrinterDriverEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePrinterDriverEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_DeletePrinterDriverEx_in_get_server,
		.set = py_spoolss_DeletePrinterDriverEx_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_DeletePrinterDriverEx_in_get_architecture,
		.set = py_spoolss_DeletePrinterDriverEx_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_driver"),
		.get = py_spoolss_DeletePrinterDriverEx_in_get_driver,
		.set = py_spoolss_DeletePrinterDriverEx_in_set_driver,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_delete_flags"),
		.get = py_spoolss_DeletePrinterDriverEx_in_get_delete_flags,
		.set = py_spoolss_DeletePrinterDriverEx_in_set_delete_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_DeleteDriverFlags")
	},
	{
		.name = discard_const_p(char, "in_version"),
		.get = py_spoolss_DeletePrinterDriverEx_in_get_version,
		.set = py_spoolss_DeletePrinterDriverEx_in_set_version,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePrinterDriverEx_get_result,
		.set = py_spoolss_DeletePrinterDriverEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePrinterDriverEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePrinterDriverEx, type);
	return self;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(84);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 85) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriverEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[84];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDriverEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePrinterDriverEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 85) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriverEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[84];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDriverEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePrinterDriverEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 85) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePrinterDriverEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[84];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDriverEx_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDriverEx_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePrinterDriverEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePrinterDriverEx_ndr_print(py_obj, args, kwargs, "spoolss_DeletePrinterDriverEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePrinterDriverEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePrinterDriverEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePrinterDriverEx.opnum() -> 84 (0x54) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePrinterDriverEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePrinterDriverEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePrinterDriverEx",
	.tp_getset = py_spoolss_DeletePrinterDriverEx_getsetters,
	.tp_methods = py_spoolss_DeletePrinterDriverEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePrinterDriverEx_new,
};

static bool pack_py_spoolss_DeletePrinterDriverEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePrinterDriverEx *r)
{
	PyObject *py_server;
	PyObject *py_architecture;
	PyObject *py_driver;
	PyObject *py_delete_flags;
	PyObject *py_version;
	const char *kwnames[] = {
		"server", "architecture", "driver", "delete_flags", "version", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_DeletePrinterDriverEx", discard_const_p(char *, kwnames), &py_server, &py_architecture, &py_driver, &py_delete_flags, &py_version)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_architecture)) {
			unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_architecture)) {
			test_str = PyBytes_AS_STRING(py_architecture);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.architecture = talloc_str;
	}
	if (py_driver == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.driver");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_driver)) {
			unicode = PyUnicode_AsEncodedString(py_driver, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_driver)) {
			test_str = PyBytes_AS_STRING(py_driver);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_driver)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.driver = talloc_str;
	}
	if (py_delete_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.delete_flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.delete_flags));
		if (PyLong_Check(py_delete_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_delete_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.delete_flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_version == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.version");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.version));
		if (PyLong_Check(py_version)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_version);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.version = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePrinterDriverEx_args_out(struct spoolss_DeletePrinterDriverEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_AddPerMachineConnection_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_AddPerMachineConnection_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPerMachineConnection_in_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->in.printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyUnicode_Decode(object->in.printername, strlen(object->in.printername), "utf-8", "ignore");
	}
	return py_printername;
}

static int py_spoolss_AddPerMachineConnection_in_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printername");
		return -1;
	}
	object->in.printername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.printername);
	if (object->in.printername == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.printername = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPerMachineConnection_in_get_printserver(PyObject *obj, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_printserver;
	if (object->in.printserver == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.printserver == NULL) {
		py_printserver = Py_None;
		Py_INCREF(py_printserver);
	} else {
		py_printserver = PyUnicode_Decode(object->in.printserver, strlen(object->in.printserver), "utf-8", "ignore");
	}
	return py_printserver;
}

static int py_spoolss_AddPerMachineConnection_in_set_printserver(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printserver");
		return -1;
	}
	object->in.printserver = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.printserver);
	if (object->in.printserver == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.printserver = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPerMachineConnection_in_get_provider(PyObject *obj, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_provider;
	if (object->in.provider == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.provider == NULL) {
		py_provider = Py_None;
		Py_INCREF(py_provider);
	} else {
		py_provider = PyUnicode_Decode(object->in.provider, strlen(object->in.provider), "utf-8", "ignore");
	}
	return py_provider;
}

static int py_spoolss_AddPerMachineConnection_in_set_provider(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.provider");
		return -1;
	}
	object->in.provider = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.provider);
	if (object->in.provider == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.provider = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_AddPerMachineConnection_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPerMachineConnection_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPerMachineConnection_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_AddPerMachineConnection_in_get_server,
		.set = py_spoolss_AddPerMachineConnection_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_printername"),
		.get = py_spoolss_AddPerMachineConnection_in_get_printername,
		.set = py_spoolss_AddPerMachineConnection_in_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_printserver"),
		.get = py_spoolss_AddPerMachineConnection_in_get_printserver,
		.set = py_spoolss_AddPerMachineConnection_in_set_printserver,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_provider"),
		.get = py_spoolss_AddPerMachineConnection_in_get_provider,
		.set = py_spoolss_AddPerMachineConnection_in_set_provider,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPerMachineConnection_get_result,
		.set = py_spoolss_AddPerMachineConnection_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPerMachineConnection_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPerMachineConnection, type);
	return self;
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(85);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 86) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPerMachineConnection_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[85];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPerMachineConnection_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPerMachineConnection_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 86) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPerMachineConnection_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[85];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPerMachineConnection_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPerMachineConnection_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPerMachineConnection *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 86) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPerMachineConnection_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[85];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPerMachineConnection_ndr_print(py_obj, args, kwargs, "spoolss_AddPerMachineConnection_in", NDR_IN);
}

static PyObject *py_spoolss_AddPerMachineConnection_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPerMachineConnection_ndr_print(py_obj, args, kwargs, "spoolss_AddPerMachineConnection_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPerMachineConnection_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPerMachineConnection_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPerMachineConnection.opnum() -> 85 (0x55) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPerMachineConnection_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPerMachineConnection_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPerMachineConnection",
	.tp_getset = py_spoolss_AddPerMachineConnection_getsetters,
	.tp_methods = py_spoolss_AddPerMachineConnection_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPerMachineConnection_new,
};

static bool pack_py_spoolss_AddPerMachineConnection_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPerMachineConnection *r)
{
	PyObject *py_server;
	PyObject *py_printername;
	PyObject *py_printserver;
	PyObject *py_provider;
	const char *kwnames[] = {
		"server", "printername", "printserver", "provider", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_AddPerMachineConnection", discard_const_p(char *, kwnames), &py_server, &py_printername, &py_printserver, &py_provider)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_printername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printername");
		return false;
	}
	r->in.printername = talloc_ptrtype(r, r->in.printername);
	if (r->in.printername == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_printername)) {
			unicode = PyUnicode_AsEncodedString(py_printername, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_printername)) {
			test_str = PyBytes_AS_STRING(py_printername);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_printername)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.printername = talloc_str;
	}
	if (py_printserver == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printserver");
		return false;
	}
	r->in.printserver = talloc_ptrtype(r, r->in.printserver);
	if (r->in.printserver == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_printserver)) {
			unicode = PyUnicode_AsEncodedString(py_printserver, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_printserver)) {
			test_str = PyBytes_AS_STRING(py_printserver);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_printserver)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.printserver = talloc_str;
	}
	if (py_provider == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.provider");
		return false;
	}
	r->in.provider = talloc_ptrtype(r, r->in.provider);
	if (r->in.provider == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_provider)) {
			unicode = PyUnicode_AsEncodedString(py_provider, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_provider)) {
			test_str = PyBytes_AS_STRING(py_provider);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_provider)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.provider = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_AddPerMachineConnection_args_out(struct spoolss_AddPerMachineConnection *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeletePerMachineConnection_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_DeletePerMachineConnection_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeletePerMachineConnection_in_get_printername(PyObject *obj, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_printername;
	if (object->in.printername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.printername == NULL) {
		py_printername = Py_None;
		Py_INCREF(py_printername);
	} else {
		py_printername = PyUnicode_Decode(object->in.printername, strlen(object->in.printername), "utf-8", "ignore");
	}
	return py_printername;
}

static int py_spoolss_DeletePerMachineConnection_in_set_printername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.printername");
		return -1;
	}
	object->in.printername = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.printername);
	if (object->in.printername == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.printername = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeletePerMachineConnection_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeletePerMachineConnection_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeletePerMachineConnection_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_DeletePerMachineConnection_in_get_server,
		.set = py_spoolss_DeletePerMachineConnection_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_printername"),
		.get = py_spoolss_DeletePerMachineConnection_in_get_printername,
		.set = py_spoolss_DeletePerMachineConnection_in_set_printername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeletePerMachineConnection_get_result,
		.set = py_spoolss_DeletePerMachineConnection_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeletePerMachineConnection_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeletePerMachineConnection, type);
	return self;
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(86);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 87) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePerMachineConnection_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[86];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePerMachineConnection_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeletePerMachineConnection_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 87) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePerMachineConnection_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[86];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePerMachineConnection_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeletePerMachineConnection_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeletePerMachineConnection *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 87) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeletePerMachineConnection_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[86];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePerMachineConnection_ndr_print(py_obj, args, kwargs, "spoolss_DeletePerMachineConnection_in", NDR_IN);
}

static PyObject *py_spoolss_DeletePerMachineConnection_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeletePerMachineConnection_ndr_print(py_obj, args, kwargs, "spoolss_DeletePerMachineConnection_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeletePerMachineConnection_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeletePerMachineConnection_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeletePerMachineConnection.opnum() -> 86 (0x56) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeletePerMachineConnection_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeletePerMachineConnection_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeletePerMachineConnection",
	.tp_getset = py_spoolss_DeletePerMachineConnection_getsetters,
	.tp_methods = py_spoolss_DeletePerMachineConnection_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeletePerMachineConnection_new,
};

static bool pack_py_spoolss_DeletePerMachineConnection_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeletePerMachineConnection *r)
{
	PyObject *py_server;
	PyObject *py_printername;
	const char *kwnames[] = {
		"server", "printername", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_DeletePerMachineConnection", discard_const_p(char *, kwnames), &py_server, &py_printername)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_printername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.printername");
		return false;
	}
	r->in.printername = talloc_ptrtype(r, r->in.printername);
	if (r->in.printername == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_printername)) {
			unicode = PyUnicode_AsEncodedString(py_printername, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_printername)) {
			test_str = PyBytes_AS_STRING(py_printername);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_printername)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.printername = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeletePerMachineConnection_args_out(struct spoolss_DeletePerMachineConnection *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumPerMachineConnections_in_get_server(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_server;
	if (object->in.server == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.server == NULL) {
		py_server = Py_None;
		Py_INCREF(py_server);
	} else {
		if (object->in.server == NULL) {
			py_server = Py_None;
			Py_INCREF(py_server);
		} else {
			py_server = PyUnicode_Decode(object->in.server, strlen(object->in.server), "utf-8", "ignore");
		}
	}
	return py_server;
}

static int py_spoolss_EnumPerMachineConnections_in_set_server(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.server");
		return -1;
	}
	if (value == Py_None) {
		object->in.server = NULL;
	} else {
		object->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.server = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_in_get_buffer(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_buffer;
	if (object->in.buffer == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.buffer == NULL) {
		py_buffer = Py_None;
		Py_INCREF(py_buffer);
	} else {
		py_buffer = PyBytes_FromStringAndSize((char *)(*object->in.buffer).data, (*object->in.buffer).length);
	}
	return py_buffer;
}

static int py_spoolss_EnumPerMachineConnections_in_set_buffer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.buffer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.buffer");
		return -1;
	}
	if (value == Py_None) {
		object->in.buffer = NULL;
	} else {
		object->in.buffer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.buffer);
		if (object->in.buffer == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		if (!PyBytes_Check(value)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		*object->in.buffer = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_in_get_offered(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_offered;
	py_offered = PyLong_FromUnsignedLongLong((uint32_t)(object->in.offered));
	return py_offered;
}

static int py_spoolss_EnumPerMachineConnections_in_set_offered(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.offered");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.offered));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_out_get_count(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_count;
	if (object->out.count == NULL) {
		Py_RETURN_NONE;
	}
	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.count));
	return py_count;
}

static int py_spoolss_EnumPerMachineConnections_out_set_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.count));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.count");
		return -1;
	}
	object->out.count = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.count);
	if (object->out.count == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_out_get_info(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_info;
	if (object->out.info == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*object->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*object->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pytalloc_reference_ex(&spoolss_PrinterInfo4_Type, *object->out.info, &(*object->out.info)[info_cntr_2]);
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	return py_info;
}

static int py_spoolss_EnumPerMachineConnections_out_set_info(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.info));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.info");
		return -1;
	}
	object->out.info = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.info);
	if (object->out.info == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.info = NULL;
	} else {
		*object->out.info = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int info_cntr_2;
			*object->out.info = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.info, PyList_GET_SIZE(value));
			if (!*object->out.info) { return -1; }
			talloc_set_name_const(*object->out.info, "ARRAY: *object->out.info");
			for (info_cntr_2 = 0; info_cntr_2 < PyList_GET_SIZE(value); info_cntr_2++) {
				if (PyList_GET_ITEM(value, info_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.info)[info_cntr_2]");
					return -1;
				}
				PY_CHECK_TYPE(&spoolss_PrinterInfo4_Type, PyList_GET_ITEM(value, info_cntr_2), return -1;);
				if (talloc_reference(*object->out.info, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, info_cntr_2))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(*object->out.info)[info_cntr_2] = *(struct spoolss_PrinterInfo4 *)pytalloc_get_ptr(PyList_GET_ITEM(value, info_cntr_2));
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_EnumPerMachineConnections_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumPerMachineConnections_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumPerMachineConnections_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumPerMachineConnections_getsetters[] = {
	{
		.name = discard_const_p(char, "in_server"),
		.get = py_spoolss_EnumPerMachineConnections_in_get_server,
		.set = py_spoolss_EnumPerMachineConnections_in_set_server,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_buffer"),
		.get = py_spoolss_EnumPerMachineConnections_in_get_buffer,
		.set = py_spoolss_EnumPerMachineConnections_in_set_buffer,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in_offered"),
		.get = py_spoolss_EnumPerMachineConnections_in_get_offered,
		.set = py_spoolss_EnumPerMachineConnections_in_set_offered,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_count"),
		.get = py_spoolss_EnumPerMachineConnections_out_get_count,
		.set = py_spoolss_EnumPerMachineConnections_out_set_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_info"),
		.get = py_spoolss_EnumPerMachineConnections_out_get_info,
		.set = py_spoolss_EnumPerMachineConnections_out_set_info,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrinterInfo4")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_EnumPerMachineConnections_out_get_needed,
		.set = py_spoolss_EnumPerMachineConnections_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumPerMachineConnections_get_result,
		.set = py_spoolss_EnumPerMachineConnections_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumPerMachineConnections_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumPerMachineConnections, type);
	struct spoolss_EnumPerMachineConnections *_self = (struct spoolss_EnumPerMachineConnections *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.count = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterInfo4 *);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(87);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 88) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPerMachineConnections_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[87];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPerMachineConnections_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumPerMachineConnections_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 88) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPerMachineConnections_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[87];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPerMachineConnections_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumPerMachineConnections_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumPerMachineConnections *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 88) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumPerMachineConnections_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[87];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPerMachineConnections_ndr_print(py_obj, args, kwargs, "spoolss_EnumPerMachineConnections_in", NDR_IN);
}

static PyObject *py_spoolss_EnumPerMachineConnections_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumPerMachineConnections_ndr_print(py_obj, args, kwargs, "spoolss_EnumPerMachineConnections_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumPerMachineConnections_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumPerMachineConnections_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumPerMachineConnections.opnum() -> 87 (0x57) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumPerMachineConnections_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumPerMachineConnections_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumPerMachineConnections",
	.tp_getset = py_spoolss_EnumPerMachineConnections_getsetters,
	.tp_methods = py_spoolss_EnumPerMachineConnections_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumPerMachineConnections_new,
};

static bool pack_py_spoolss_EnumPerMachineConnections_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumPerMachineConnections *r)
{
	PyObject *py_server;
	PyObject *py_buffer;
	PyObject *py_offered;
	const char *kwnames[] = {
		"server", "buffer", "offered", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_EnumPerMachineConnections", discard_const_p(char *, kwnames), &py_server, &py_buffer, &py_offered)) {
		return false;
	}

	if (py_server == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.server");
		return false;
	}
	if (py_server == Py_None) {
		r->in.server = NULL;
	} else {
		r->in.server = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_server)) {
				unicode = PyUnicode_AsEncodedString(py_server, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_server)) {
				test_str = PyBytes_AS_STRING(py_server);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_server)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.server = talloc_str;
		}
	}
	if (py_buffer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.buffer");
		return false;
	}
	if (py_buffer == Py_None) {
		r->in.buffer = NULL;
	} else {
		r->in.buffer = talloc_ptrtype(r, r->in.buffer);
		if (r->in.buffer == NULL) {
			PyErr_NoMemory();
			return false;
		}
		if (!PyBytes_Check(py_buffer)) {
			PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_buffer)->tp_name);
			return false;
		}
		*r->in.buffer = data_blob_talloc(r, PyBytes_AS_STRING(py_buffer), PyBytes_GET_SIZE(py_buffer));
	}
	if (py_offered == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.offered");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.offered));
		if (PyLong_Check(py_offered)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_offered);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.offered = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumPerMachineConnections_args_out(struct spoolss_EnumPerMachineConnections *r, bool raise_result_exception)
{
	PyObject *py_count = NULL;
	PyObject *py_info = NULL;
	PyObject *py_needed = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_count = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.count));
	PyTuple_SetItem(result, 0, py_count);

	if (*r->out.info == NULL) {
		py_info = Py_None;
		Py_INCREF(py_info);
	} else {
		py_info = PyList_New(*r->out.count);
		if (py_info == NULL) {
			return NULL;
		}
		{
			int info_cntr_2;
			for (info_cntr_2 = 0; info_cntr_2 < (*r->out.count); info_cntr_2++) {
				PyObject *py_info_2;
				py_info_2 = pytalloc_reference_ex(&spoolss_PrinterInfo4_Type, *r->out.info, &(*r->out.info)[info_cntr_2]);
				PyList_SetItem(py_info, info_cntr_2, py_info_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_info);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 2, py_needed);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_XcvData_in_get_handle(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_handle;
	if (object->in.handle == NULL) {
		Py_RETURN_NONE;
	}
	py_handle = pytalloc_reference_ex(policy_handle_Type, object->in.handle, object->in.handle);
	return py_handle;
}

static int py_spoolss_XcvData_in_set_handle(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.handle));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.handle");
		return -1;
	}
	object->in.handle = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.handle);
	if (object->in.handle == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.handle = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_XcvData_in_get_function_name(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_function_name;
	if (object->in.function_name == NULL) {
		py_function_name = Py_None;
		Py_INCREF(py_function_name);
	} else {
		py_function_name = PyUnicode_Decode(object->in.function_name, strlen(object->in.function_name), "utf-8", "ignore");
	}
	return py_function_name;
}

static int py_spoolss_XcvData_in_set_function_name(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.function_name");
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.function_name = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_in_get_in_data(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_in_data;
	py_in_data = PyBytes_FromStringAndSize((char *)(object->in.in_data).data, (object->in.in_data).length);
	return py_in_data;
}

static int py_spoolss_XcvData_in_set_in_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.in_data");
		return -1;
	}
	if (!PyBytes_Check(value)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(value)->tp_name);
		return -1;
	}
	object->in.in_data = data_blob_talloc(pytalloc_get_mem_ctx(py_obj), PyBytes_AS_STRING(value), PyBytes_GET_SIZE(value));
	return 0;
}

static PyObject *py_spoolss_XcvData_in_get__in_data_length(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py__in_data_length;
	py__in_data_length = PyLong_FromUnsignedLongLong((uint32_t)(object->in._in_data_length));
	return py__in_data_length;
}

static int py_spoolss_XcvData_in_set__in_data_length(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in._in_data_length");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in._in_data_length));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in._in_data_length = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_out_get_out_data(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_out_data;
	if (object->out.out_data == NULL) {
		Py_RETURN_NONE;
	}
	py_out_data = PyList_New(object->in.out_data_size);
	if (py_out_data == NULL) {
		return NULL;
	}
	{
		int out_data_cntr_1;
		for (out_data_cntr_1 = 0; out_data_cntr_1 < (object->in.out_data_size); out_data_cntr_1++) {
			PyObject *py_out_data_1;
			py_out_data_1 = PyLong_FromLong((uint16_t)((object->out.out_data)[out_data_cntr_1]));
			PyList_SetItem(py_out_data, out_data_cntr_1, py_out_data_1);
		}
	}
	return py_out_data;
}

static int py_spoolss_XcvData_out_set_out_data(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.out_data));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.out_data");
		return -1;
	}
	object->out.out_data = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data);
	if (object->out.out_data == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int out_data_cntr_1;
		object->out.out_data = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.out_data, PyList_GET_SIZE(value));
		if (!object->out.out_data) { return -1; }
		talloc_set_name_const(object->out.out_data, "ARRAY: object->out.out_data");
		for (out_data_cntr_1 = 0; out_data_cntr_1 < PyList_GET_SIZE(value); out_data_cntr_1++) {
			if (PyList_GET_ITEM(value, out_data_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.out_data)[out_data_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->out.out_data)[out_data_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, out_data_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, out_data_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->out.out_data)[out_data_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_in_get_out_data_size(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_out_data_size;
	py_out_data_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.out_data_size));
	return py_out_data_size;
}

static int py_spoolss_XcvData_in_set_out_data_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.out_data_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.out_data_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.out_data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_out_get_needed(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_needed;
	if (object->out.needed == NULL) {
		Py_RETURN_NONE;
	}
	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.needed));
	return py_needed;
}

static int py_spoolss_XcvData_out_set_needed(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.needed));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.needed");
		return -1;
	}
	object->out.needed = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.needed);
	if (object->out.needed == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.needed));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.needed = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_in_get_status_code(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_status_code;
	if (object->in.status_code == NULL) {
		Py_RETURN_NONE;
	}
	py_status_code = PyLong_FromUnsignedLongLong((uint32_t)(*object->in.status_code));
	return py_status_code;
}

static int py_spoolss_XcvData_in_set_status_code(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.status_code));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.status_code");
		return -1;
	}
	object->in.status_code = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.status_code);
	if (object->in.status_code == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->in.status_code));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->in.status_code = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_out_get_status_code(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_status_code;
	if (object->out.status_code == NULL) {
		Py_RETURN_NONE;
	}
	py_status_code = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.status_code));
	return py_status_code;
}

static int py_spoolss_XcvData_out_set_status_code(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.status_code));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.status_code");
		return -1;
	}
	object->out.status_code = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.status_code);
	if (object->out.status_code == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.status_code));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.status_code = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_XcvData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_XcvData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_XcvData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_handle"),
		.get = py_spoolss_XcvData_in_get_handle,
		.set = py_spoolss_XcvData_in_set_handle,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_function_name"),
		.get = py_spoolss_XcvData_in_get_function_name,
		.set = py_spoolss_XcvData_in_set_function_name,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_in_data"),
		.get = py_spoolss_XcvData_in_get_in_data,
		.set = py_spoolss_XcvData_in_set_in_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type DATA_BLOB")
	},
	{
		.name = discard_const_p(char, "in__in_data_length"),
		.get = py_spoolss_XcvData_in_get__in_data_length,
		.set = py_spoolss_XcvData_in_set__in_data_length,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_out_data"),
		.get = py_spoolss_XcvData_out_get_out_data,
		.set = py_spoolss_XcvData_out_set_out_data,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint8")
	},
	{
		.name = discard_const_p(char, "in_out_data_size"),
		.get = py_spoolss_XcvData_in_get_out_data_size,
		.set = py_spoolss_XcvData_in_set_out_data_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_needed"),
		.get = py_spoolss_XcvData_out_get_needed,
		.set = py_spoolss_XcvData_out_set_needed,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_status_code"),
		.get = py_spoolss_XcvData_in_get_status_code,
		.set = py_spoolss_XcvData_in_set_status_code,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_status_code"),
		.get = py_spoolss_XcvData_out_get_status_code,
		.set = py_spoolss_XcvData_out_set_status_code,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_XcvData_get_result,
		.set = py_spoolss_XcvData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_XcvData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_XcvData, type);
	struct spoolss_XcvData *_self = (struct spoolss_XcvData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.handle = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.out_data = talloc_zero(mem_ctx, uint8_t);
	_self->out.needed = talloc_zero(mem_ctx, uint32_t);
	_self->in.status_code = talloc_zero(mem_ctx, uint32_t);
	_self->out.status_code = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_XcvData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(88);
}

static PyObject *py_spoolss_XcvData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 89) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_XcvData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[88];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_XcvData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_XcvData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_XcvData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_XcvData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_XcvData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 89) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_XcvData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[88];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_XcvData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_XcvData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_XcvData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_XcvData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_XcvData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_XcvData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 89) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_XcvData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[88];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_XcvData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_XcvData_ndr_print(py_obj, args, kwargs, "spoolss_XcvData_in", NDR_IN);
}

static PyObject *py_spoolss_XcvData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_XcvData_ndr_print(py_obj, args, kwargs, "spoolss_XcvData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_XcvData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_XcvData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.XcvData.opnum() -> 88 (0x58) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_XcvData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_XcvData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.XcvData",
	.tp_getset = py_spoolss_XcvData_getsetters,
	.tp_methods = py_spoolss_XcvData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_XcvData_new,
};

static bool pack_py_spoolss_XcvData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_XcvData *r)
{
	PyObject *py_handle;
	PyObject *py_function_name;
	PyObject *py_in_data;
	PyObject *py__in_data_length;
	PyObject *py_out_data_size;
	PyObject *py_status_code;
	const char *kwnames[] = {
		"handle", "function_name", "in_data", "_in_data_length", "out_data_size", "status_code", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOO:spoolss_XcvData", discard_const_p(char *, kwnames), &py_handle, &py_function_name, &py_in_data, &py__in_data_length, &py_out_data_size, &py_status_code)) {
		return false;
	}

	if (py_handle == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.handle");
		return false;
	}
	r->in.handle = talloc_ptrtype(r, r->in.handle);
	if (r->in.handle == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_handle, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_handle)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.handle = (struct policy_handle *)pytalloc_get_ptr(py_handle);
	if (py_function_name == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.function_name");
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_function_name)) {
			unicode = PyUnicode_AsEncodedString(py_function_name, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_function_name)) {
			test_str = PyBytes_AS_STRING(py_function_name);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_function_name)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.function_name = talloc_str;
	}
	if (py_in_data == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.in_data");
		return false;
	}
	if (!PyBytes_Check(py_in_data)) {
		PyErr_Format(PyExc_TypeError, "Expected bytes object, got %s", Py_TYPE(py_in_data)->tp_name);
		return false;
	}
	r->in.in_data = data_blob_talloc(r, PyBytes_AS_STRING(py_in_data), PyBytes_GET_SIZE(py_in_data));
	if (py__in_data_length == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in._in_data_length");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in._in_data_length));
		if (PyLong_Check(py__in_data_length)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py__in_data_length);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in._in_data_length = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_out_data_size == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.out_data_size");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.out_data_size));
		if (PyLong_Check(py_out_data_size)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_out_data_size);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.out_data_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_status_code == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.status_code");
		return false;
	}
	r->in.status_code = talloc_ptrtype(r, r->in.status_code);
	if (r->in.status_code == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*r->in.status_code));
		if (PyLong_Check(py_status_code)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_status_code);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			*r->in.status_code = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_XcvData_args_out(struct spoolss_XcvData *r, bool raise_result_exception)
{
	PyObject *py_out_data = NULL;
	PyObject *py_needed = NULL;
	PyObject *py_status_code = NULL;
	PyObject *result = NULL;
	size_t result_size = 3;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_out_data = PyList_New(r->in.out_data_size);
	if (py_out_data == NULL) {
		return NULL;
	}
	{
		int out_data_cntr_1;
		for (out_data_cntr_1 = 0; out_data_cntr_1 < (r->in.out_data_size); out_data_cntr_1++) {
			PyObject *py_out_data_1;
			py_out_data_1 = PyLong_FromLong((uint16_t)((r->out.out_data)[out_data_cntr_1]));
			PyList_SetItem(py_out_data, out_data_cntr_1, py_out_data_1);
		}
	}
	PyTuple_SetItem(result, 0, py_out_data);

	py_needed = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.needed));
	PyTuple_SetItem(result, 1, py_needed);

	py_status_code = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.status_code));
	PyTuple_SetItem(result, 2, py_status_code);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 3, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_AddPrinterDriverEx_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_AddPrinterDriverEx_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrinterDriverEx_in_get_info_ctr(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_info_ctr;
	if (object->in.info_ctr == NULL) {
		Py_RETURN_NONE;
	}
	py_info_ctr = pytalloc_reference_ex(&spoolss_AddDriverInfoCtr_Type, object->in.info_ctr, object->in.info_ctr);
	return py_info_ctr;
}

static int py_spoolss_AddPrinterDriverEx_in_set_info_ctr(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.info_ctr));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.info_ctr");
		return -1;
	}
	object->in.info_ctr = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.info_ctr);
	if (object->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_AddDriverInfoCtr_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.info_ctr = (struct spoolss_AddDriverInfoCtr *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_AddPrinterDriverEx_in_get_flags(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_flags;
	py_flags = PyLong_FromUnsignedLongLong((uint32_t)(object->in.flags));
	return py_flags;
}

static int py_spoolss_AddPrinterDriverEx_in_set_flags(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.flags");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.flags));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_AddPrinterDriverEx_get_result(PyObject *obj, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_AddPrinterDriverEx_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_AddPrinterDriverEx_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_AddPrinterDriverEx_in_get_servername,
		.set = py_spoolss_AddPrinterDriverEx_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_info_ctr"),
		.get = py_spoolss_AddPrinterDriverEx_in_get_info_ctr,
		.set = py_spoolss_AddPrinterDriverEx_in_set_info_ctr,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddDriverInfoCtr")
	},
	{
		.name = discard_const_p(char, "in_flags"),
		.get = py_spoolss_AddPrinterDriverEx_in_get_flags,
		.set = py_spoolss_AddPrinterDriverEx_in_set_flags,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_AddPrinterDriverExFlags")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_AddPrinterDriverEx_get_result,
		.set = py_spoolss_AddPrinterDriverEx_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_AddPrinterDriverEx_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_AddPrinterDriverEx, type);
	struct spoolss_AddPrinterDriverEx *_self = (struct spoolss_AddPrinterDriverEx *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.info_ctr = talloc_zero(mem_ctx, struct spoolss_AddDriverInfoCtr);
	return self;
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(89);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 90) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriverEx_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[89];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterDriverEx_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_AddPrinterDriverEx_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 90) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriverEx_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[89];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterDriverEx_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_AddPrinterDriverEx_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_AddPrinterDriverEx *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 90) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_AddPrinterDriverEx_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[89];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterDriverEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterDriverEx_in", NDR_IN);
}

static PyObject *py_spoolss_AddPrinterDriverEx_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_AddPrinterDriverEx_ndr_print(py_obj, args, kwargs, "spoolss_AddPrinterDriverEx_out", NDR_OUT);
}

static PyMethodDef py_spoolss_AddPrinterDriverEx_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_AddPrinterDriverEx_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.AddPrinterDriverEx.opnum() -> 89 (0x59) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_AddPrinterDriverEx_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_AddPrinterDriverEx_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.AddPrinterDriverEx",
	.tp_getset = py_spoolss_AddPrinterDriverEx_getsetters,
	.tp_methods = py_spoolss_AddPrinterDriverEx_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_AddPrinterDriverEx_new,
};

static bool pack_py_spoolss_AddPrinterDriverEx_args_in(PyObject *args, PyObject *kwargs, struct spoolss_AddPrinterDriverEx *r)
{
	PyObject *py_servername;
	PyObject *py_info_ctr;
	PyObject *py_flags;
	const char *kwnames[] = {
		"servername", "info_ctr", "flags", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_AddPrinterDriverEx", discard_const_p(char *, kwnames), &py_servername, &py_info_ctr, &py_flags)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_info_ctr == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.info_ctr");
		return false;
	}
	r->in.info_ctr = talloc_ptrtype(r, r->in.info_ctr);
	if (r->in.info_ctr == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_AddDriverInfoCtr_Type, py_info_ctr, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_info_ctr)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.info_ctr = (struct spoolss_AddDriverInfoCtr *)pytalloc_get_ptr(py_info_ctr);
	if (py_flags == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.flags");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.flags));
		if (PyLong_Check(py_flags)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_flags);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.flags = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_AddPrinterDriverEx_args_out(struct spoolss_AddPrinterDriverEx *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_SendRecvBidiData_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, pytalloc_get_mem_ctx(obj), &object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_SendRecvBidiData_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = *(struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SendRecvBidiData_in_get_pAction(PyObject *obj, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(obj);
	PyObject *py_pAction;
	if (object->in.pAction == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.pAction == NULL) {
		py_pAction = Py_None;
		Py_INCREF(py_pAction);
	} else {
		if (object->in.pAction == NULL) {
			py_pAction = Py_None;
			Py_INCREF(py_pAction);
		} else {
			py_pAction = PyUnicode_Decode(object->in.pAction, strlen(object->in.pAction), "utf-8", "ignore");
		}
	}
	return py_pAction;
}

static int py_spoolss_SendRecvBidiData_in_set_pAction(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pAction");
		return -1;
	}
	if (value == Py_None) {
		object->in.pAction = NULL;
	} else {
		object->in.pAction = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.pAction = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SendRecvBidiData_in_get_pReqData(PyObject *obj, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(obj);
	PyObject *py_pReqData;
	if (object->in.pReqData == NULL) {
		Py_RETURN_NONE;
	}
	py_pReqData = pytalloc_reference_ex(&RPC_BIDI_REQUEST_CONTAINER_Type, object->in.pReqData, object->in.pReqData);
	return py_pReqData;
}

static int py_spoolss_SendRecvBidiData_in_set_pReqData(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pReqData));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pReqData");
		return -1;
	}
	object->in.pReqData = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pReqData);
	if (object->in.pReqData == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&RPC_BIDI_REQUEST_CONTAINER_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.pReqData = (struct RPC_BIDI_REQUEST_CONTAINER *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SendRecvBidiData_out_get_ppRespData(PyObject *obj, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(obj);
	PyObject *py_ppRespData;
	if (object->out.ppRespData == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.ppRespData == NULL) {
		py_ppRespData = Py_None;
		Py_INCREF(py_ppRespData);
	} else {
		py_ppRespData = pytalloc_reference_ex(&RPC_BIDI_RESPONSE_CONTAINER_Type, *object->out.ppRespData, *object->out.ppRespData);
	}
	return py_ppRespData;
}

static int py_spoolss_SendRecvBidiData_out_set_ppRespData(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ppRespData));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.ppRespData");
		return -1;
	}
	object->out.ppRespData = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ppRespData);
	if (object->out.ppRespData == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.ppRespData = NULL;
	} else {
		*object->out.ppRespData = NULL;
		PY_CHECK_TYPE(&RPC_BIDI_RESPONSE_CONTAINER_Type, value, return -1;);
		if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		*object->out.ppRespData = (struct RPC_BIDI_RESPONSE_CONTAINER *)pytalloc_get_ptr(value);
	}
	return 0;
}

static PyObject *py_spoolss_SendRecvBidiData_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SendRecvBidiData_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SendRecvBidiData_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_SendRecvBidiData_in_get_hPrinter,
		.set = py_spoolss_SendRecvBidiData_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_pAction"),
		.get = py_spoolss_SendRecvBidiData_in_get_pAction,
		.set = py_spoolss_SendRecvBidiData_in_set_pAction,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_pReqData"),
		.get = py_spoolss_SendRecvBidiData_in_get_pReqData,
		.set = py_spoolss_SendRecvBidiData_in_set_pReqData,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_REQUEST_CONTAINER")
	},
	{
		.name = discard_const_p(char, "out_ppRespData"),
		.get = py_spoolss_SendRecvBidiData_out_get_ppRespData,
		.set = py_spoolss_SendRecvBidiData_out_set_ppRespData,
		.doc = discard_const_p(char, "PIDL-generated element of base type RPC_BIDI_RESPONSE_CONTAINER")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SendRecvBidiData_get_result,
		.set = py_spoolss_SendRecvBidiData_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SendRecvBidiData_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SendRecvBidiData, type);
	struct spoolss_SendRecvBidiData *_self = (struct spoolss_SendRecvBidiData *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.pReqData = talloc_zero(mem_ctx, struct RPC_BIDI_REQUEST_CONTAINER);
	/* a pointer to a NULL pointer */
	_self->out.ppRespData = talloc_zero(mem_ctx, struct RPC_BIDI_RESPONSE_CONTAINER *);
	return self;
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(97);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 98) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SendRecvBidiData_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[97];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SendRecvBidiData_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SendRecvBidiData_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 98) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SendRecvBidiData_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[97];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SendRecvBidiData_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SendRecvBidiData_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SendRecvBidiData *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 98) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SendRecvBidiData_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[97];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SendRecvBidiData_ndr_print(py_obj, args, kwargs, "spoolss_SendRecvBidiData_in", NDR_IN);
}

static PyObject *py_spoolss_SendRecvBidiData_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SendRecvBidiData_ndr_print(py_obj, args, kwargs, "spoolss_SendRecvBidiData_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SendRecvBidiData_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SendRecvBidiData_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SendRecvBidiData.opnum() -> 97 (0x61) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SendRecvBidiData_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SendRecvBidiData_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SendRecvBidiData",
	.tp_getset = py_spoolss_SendRecvBidiData_getsetters,
	.tp_methods = py_spoolss_SendRecvBidiData_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SendRecvBidiData_new,
};

static bool pack_py_spoolss_SendRecvBidiData_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SendRecvBidiData *r)
{
	PyObject *py_hPrinter;
	PyObject *py_pAction;
	PyObject *py_pReqData;
	const char *kwnames[] = {
		"hPrinter", "pAction", "pReqData", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_SendRecvBidiData", discard_const_p(char *, kwnames), &py_hPrinter, &py_pAction, &py_pReqData)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = *(struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_pAction == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pAction");
		return false;
	}
	if (py_pAction == Py_None) {
		r->in.pAction = NULL;
	} else {
		r->in.pAction = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_pAction)) {
				unicode = PyUnicode_AsEncodedString(py_pAction, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_pAction)) {
				test_str = PyBytes_AS_STRING(py_pAction);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_pAction)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.pAction = talloc_str;
		}
	}
	if (py_pReqData == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pReqData");
		return false;
	}
	r->in.pReqData = talloc_ptrtype(r, r->in.pReqData);
	if (r->in.pReqData == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&RPC_BIDI_REQUEST_CONTAINER_Type, py_pReqData, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_pReqData)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.pReqData = (struct RPC_BIDI_REQUEST_CONTAINER *)pytalloc_get_ptr(py_pReqData);
	return true;
}

static PyObject *unpack_py_spoolss_SendRecvBidiData_args_out(struct spoolss_SendRecvBidiData *r, bool raise_result_exception)
{
	PyObject *py_ppRespData = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	if (*r->out.ppRespData == NULL) {
		py_ppRespData = Py_None;
		Py_INCREF(py_ppRespData);
	} else {
		py_ppRespData = pytalloc_reference_ex(&RPC_BIDI_RESPONSE_CONTAINER_Type, *r->out.ppRespData, *r->out.ppRespData);
	}
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_ppRespData);
	}
	if (result_size == 1) {
		result = py_ppRespData;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_GetCorePrinterDrivers_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_GetCorePrinterDrivers_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
	}
	return py_architecture;
}

static int py_spoolss_GetCorePrinterDrivers_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	object->in.architecture = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.architecture);
	if (object->in.architecture == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.architecture = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_in_get_core_driver_size(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_core_driver_size;
	py_core_driver_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.core_driver_size));
	return py_core_driver_size;
}

static int py_spoolss_GetCorePrinterDrivers_in_set_core_driver_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.core_driver_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.core_driver_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.core_driver_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_in_get_core_driver_dependencies(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_core_driver_dependencies;
	if (object->in.core_driver_dependencies == NULL) {
		Py_RETURN_NONE;
	}
	py_core_driver_dependencies = PyList_New(object->in.core_driver_size);
	if (py_core_driver_dependencies == NULL) {
		return NULL;
	}
	{
		int core_driver_dependencies_cntr_1;
		for (core_driver_dependencies_cntr_1 = 0; core_driver_dependencies_cntr_1 < (object->in.core_driver_size); core_driver_dependencies_cntr_1++) {
			PyObject *py_core_driver_dependencies_1;
			py_core_driver_dependencies_1 = PyLong_FromLong((uint16_t)((object->in.core_driver_dependencies)[core_driver_dependencies_cntr_1]));
			PyList_SetItem(py_core_driver_dependencies, core_driver_dependencies_cntr_1, py_core_driver_dependencies_1);
		}
	}
	return py_core_driver_dependencies;
}

static int py_spoolss_GetCorePrinterDrivers_in_set_core_driver_dependencies(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.core_driver_dependencies));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.core_driver_dependencies");
		return -1;
	}
	object->in.core_driver_dependencies = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.core_driver_dependencies);
	if (object->in.core_driver_dependencies == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int core_driver_dependencies_cntr_1;
		object->in.core_driver_dependencies = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.core_driver_dependencies, PyList_GET_SIZE(value));
		if (!object->in.core_driver_dependencies) { return -1; }
		talloc_set_name_const(object->in.core_driver_dependencies, "ARRAY: object->in.core_driver_dependencies");
		for (core_driver_dependencies_cntr_1 = 0; core_driver_dependencies_cntr_1 < PyList_GET_SIZE(value); core_driver_dependencies_cntr_1++) {
			if (PyList_GET_ITEM(value, core_driver_dependencies_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->in.core_driver_dependencies)[core_driver_dependencies_cntr_1]");
				return -1;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((object->in.core_driver_dependencies)[core_driver_dependencies_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(value, core_driver_dependencies_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(value, core_driver_dependencies_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return -1;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return -1;
					}
					(object->in.core_driver_dependencies)[core_driver_dependencies_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return -1;
				}
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_in_get_core_printer_driver_count(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_core_printer_driver_count;
	py_core_printer_driver_count = PyLong_FromUnsignedLongLong((uint32_t)(object->in.core_printer_driver_count));
	return py_core_printer_driver_count;
}

static int py_spoolss_GetCorePrinterDrivers_in_set_core_printer_driver_count(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.core_printer_driver_count");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.core_printer_driver_count));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.core_printer_driver_count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_out_get_core_printer_drivers(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_core_printer_drivers;
	if (object->out.core_printer_drivers == NULL) {
		Py_RETURN_NONE;
	}
	py_core_printer_drivers = PyList_New(object->in.core_printer_driver_count);
	if (py_core_printer_drivers == NULL) {
		return NULL;
	}
	{
		int core_printer_drivers_cntr_1;
		for (core_printer_drivers_cntr_1 = 0; core_printer_drivers_cntr_1 < (object->in.core_printer_driver_count); core_printer_drivers_cntr_1++) {
			PyObject *py_core_printer_drivers_1;
			py_core_printer_drivers_1 = pytalloc_reference_ex(&spoolss_CorePrinterDriver_Type, object->out.core_printer_drivers, &(object->out.core_printer_drivers)[core_printer_drivers_cntr_1]);
			PyList_SetItem(py_core_printer_drivers, core_printer_drivers_cntr_1, py_core_printer_drivers_1);
		}
	}
	return py_core_printer_drivers;
}

static int py_spoolss_GetCorePrinterDrivers_out_set_core_printer_drivers(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.core_printer_drivers));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.core_printer_drivers");
		return -1;
	}
	object->out.core_printer_drivers = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.core_printer_drivers);
	if (object->out.core_printer_drivers == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&PyList_Type, value, return -1;);
	{
		int core_printer_drivers_cntr_1;
		object->out.core_printer_drivers = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.core_printer_drivers, PyList_GET_SIZE(value));
		if (!object->out.core_printer_drivers) { return -1; }
		talloc_set_name_const(object->out.core_printer_drivers, "ARRAY: object->out.core_printer_drivers");
		for (core_printer_drivers_cntr_1 = 0; core_printer_drivers_cntr_1 < PyList_GET_SIZE(value); core_printer_drivers_cntr_1++) {
			if (PyList_GET_ITEM(value, core_printer_drivers_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (object->out.core_printer_drivers)[core_printer_drivers_cntr_1]");
				return -1;
			}
			PY_CHECK_TYPE(&spoolss_CorePrinterDriver_Type, PyList_GET_ITEM(value, core_printer_drivers_cntr_1), return -1;);
			if (talloc_reference(object->out.core_printer_drivers, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, core_printer_drivers_cntr_1))) == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			(object->out.core_printer_drivers)[core_printer_drivers_cntr_1] = *(struct spoolss_CorePrinterDriver *)pytalloc_get_ptr(PyList_GET_ITEM(value, core_printer_drivers_cntr_1));
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromHRESULT(object->out.result);
	return py_result;
}

static int py_spoolss_GetCorePrinterDrivers_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = HRES_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetCorePrinterDrivers_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_GetCorePrinterDrivers_in_get_servername,
		.set = py_spoolss_GetCorePrinterDrivers_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_GetCorePrinterDrivers_in_get_architecture,
		.set = py_spoolss_GetCorePrinterDrivers_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_core_driver_size"),
		.get = py_spoolss_GetCorePrinterDrivers_in_get_core_driver_size,
		.set = py_spoolss_GetCorePrinterDrivers_in_set_core_driver_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_core_driver_dependencies"),
		.get = py_spoolss_GetCorePrinterDrivers_in_get_core_driver_dependencies,
		.set = py_spoolss_GetCorePrinterDrivers_in_set_core_driver_dependencies,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_core_printer_driver_count"),
		.get = py_spoolss_GetCorePrinterDrivers_in_get_core_printer_driver_count,
		.set = py_spoolss_GetCorePrinterDrivers_in_set_core_printer_driver_count,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_core_printer_drivers"),
		.get = py_spoolss_GetCorePrinterDrivers_out_get_core_printer_drivers,
		.set = py_spoolss_GetCorePrinterDrivers_out_set_core_printer_drivers,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_CorePrinterDriver")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetCorePrinterDrivers_get_result,
		.set = py_spoolss_GetCorePrinterDrivers_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type HRESULT")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetCorePrinterDrivers_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetCorePrinterDrivers, type);
	struct spoolss_GetCorePrinterDrivers *_self = (struct spoolss_GetCorePrinterDrivers *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.core_driver_dependencies = talloc_zero(mem_ctx, uint16_t);
	_self->out.core_printer_drivers = talloc_zero(mem_ctx, struct spoolss_CorePrinterDriver);
	return self;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(102);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 103) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetCorePrinterDrivers_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[102];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetCorePrinterDrivers_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetCorePrinterDrivers_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 103) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetCorePrinterDrivers_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[102];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetCorePrinterDrivers_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetCorePrinterDrivers_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetCorePrinterDrivers *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 103) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetCorePrinterDrivers_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[102];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetCorePrinterDrivers_ndr_print(py_obj, args, kwargs, "spoolss_GetCorePrinterDrivers_in", NDR_IN);
}

static PyObject *py_spoolss_GetCorePrinterDrivers_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetCorePrinterDrivers_ndr_print(py_obj, args, kwargs, "spoolss_GetCorePrinterDrivers_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetCorePrinterDrivers_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetCorePrinterDrivers_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetCorePrinterDrivers.opnum() -> 102 (0x66) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetCorePrinterDrivers_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetCorePrinterDrivers_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetCorePrinterDrivers",
	.tp_getset = py_spoolss_GetCorePrinterDrivers_getsetters,
	.tp_methods = py_spoolss_GetCorePrinterDrivers_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetCorePrinterDrivers_new,
};

static bool pack_py_spoolss_GetCorePrinterDrivers_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetCorePrinterDrivers *r)
{
	PyObject *py_servername;
	PyObject *py_architecture;
	PyObject *py_core_driver_dependencies;
	PyObject *py_core_printer_driver_count;
	const char *kwnames[] = {
		"servername", "architecture", "core_driver_dependencies", "core_printer_driver_count", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOO:spoolss_GetCorePrinterDrivers", discard_const_p(char *, kwnames), &py_servername, &py_architecture, &py_core_driver_dependencies, &py_core_printer_driver_count)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	r->in.architecture = talloc_ptrtype(r, r->in.architecture);
	if (r->in.architecture == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_architecture)) {
			unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_architecture)) {
			test_str = PyBytes_AS_STRING(py_architecture);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.architecture = talloc_str;
	}
	PY_CHECK_TYPE(&PyList_Type, py_core_driver_dependencies, return false;);
	r->in.core_driver_size = PyList_GET_SIZE(py_core_driver_dependencies);
	if (py_core_driver_dependencies == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.core_driver_dependencies");
		return false;
	}
	r->in.core_driver_dependencies = talloc_ptrtype(r, r->in.core_driver_dependencies);
	if (r->in.core_driver_dependencies == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&PyList_Type, py_core_driver_dependencies, return false;);
	{
		int core_driver_dependencies_cntr_1;
		r->in.core_driver_dependencies = talloc_array_ptrtype(r, r->in.core_driver_dependencies, PyList_GET_SIZE(py_core_driver_dependencies));
		if (!r->in.core_driver_dependencies) { return false; }
		talloc_set_name_const(r->in.core_driver_dependencies, "ARRAY: r->in.core_driver_dependencies");
		for (core_driver_dependencies_cntr_1 = 0; core_driver_dependencies_cntr_1 < PyList_GET_SIZE(py_core_driver_dependencies); core_driver_dependencies_cntr_1++) {
			if (PyList_GET_ITEM(py_core_driver_dependencies, core_driver_dependencies_cntr_1) == NULL) {
				PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (r->in.core_driver_dependencies)[core_driver_dependencies_cntr_1]");
				return false;
			}
			{
				const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof((r->in.core_driver_dependencies)[core_driver_dependencies_cntr_1]));
				if (PyLong_Check(PyList_GET_ITEM(py_core_driver_dependencies, core_driver_dependencies_cntr_1))) {
					unsigned long long test_var;
					test_var = PyLong_AsUnsignedLongLong(PyList_GET_ITEM(py_core_driver_dependencies, core_driver_dependencies_cntr_1));
					if (PyErr_Occurred() != NULL) {
						return false;
					}
					if (test_var > uint_max) {
						PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
						  PyLong_Type.tp_name, uint_max, test_var);
						return false;
					}
					(r->in.core_driver_dependencies)[core_driver_dependencies_cntr_1] = test_var;
				} else {
					PyErr_Format(PyExc_TypeError, "Expected type %s",
					  PyLong_Type.tp_name);
					return false;
				}
			}
		}
	}
	if (py_core_printer_driver_count == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.core_printer_driver_count");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.core_printer_driver_count));
		if (PyLong_Check(py_core_printer_driver_count)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_core_printer_driver_count);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.core_printer_driver_count = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetCorePrinterDrivers_args_out(struct spoolss_GetCorePrinterDrivers *r, bool raise_result_exception)
{
	PyObject *py_core_printer_drivers = NULL;
	PyObject *result = NULL;

	result = PyTuple_New(2);
	if (result == NULL) {
		return NULL;
	}

	py_core_printer_drivers = PyList_New(r->in.core_printer_driver_count);
	if (py_core_printer_drivers == NULL) {
		return NULL;
	}
	{
		int core_printer_drivers_cntr_1;
		for (core_printer_drivers_cntr_1 = 0; core_printer_drivers_cntr_1 < (r->in.core_printer_driver_count); core_printer_drivers_cntr_1++) {
			PyObject *py_core_printer_drivers_1;
			py_core_printer_drivers_1 = pytalloc_reference_ex(&spoolss_CorePrinterDriver_Type, r->out.core_printer_drivers, &(r->out.core_printer_drivers)[core_printer_drivers_cntr_1]);
			PyList_SetItem(py_core_printer_drivers, core_printer_drivers_cntr_1, py_core_printer_drivers_1);
		}
	}
	PyTuple_SetItem(result, 0, py_core_printer_drivers);

	PyTuple_SetItem(result, 1, PyErr_FromHRESULT(r->out.result));

	return result;
}


static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_servername(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_servername;
	if (object->in.servername == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.servername == NULL) {
		py_servername = Py_None;
		Py_INCREF(py_servername);
	} else {
		if (object->in.servername == NULL) {
			py_servername = Py_None;
			Py_INCREF(py_servername);
		} else {
			py_servername = PyUnicode_Decode(object->in.servername, strlen(object->in.servername), "utf-8", "ignore");
		}
	}
	return py_servername;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_servername(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.servername");
		return -1;
	}
	if (value == Py_None) {
		object->in.servername = NULL;
	} else {
		object->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.servername = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_architecture(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_architecture;
	if (object->in.architecture == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.architecture == NULL) {
		py_architecture = Py_None;
		Py_INCREF(py_architecture);
	} else {
		py_architecture = PyUnicode_Decode(object->in.architecture, strlen(object->in.architecture), "utf-8", "ignore");
	}
	return py_architecture;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_architecture(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.architecture");
		return -1;
	}
	object->in.architecture = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.architecture);
	if (object->in.architecture == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.architecture = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_language(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_language;
	if (object->in.language == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.language == NULL) {
		py_language = Py_None;
		Py_INCREF(py_language);
	} else {
		if (object->in.language == NULL) {
			py_language = Py_None;
			Py_INCREF(py_language);
		} else {
			py_language = PyUnicode_Decode(object->in.language, strlen(object->in.language), "utf-8", "ignore");
		}
	}
	return py_language;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_language(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.language");
		return -1;
	}
	if (value == Py_None) {
		object->in.language = NULL;
	} else {
		object->in.language = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.language = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_package_id(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_package_id;
	if (object->in.package_id == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.package_id == NULL) {
		py_package_id = Py_None;
		Py_INCREF(py_package_id);
	} else {
		py_package_id = PyUnicode_Decode(object->in.package_id, strlen(object->in.package_id), "utf-8", "ignore");
	}
	return py_package_id;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_package_id(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.package_id");
		return -1;
	}
	object->in.package_id = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.package_id);
	if (object->in.package_id == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.package_id = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_driver_package_cab(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_package_cab;
	if (object->in.driver_package_cab == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.driver_package_cab == NULL) {
		py_driver_package_cab = Py_None;
		Py_INCREF(py_driver_package_cab);
	} else {
		if (object->in.driver_package_cab == NULL) {
			py_driver_package_cab = Py_None;
			Py_INCREF(py_driver_package_cab);
		} else {
			py_driver_package_cab = PyUnicode_Decode(object->in.driver_package_cab, strlen(object->in.driver_package_cab), "utf-8", "ignore");
		}
	}
	return py_driver_package_cab;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_driver_package_cab(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.driver_package_cab");
		return -1;
	}
	if (value == Py_None) {
		object->in.driver_package_cab = NULL;
	} else {
		object->in.driver_package_cab = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->in.driver_package_cab = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_out_get_driver_package_cab(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_package_cab;
	if (object->out.driver_package_cab == NULL) {
		Py_RETURN_NONE;
	}
	if (object->out.driver_package_cab == NULL) {
		py_driver_package_cab = Py_None;
		Py_INCREF(py_driver_package_cab);
	} else {
		if (object->out.driver_package_cab == NULL) {
			py_driver_package_cab = Py_None;
			Py_INCREF(py_driver_package_cab);
		} else {
			py_driver_package_cab = PyUnicode_Decode(object->out.driver_package_cab, strlen(object->out.driver_package_cab), "utf-8", "ignore");
		}
	}
	return py_driver_package_cab;
}

static int py_spoolss_GetPrinterDriverPackagePath_out_set_driver_package_cab(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.driver_package_cab");
		return -1;
	}
	if (value == Py_None) {
		object->out.driver_package_cab = NULL;
	} else {
		object->out.driver_package_cab = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(value)) {
				unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
				if (unicode == NULL) {
					return -1;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(value)) {
				test_str = PyBytes_AS_STRING(value);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
				return -1;
			}
			talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return -1;
			}
			object->out.driver_package_cab = talloc_str;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_in_get_driver_package_cab_size(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_driver_package_cab_size;
	py_driver_package_cab_size = PyLong_FromUnsignedLongLong((uint32_t)(object->in.driver_package_cab_size));
	return py_driver_package_cab_size;
}

static int py_spoolss_GetPrinterDriverPackagePath_in_set_driver_package_cab_size(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.driver_package_cab_size");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.driver_package_cab_size));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.driver_package_cab_size = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_out_get_required(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_required;
	if (object->out.required == NULL) {
		Py_RETURN_NONE;
	}
	py_required = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.required));
	return py_required;
}

static int py_spoolss_GetPrinterDriverPackagePath_out_set_required(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.required));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.required");
		return -1;
	}
	object->out.required = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.required);
	if (object->out.required == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.required));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.required = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromHRESULT(object->out.result);
	return py_result;
}

static int py_spoolss_GetPrinterDriverPackagePath_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = HRES_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetPrinterDriverPackagePath_getsetters[] = {
	{
		.name = discard_const_p(char, "in_servername"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_servername,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_servername,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_architecture"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_architecture,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_architecture,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_language"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_language,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_language,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_package_id"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_package_id,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_package_id,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_driver_package_cab"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_driver_package_cab,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_driver_package_cab,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "out_driver_package_cab"),
		.get = py_spoolss_GetPrinterDriverPackagePath_out_get_driver_package_cab,
		.set = py_spoolss_GetPrinterDriverPackagePath_out_set_driver_package_cab,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "in_driver_package_cab_size"),
		.get = py_spoolss_GetPrinterDriverPackagePath_in_get_driver_package_cab_size,
		.set = py_spoolss_GetPrinterDriverPackagePath_in_set_driver_package_cab_size,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_required"),
		.get = py_spoolss_GetPrinterDriverPackagePath_out_get_required,
		.set = py_spoolss_GetPrinterDriverPackagePath_out_set_required,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetPrinterDriverPackagePath_get_result,
		.set = py_spoolss_GetPrinterDriverPackagePath_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type HRESULT")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetPrinterDriverPackagePath_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetPrinterDriverPackagePath, type);
	struct spoolss_GetPrinterDriverPackagePath *_self = (struct spoolss_GetPrinterDriverPackagePath *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->out.required = talloc_zero(mem_ctx, uint32_t);
	return self;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(104);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 105) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverPackagePath_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[104];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriverPackagePath_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetPrinterDriverPackagePath_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 105) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverPackagePath_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[104];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriverPackagePath_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetPrinterDriverPackagePath_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetPrinterDriverPackagePath *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 105) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetPrinterDriverPackagePath_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[104];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriverPackagePath_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriverPackagePath_in", NDR_IN);
}

static PyObject *py_spoolss_GetPrinterDriverPackagePath_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetPrinterDriverPackagePath_ndr_print(py_obj, args, kwargs, "spoolss_GetPrinterDriverPackagePath_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetPrinterDriverPackagePath_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetPrinterDriverPackagePath_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetPrinterDriverPackagePath.opnum() -> 104 (0x68) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetPrinterDriverPackagePath_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetPrinterDriverPackagePath_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetPrinterDriverPackagePath",
	.tp_getset = py_spoolss_GetPrinterDriverPackagePath_getsetters,
	.tp_methods = py_spoolss_GetPrinterDriverPackagePath_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetPrinterDriverPackagePath_new,
};

static bool pack_py_spoolss_GetPrinterDriverPackagePath_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetPrinterDriverPackagePath *r)
{
	PyObject *py_servername;
	PyObject *py_architecture;
	PyObject *py_language;
	PyObject *py_package_id;
	PyObject *py_driver_package_cab;
	const char *kwnames[] = {
		"servername", "architecture", "language", "package_id", "driver_package_cab", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOO:spoolss_GetPrinterDriverPackagePath", discard_const_p(char *, kwnames), &py_servername, &py_architecture, &py_language, &py_package_id, &py_driver_package_cab)) {
		return false;
	}

	if (py_servername == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.servername");
		return false;
	}
	if (py_servername == Py_None) {
		r->in.servername = NULL;
	} else {
		r->in.servername = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_servername)) {
				unicode = PyUnicode_AsEncodedString(py_servername, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_servername)) {
				test_str = PyBytes_AS_STRING(py_servername);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_servername)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.servername = talloc_str;
		}
	}
	if (py_architecture == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.architecture");
		return false;
	}
	r->in.architecture = talloc_ptrtype(r, r->in.architecture);
	if (r->in.architecture == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_architecture)) {
			unicode = PyUnicode_AsEncodedString(py_architecture, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_architecture)) {
			test_str = PyBytes_AS_STRING(py_architecture);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_architecture)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.architecture = talloc_str;
	}
	if (py_language == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.language");
		return false;
	}
	if (py_language == Py_None) {
		r->in.language = NULL;
	} else {
		r->in.language = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_language)) {
				unicode = PyUnicode_AsEncodedString(py_language, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_language)) {
				test_str = PyBytes_AS_STRING(py_language);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_language)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.language = talloc_str;
		}
	}
	if (py_package_id == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.package_id");
		return false;
	}
	r->in.package_id = talloc_ptrtype(r, r->in.package_id);
	if (r->in.package_id == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_package_id)) {
			unicode = PyUnicode_AsEncodedString(py_package_id, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_package_id)) {
			test_str = PyBytes_AS_STRING(py_package_id);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_package_id)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.package_id = talloc_str;
	}
	if (py_driver_package_cab == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.driver_package_cab");
		return false;
	}
	if (py_driver_package_cab == Py_None) {
		r->in.driver_package_cab = NULL;
	} else {
		r->in.driver_package_cab = NULL;
		{
			const char *test_str;
			const char *talloc_str;
			PyObject *unicode = NULL;
			if (PyUnicode_Check(py_driver_package_cab)) {
				unicode = PyUnicode_AsEncodedString(py_driver_package_cab, "utf-8", "ignore");
				if (unicode == NULL) {
					return false;
				}
				test_str = PyBytes_AS_STRING(unicode);
			} else if (PyBytes_Check(py_driver_package_cab)) {
				test_str = PyBytes_AS_STRING(py_driver_package_cab);
			} else {
				PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_driver_package_cab)->tp_name);
				return false;
			}
			talloc_str = talloc_strdup(r, test_str);
			if (unicode != NULL) {
				Py_DECREF(unicode);
			}
			if (talloc_str == NULL) {
				PyErr_NoMemory();
				return false;
			}
			r->in.driver_package_cab = talloc_str;
		}
	}
	PY_CHECK_TYPE(&PyList_Type, py_driver_package_cab, return false;);
	r->in.driver_package_cab_size = PyList_GET_SIZE(py_driver_package_cab);
	return true;
}

static PyObject *unpack_py_spoolss_GetPrinterDriverPackagePath_args_out(struct spoolss_GetPrinterDriverPackagePath *r, bool raise_result_exception)
{
	PyObject *py_driver_package_cab = NULL;
	PyObject *py_required = NULL;
	PyObject *result = NULL;

	result = PyTuple_New(3);
	if (result == NULL) {
		return NULL;
	}

	if (r->out.driver_package_cab == NULL) {
		py_driver_package_cab = Py_None;
		Py_INCREF(py_driver_package_cab);
	} else {
		if (r->out.driver_package_cab == NULL) {
			py_driver_package_cab = Py_None;
			Py_INCREF(py_driver_package_cab);
		} else {
			py_driver_package_cab = PyUnicode_Decode(r->out.driver_package_cab, strlen(r->out.driver_package_cab), "utf-8", "ignore");
		}
	}
	PyTuple_SetItem(result, 0, py_driver_package_cab);

	py_required = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.required));
	PyTuple_SetItem(result, 1, py_required);

	PyTuple_SetItem(result, 2, PyErr_FromHRESULT(r->out.result));

	return result;
}


static PyObject *py_spoolss_GetJobNamedPropertyValue_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	if (object->in.hPrinter == NULL) {
		Py_RETURN_NONE;
	}
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, object->in.hPrinter, object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_GetJobNamedPropertyValue_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hPrinter));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	object->in.hPrinter = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.hPrinter);
	if (object->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_in_get_JobId(PyObject *obj, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_JobId;
	py_JobId = PyLong_FromUnsignedLongLong((uint32_t)(object->in.JobId));
	return py_JobId;
}

static int py_spoolss_GetJobNamedPropertyValue_in_set_JobId(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.JobId");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.JobId));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_in_get_pszName(PyObject *obj, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_pszName;
	if (object->in.pszName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.pszName == NULL) {
		py_pszName = Py_None;
		Py_INCREF(py_pszName);
	} else {
		py_pszName = PyUnicode_Decode(object->in.pszName, strlen(object->in.pszName), "utf-8", "ignore");
	}
	return py_pszName;
}

static int py_spoolss_GetJobNamedPropertyValue_in_set_pszName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pszName");
		return -1;
	}
	object->in.pszName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pszName);
	if (object->in.pszName == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.pszName = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_out_get_pValue(PyObject *obj, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_pValue;
	if (object->out.pValue == NULL) {
		Py_RETURN_NONE;
	}
	py_pValue = pytalloc_reference_ex(&spoolss_PrintPropertyValue_Type, object->out.pValue, object->out.pValue);
	return py_pValue;
}

static int py_spoolss_GetJobNamedPropertyValue_out_set_pValue(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pValue));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.pValue");
		return -1;
	}
	object->out.pValue = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pValue);
	if (object->out.pValue == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_PrintPropertyValue_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->out.pValue = (struct spoolss_PrintPropertyValue *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_get_result(PyObject *obj, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_GetJobNamedPropertyValue_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_GetJobNamedPropertyValue_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_GetJobNamedPropertyValue_in_get_hPrinter,
		.set = py_spoolss_GetJobNamedPropertyValue_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_JobId"),
		.get = py_spoolss_GetJobNamedPropertyValue_in_get_JobId,
		.set = py_spoolss_GetJobNamedPropertyValue_in_set_JobId,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_pszName"),
		.get = py_spoolss_GetJobNamedPropertyValue_in_get_pszName,
		.set = py_spoolss_GetJobNamedPropertyValue_in_set_pszName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "out_pValue"),
		.get = py_spoolss_GetJobNamedPropertyValue_out_get_pValue,
		.set = py_spoolss_GetJobNamedPropertyValue_out_set_pValue,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintPropertyValue")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_GetJobNamedPropertyValue_get_result,
		.set = py_spoolss_GetJobNamedPropertyValue_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_GetJobNamedPropertyValue_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_GetJobNamedPropertyValue, type);
	struct spoolss_GetJobNamedPropertyValue *_self = (struct spoolss_GetJobNamedPropertyValue *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.hPrinter = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.pValue = talloc_zero(mem_ctx, struct spoolss_PrintPropertyValue);
	return self;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(110);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 111) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJobNamedPropertyValue_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[110];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetJobNamedPropertyValue_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_GetJobNamedPropertyValue_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 111) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJobNamedPropertyValue_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[110];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetJobNamedPropertyValue_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_GetJobNamedPropertyValue_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_GetJobNamedPropertyValue *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 111) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_GetJobNamedPropertyValue_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[110];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetJobNamedPropertyValue_ndr_print(py_obj, args, kwargs, "spoolss_GetJobNamedPropertyValue_in", NDR_IN);
}

static PyObject *py_spoolss_GetJobNamedPropertyValue_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_GetJobNamedPropertyValue_ndr_print(py_obj, args, kwargs, "spoolss_GetJobNamedPropertyValue_out", NDR_OUT);
}

static PyMethodDef py_spoolss_GetJobNamedPropertyValue_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_GetJobNamedPropertyValue_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.GetJobNamedPropertyValue.opnum() -> 110 (0x6e) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_GetJobNamedPropertyValue_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_GetJobNamedPropertyValue_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.GetJobNamedPropertyValue",
	.tp_getset = py_spoolss_GetJobNamedPropertyValue_getsetters,
	.tp_methods = py_spoolss_GetJobNamedPropertyValue_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_GetJobNamedPropertyValue_new,
};

static bool pack_py_spoolss_GetJobNamedPropertyValue_args_in(PyObject *args, PyObject *kwargs, struct spoolss_GetJobNamedPropertyValue *r)
{
	PyObject *py_hPrinter;
	PyObject *py_JobId;
	PyObject *py_pszName;
	const char *kwnames[] = {
		"hPrinter", "JobId", "pszName", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_GetJobNamedPropertyValue", discard_const_p(char *, kwnames), &py_hPrinter, &py_JobId, &py_pszName)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	r->in.hPrinter = talloc_ptrtype(r, r->in.hPrinter);
	if (r->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_JobId == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.JobId");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.JobId));
		if (PyLong_Check(py_JobId)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_JobId);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_pszName == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pszName");
		return false;
	}
	r->in.pszName = talloc_ptrtype(r, r->in.pszName);
	if (r->in.pszName == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_pszName)) {
			unicode = PyUnicode_AsEncodedString(py_pszName, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_pszName)) {
			test_str = PyBytes_AS_STRING(py_pszName);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_pszName)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.pszName = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_GetJobNamedPropertyValue_args_out(struct spoolss_GetJobNamedPropertyValue *r, bool raise_result_exception)
{
	PyObject *py_pValue = NULL;
	PyObject *result = NULL;
	size_t result_size = 1;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_pValue = pytalloc_reference_ex(&spoolss_PrintPropertyValue_Type, r->out.pValue, r->out.pValue);
	if (result_size > 1) {
		PyTuple_SetItem(result, 0, py_pValue);
	}
	if (result_size == 1) {
		result = py_pValue;
	}

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 1, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_SetJobNamedProperty_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	if (object->in.hPrinter == NULL) {
		Py_RETURN_NONE;
	}
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, object->in.hPrinter, object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_SetJobNamedProperty_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hPrinter));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	object->in.hPrinter = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.hPrinter);
	if (object->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetJobNamedProperty_in_get_JobId(PyObject *obj, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_JobId;
	py_JobId = PyLong_FromUnsignedLongLong((uint32_t)(object->in.JobId));
	return py_JobId;
}

static int py_spoolss_SetJobNamedProperty_in_set_JobId(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.JobId");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.JobId));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_SetJobNamedProperty_in_get_pProperty(PyObject *obj, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_pProperty;
	if (object->in.pProperty == NULL) {
		Py_RETURN_NONE;
	}
	py_pProperty = pytalloc_reference_ex(&spoolss_PrintNamedProperty_Type, object->in.pProperty, object->in.pProperty);
	return py_pProperty;
}

static int py_spoolss_SetJobNamedProperty_in_set_pProperty(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pProperty));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pProperty");
		return -1;
	}
	object->in.pProperty = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pProperty);
	if (object->in.pProperty == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_PrintNamedProperty_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.pProperty = (struct spoolss_PrintNamedProperty *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_SetJobNamedProperty_get_result(PyObject *obj, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_SetJobNamedProperty_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_SetJobNamedProperty_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_SetJobNamedProperty_in_get_hPrinter,
		.set = py_spoolss_SetJobNamedProperty_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_JobId"),
		.get = py_spoolss_SetJobNamedProperty_in_get_JobId,
		.set = py_spoolss_SetJobNamedProperty_in_set_JobId,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_pProperty"),
		.get = py_spoolss_SetJobNamedProperty_in_get_pProperty,
		.set = py_spoolss_SetJobNamedProperty_in_set_pProperty,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintNamedProperty")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_SetJobNamedProperty_get_result,
		.set = py_spoolss_SetJobNamedProperty_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_SetJobNamedProperty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_SetJobNamedProperty, type);
	struct spoolss_SetJobNamedProperty *_self = (struct spoolss_SetJobNamedProperty *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.hPrinter = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.pProperty = talloc_zero(mem_ctx, struct spoolss_PrintNamedProperty);
	return self;
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(111);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 112) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJobNamedProperty_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[111];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetJobNamedProperty_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_SetJobNamedProperty_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 112) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJobNamedProperty_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[111];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetJobNamedProperty_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_SetJobNamedProperty_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_SetJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 112) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_SetJobNamedProperty_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[111];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetJobNamedProperty_ndr_print(py_obj, args, kwargs, "spoolss_SetJobNamedProperty_in", NDR_IN);
}

static PyObject *py_spoolss_SetJobNamedProperty_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_SetJobNamedProperty_ndr_print(py_obj, args, kwargs, "spoolss_SetJobNamedProperty_out", NDR_OUT);
}

static PyMethodDef py_spoolss_SetJobNamedProperty_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_SetJobNamedProperty_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.SetJobNamedProperty.opnum() -> 111 (0x6f) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_SetJobNamedProperty_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_SetJobNamedProperty_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.SetJobNamedProperty",
	.tp_getset = py_spoolss_SetJobNamedProperty_getsetters,
	.tp_methods = py_spoolss_SetJobNamedProperty_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_SetJobNamedProperty_new,
};

static bool pack_py_spoolss_SetJobNamedProperty_args_in(PyObject *args, PyObject *kwargs, struct spoolss_SetJobNamedProperty *r)
{
	PyObject *py_hPrinter;
	PyObject *py_JobId;
	PyObject *py_pProperty;
	const char *kwnames[] = {
		"hPrinter", "JobId", "pProperty", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_SetJobNamedProperty", discard_const_p(char *, kwnames), &py_hPrinter, &py_JobId, &py_pProperty)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	r->in.hPrinter = talloc_ptrtype(r, r->in.hPrinter);
	if (r->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_JobId == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.JobId");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.JobId));
		if (PyLong_Check(py_JobId)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_JobId);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_pProperty == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pProperty");
		return false;
	}
	r->in.pProperty = talloc_ptrtype(r, r->in.pProperty);
	if (r->in.pProperty == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_PrintNamedProperty_Type, py_pProperty, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_pProperty)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.pProperty = (struct spoolss_PrintNamedProperty *)pytalloc_get_ptr(py_pProperty);
	return true;
}

static PyObject *unpack_py_spoolss_SetJobNamedProperty_args_out(struct spoolss_SetJobNamedProperty *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_DeleteJobNamedProperty_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	if (object->in.hPrinter == NULL) {
		Py_RETURN_NONE;
	}
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, object->in.hPrinter, object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_DeleteJobNamedProperty_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hPrinter));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	object->in.hPrinter = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.hPrinter);
	if (object->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_in_get_JobId(PyObject *obj, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_JobId;
	py_JobId = PyLong_FromUnsignedLongLong((uint32_t)(object->in.JobId));
	return py_JobId;
}

static int py_spoolss_DeleteJobNamedProperty_in_set_JobId(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.JobId");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.JobId));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_in_get_pszName(PyObject *obj, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_pszName;
	if (object->in.pszName == NULL) {
		Py_RETURN_NONE;
	}
	if (object->in.pszName == NULL) {
		py_pszName = Py_None;
		Py_INCREF(py_pszName);
	} else {
		py_pszName = PyUnicode_Decode(object->in.pszName, strlen(object->in.pszName), "utf-8", "ignore");
	}
	return py_pszName;
}

static int py_spoolss_DeleteJobNamedProperty_in_set_pszName(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pszName");
		return -1;
	}
	object->in.pszName = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pszName);
	if (object->in.pszName == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(value)) {
			unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
			if (unicode == NULL) {
				return -1;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(value)) {
			test_str = PyBytes_AS_STRING(value);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
			return -1;
		}
		talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return -1;
		}
		object->in.pszName = talloc_str;
	}
	return 0;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_get_result(PyObject *obj, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_DeleteJobNamedProperty_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_DeleteJobNamedProperty_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_DeleteJobNamedProperty_in_get_hPrinter,
		.set = py_spoolss_DeleteJobNamedProperty_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_JobId"),
		.get = py_spoolss_DeleteJobNamedProperty_in_get_JobId,
		.set = py_spoolss_DeleteJobNamedProperty_in_set_JobId,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "in_pszName"),
		.get = py_spoolss_DeleteJobNamedProperty_in_get_pszName,
		.set = py_spoolss_DeleteJobNamedProperty_in_set_pszName,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint16")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_DeleteJobNamedProperty_get_result,
		.set = py_spoolss_DeleteJobNamedProperty_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_DeleteJobNamedProperty_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_DeleteJobNamedProperty, type);
	struct spoolss_DeleteJobNamedProperty *_self = (struct spoolss_DeleteJobNamedProperty *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.hPrinter = talloc_zero(mem_ctx, struct policy_handle);
	return self;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(112);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 113) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteJobNamedProperty_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[112];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeleteJobNamedProperty_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_DeleteJobNamedProperty_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 113) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteJobNamedProperty_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[112];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeleteJobNamedProperty_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_DeleteJobNamedProperty_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_DeleteJobNamedProperty *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 113) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_DeleteJobNamedProperty_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[112];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeleteJobNamedProperty_ndr_print(py_obj, args, kwargs, "spoolss_DeleteJobNamedProperty_in", NDR_IN);
}

static PyObject *py_spoolss_DeleteJobNamedProperty_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_DeleteJobNamedProperty_ndr_print(py_obj, args, kwargs, "spoolss_DeleteJobNamedProperty_out", NDR_OUT);
}

static PyMethodDef py_spoolss_DeleteJobNamedProperty_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_DeleteJobNamedProperty_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.DeleteJobNamedProperty.opnum() -> 112 (0x70) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_DeleteJobNamedProperty_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_DeleteJobNamedProperty_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.DeleteJobNamedProperty",
	.tp_getset = py_spoolss_DeleteJobNamedProperty_getsetters,
	.tp_methods = py_spoolss_DeleteJobNamedProperty_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_DeleteJobNamedProperty_new,
};

static bool pack_py_spoolss_DeleteJobNamedProperty_args_in(PyObject *args, PyObject *kwargs, struct spoolss_DeleteJobNamedProperty *r)
{
	PyObject *py_hPrinter;
	PyObject *py_JobId;
	PyObject *py_pszName;
	const char *kwnames[] = {
		"hPrinter", "JobId", "pszName", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOO:spoolss_DeleteJobNamedProperty", discard_const_p(char *, kwnames), &py_hPrinter, &py_JobId, &py_pszName)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	r->in.hPrinter = talloc_ptrtype(r, r->in.hPrinter);
	if (r->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_JobId == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.JobId");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.JobId));
		if (PyLong_Check(py_JobId)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_JobId);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	if (py_pszName == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pszName");
		return false;
	}
	r->in.pszName = talloc_ptrtype(r, r->in.pszName);
	if (r->in.pszName == NULL) {
		PyErr_NoMemory();
		return false;
	}
	{
		const char *test_str;
		const char *talloc_str;
		PyObject *unicode = NULL;
		if (PyUnicode_Check(py_pszName)) {
			unicode = PyUnicode_AsEncodedString(py_pszName, "utf-8", "ignore");
			if (unicode == NULL) {
				return false;
			}
			test_str = PyBytes_AS_STRING(unicode);
		} else if (PyBytes_Check(py_pszName)) {
			test_str = PyBytes_AS_STRING(py_pszName);
		} else {
			PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_pszName)->tp_name);
			return false;
		}
		talloc_str = talloc_strdup(r, test_str);
		if (unicode != NULL) {
			Py_DECREF(unicode);
		}
		if (talloc_str == NULL) {
			PyErr_NoMemory();
			return false;
		}
		r->in.pszName = talloc_str;
	}
	return true;
}

static PyObject *unpack_py_spoolss_DeleteJobNamedProperty_args_out(struct spoolss_DeleteJobNamedProperty *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}


static PyObject *py_spoolss_EnumJobNamedProperties_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	if (object->in.hPrinter == NULL) {
		Py_RETURN_NONE;
	}
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, object->in.hPrinter, object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_EnumJobNamedProperties_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hPrinter));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	object->in.hPrinter = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.hPrinter);
	if (object->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_EnumJobNamedProperties_in_get_JobId(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(obj);
	PyObject *py_JobId;
	py_JobId = PyLong_FromUnsignedLongLong((uint32_t)(object->in.JobId));
	return py_JobId;
}

static int py_spoolss_EnumJobNamedProperties_in_set_JobId(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.JobId");
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->in.JobId));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			object->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobNamedProperties_out_get_pcProperties(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(obj);
	PyObject *py_pcProperties;
	if (object->out.pcProperties == NULL) {
		Py_RETURN_NONE;
	}
	py_pcProperties = PyLong_FromUnsignedLongLong((uint32_t)(*object->out.pcProperties));
	return py_pcProperties;
}

static int py_spoolss_EnumJobNamedProperties_out_set_pcProperties(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.pcProperties));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.pcProperties");
		return -1;
	}
	object->out.pcProperties = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.pcProperties);
	if (object->out.pcProperties == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(*object->out.pcProperties));
		if (PyLong_Check(value)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(value);
			if (PyErr_Occurred() != NULL) {
				return -1;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return -1;
			}
			*object->out.pcProperties = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return -1;
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobNamedProperties_out_get_ppProperties(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(obj);
	PyObject *py_ppProperties;
	if (object->out.ppProperties == NULL) {
		Py_RETURN_NONE;
	}
	if (*object->out.ppProperties == NULL) {
		py_ppProperties = Py_None;
		Py_INCREF(py_ppProperties);
	} else {
		py_ppProperties = PyList_New(*object->out.pcProperties);
		if (py_ppProperties == NULL) {
			return NULL;
		}
		{
			int ppProperties_cntr_2;
			for (ppProperties_cntr_2 = 0; ppProperties_cntr_2 < (*object->out.pcProperties); ppProperties_cntr_2++) {
				PyObject *py_ppProperties_2;
				py_ppProperties_2 = pytalloc_reference_ex(&spoolss_PrintNamedProperty_Type, *object->out.ppProperties, &(*object->out.ppProperties)[ppProperties_cntr_2]);
				PyList_SetItem(py_ppProperties, ppProperties_cntr_2, py_ppProperties_2);
			}
		}
	}
	return py_ppProperties;
}

static int py_spoolss_EnumJobNamedProperties_out_set_ppProperties(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->out.ppProperties));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.ppProperties");
		return -1;
	}
	object->out.ppProperties = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->out.ppProperties);
	if (object->out.ppProperties == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	if (value == Py_None) {
		*object->out.ppProperties = NULL;
	} else {
		*object->out.ppProperties = NULL;
		PY_CHECK_TYPE(&PyList_Type, value, return -1;);
		{
			int ppProperties_cntr_2;
			*object->out.ppProperties = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), *object->out.ppProperties, PyList_GET_SIZE(value));
			if (!*object->out.ppProperties) { return -1; }
			talloc_set_name_const(*object->out.ppProperties, "ARRAY: *object->out.ppProperties");
			for (ppProperties_cntr_2 = 0; ppProperties_cntr_2 < PyList_GET_SIZE(value); ppProperties_cntr_2++) {
				if (PyList_GET_ITEM(value, ppProperties_cntr_2) == NULL) {
					PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: (*object->out.ppProperties)[ppProperties_cntr_2]");
					return -1;
				}
				PY_CHECK_TYPE(&spoolss_PrintNamedProperty_Type, PyList_GET_ITEM(value, ppProperties_cntr_2), return -1;);
				if (talloc_reference(*object->out.ppProperties, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, ppProperties_cntr_2))) == NULL) {
					PyErr_NoMemory();
					return -1;
				}
				(*object->out.ppProperties)[ppProperties_cntr_2] = *(struct spoolss_PrintNamedProperty *)pytalloc_get_ptr(PyList_GET_ITEM(value, ppProperties_cntr_2));
			}
		}
	}
	return 0;
}

static PyObject *py_spoolss_EnumJobNamedProperties_get_result(PyObject *obj, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_EnumJobNamedProperties_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_EnumJobNamedProperties_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_EnumJobNamedProperties_in_get_hPrinter,
		.set = py_spoolss_EnumJobNamedProperties_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_JobId"),
		.get = py_spoolss_EnumJobNamedProperties_in_get_JobId,
		.set = py_spoolss_EnumJobNamedProperties_in_set_JobId,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_pcProperties"),
		.get = py_spoolss_EnumJobNamedProperties_out_get_pcProperties,
		.set = py_spoolss_EnumJobNamedProperties_out_set_pcProperties,
		.doc = discard_const_p(char, "PIDL-generated element of base type uint32")
	},
	{
		.name = discard_const_p(char, "out_ppProperties"),
		.get = py_spoolss_EnumJobNamedProperties_out_get_ppProperties,
		.set = py_spoolss_EnumJobNamedProperties_out_set_ppProperties,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_PrintNamedProperty")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_EnumJobNamedProperties_get_result,
		.set = py_spoolss_EnumJobNamedProperties_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_EnumJobNamedProperties_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_EnumJobNamedProperties, type);
	struct spoolss_EnumJobNamedProperties *_self = (struct spoolss_EnumJobNamedProperties *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.hPrinter = talloc_zero(mem_ctx, struct policy_handle);
	_self->out.pcProperties = talloc_zero(mem_ctx, uint32_t);
	/* a pointer to a NULL pointer */
	_self->out.ppProperties = talloc_zero(mem_ctx, struct spoolss_PrintNamedProperty *);
	return self;
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(113);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 114) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobNamedProperties_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[113];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumJobNamedProperties_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_EnumJobNamedProperties_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 114) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobNamedProperties_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[113];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumJobNamedProperties_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_EnumJobNamedProperties_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_EnumJobNamedProperties *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 114) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_EnumJobNamedProperties_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[113];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumJobNamedProperties_ndr_print(py_obj, args, kwargs, "spoolss_EnumJobNamedProperties_in", NDR_IN);
}

static PyObject *py_spoolss_EnumJobNamedProperties_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_EnumJobNamedProperties_ndr_print(py_obj, args, kwargs, "spoolss_EnumJobNamedProperties_out", NDR_OUT);
}

static PyMethodDef py_spoolss_EnumJobNamedProperties_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_EnumJobNamedProperties_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.EnumJobNamedProperties.opnum() -> 113 (0x71) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_EnumJobNamedProperties_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_EnumJobNamedProperties_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.EnumJobNamedProperties",
	.tp_getset = py_spoolss_EnumJobNamedProperties_getsetters,
	.tp_methods = py_spoolss_EnumJobNamedProperties_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_EnumJobNamedProperties_new,
};

static bool pack_py_spoolss_EnumJobNamedProperties_args_in(PyObject *args, PyObject *kwargs, struct spoolss_EnumJobNamedProperties *r)
{
	PyObject *py_hPrinter;
	PyObject *py_JobId;
	const char *kwnames[] = {
		"hPrinter", "JobId", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_EnumJobNamedProperties", discard_const_p(char *, kwnames), &py_hPrinter, &py_JobId)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	r->in.hPrinter = talloc_ptrtype(r, r->in.hPrinter);
	if (r->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_JobId == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.JobId");
		return false;
	}
	{
		const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(r->in.JobId));
		if (PyLong_Check(py_JobId)) {
			unsigned long long test_var;
			test_var = PyLong_AsUnsignedLongLong(py_JobId);
			if (PyErr_Occurred() != NULL) {
				return false;
			}
			if (test_var > uint_max) {
				PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",
				  PyLong_Type.tp_name, uint_max, test_var);
				return false;
			}
			r->in.JobId = test_var;
		} else {
			PyErr_Format(PyExc_TypeError, "Expected type %s",
			  PyLong_Type.tp_name);
			return false;
		}
	}
	return true;
}

static PyObject *unpack_py_spoolss_EnumJobNamedProperties_args_out(struct spoolss_EnumJobNamedProperties *r, bool raise_result_exception)
{
	PyObject *py_pcProperties = NULL;
	PyObject *py_ppProperties = NULL;
	PyObject *result = NULL;
	size_t result_size = 2;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (result_size > 1) {
		result = PyTuple_New(result_size);
		if (result == NULL) {
			return NULL;
		}
	}

	py_pcProperties = PyLong_FromUnsignedLongLong((uint32_t)(*r->out.pcProperties));
	PyTuple_SetItem(result, 0, py_pcProperties);

	if (*r->out.ppProperties == NULL) {
		py_ppProperties = Py_None;
		Py_INCREF(py_ppProperties);
	} else {
		py_ppProperties = PyList_New(*r->out.pcProperties);
		if (py_ppProperties == NULL) {
			return NULL;
		}
		{
			int ppProperties_cntr_2;
			for (ppProperties_cntr_2 = 0; ppProperties_cntr_2 < (*r->out.pcProperties); ppProperties_cntr_2++) {
				PyObject *py_ppProperties_2;
				py_ppProperties_2 = pytalloc_reference_ex(&spoolss_PrintNamedProperty_Type, *r->out.ppProperties, &(*r->out.ppProperties)[ppProperties_cntr_2]);
				PyList_SetItem(py_ppProperties, ppProperties_cntr_2, py_ppProperties_2);
			}
		}
	}
	PyTuple_SetItem(result, 1, py_ppProperties);

	if (!raise_result_exception) {
		PyTuple_SetItem(result, 2, PyErr_FromWERROR(r->out.result));
	}

	return result;
}


static PyObject *py_spoolss_LogJobInfoForBranchOffice_in_get_hPrinter(PyObject *obj, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(obj);
	PyObject *py_hPrinter;
	if (object->in.hPrinter == NULL) {
		Py_RETURN_NONE;
	}
	py_hPrinter = pytalloc_reference_ex(policy_handle_Type, object->in.hPrinter, object->in.hPrinter);
	return py_hPrinter;
}

static int py_spoolss_LogJobInfoForBranchOffice_in_set_hPrinter(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.hPrinter));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.hPrinter");
		return -1;
	}
	object->in.hPrinter = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.hPrinter);
	if (object->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(policy_handle_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_in_get_pBranchOfficeJobDataContainer(PyObject *obj, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(obj);
	PyObject *py_pBranchOfficeJobDataContainer;
	if (object->in.pBranchOfficeJobDataContainer == NULL) {
		Py_RETURN_NONE;
	}
	py_pBranchOfficeJobDataContainer = pytalloc_reference_ex(&spoolss_BranchOfficeJobDataContainer_Type, object->in.pBranchOfficeJobDataContainer, object->in.pBranchOfficeJobDataContainer);
	return py_pBranchOfficeJobDataContainer;
}

static int py_spoolss_LogJobInfoForBranchOffice_in_set_pBranchOfficeJobDataContainer(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->in.pBranchOfficeJobDataContainer));
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->in.pBranchOfficeJobDataContainer");
		return -1;
	}
	object->in.pBranchOfficeJobDataContainer = talloc_ptrtype(pytalloc_get_mem_ctx(py_obj), object->in.pBranchOfficeJobDataContainer);
	if (object->in.pBranchOfficeJobDataContainer == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataContainer_Type, value, return -1;);
	if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
		PyErr_NoMemory();
		return -1;
	}
	object->in.pBranchOfficeJobDataContainer = (struct spoolss_BranchOfficeJobDataContainer *)pytalloc_get_ptr(value);
	return 0;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_get_result(PyObject *obj, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(obj);
	PyObject *py_result;
	py_result = PyErr_FromWERROR(object->out.result);
	return py_result;
}

static int py_spoolss_LogJobInfoForBranchOffice_set_result(PyObject *py_obj, PyObject *value, void *closure)
{
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	if (value == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: object->out.result");
		return -1;
	}
	object->out.result = W_ERROR(PyLong_AsLong(value));
	return 0;
}

static PyGetSetDef py_spoolss_LogJobInfoForBranchOffice_getsetters[] = {
	{
		.name = discard_const_p(char, "in_hPrinter"),
		.get = py_spoolss_LogJobInfoForBranchOffice_in_get_hPrinter,
		.set = py_spoolss_LogJobInfoForBranchOffice_in_set_hPrinter,
		.doc = discard_const_p(char, "PIDL-generated element of base type policy_handle")
	},
	{
		.name = discard_const_p(char, "in_pBranchOfficeJobDataContainer"),
		.get = py_spoolss_LogJobInfoForBranchOffice_in_get_pBranchOfficeJobDataContainer,
		.set = py_spoolss_LogJobInfoForBranchOffice_in_set_pBranchOfficeJobDataContainer,
		.doc = discard_const_p(char, "PIDL-generated element of base type spoolss_BranchOfficeJobDataContainer")
	},
	{
		.name = discard_const_p(char, "result"),
		.get = py_spoolss_LogJobInfoForBranchOffice_get_result,
		.set = py_spoolss_LogJobInfoForBranchOffice_set_result,
		.doc = discard_const_p(char, "PIDL-generated element of type WERROR")
	},
	{ .name = NULL }
};

static PyObject *py_spoolss_LogJobInfoForBranchOffice_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	PyObject *self = pytalloc_new(struct spoolss_LogJobInfoForBranchOffice, type);
	struct spoolss_LogJobInfoForBranchOffice *_self = (struct spoolss_LogJobInfoForBranchOffice *)pytalloc_get_ptr(self);
	TALLOC_CTX *mem_ctx = pytalloc_get_mem_ctx(self);
	_self->in.hPrinter = talloc_zero(mem_ctx, struct policy_handle);
	_self->in.pBranchOfficeJobDataContainer = talloc_zero(mem_ctx, struct spoolss_BranchOfficeJobDataContainer);
	return self;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_opnum(PyTypeObject *type, PyObject *Py_UNUSED(ignored))
{


	return PyLong_FromLong(116);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_pack(PyObject *py_obj, ndr_flags_type ndr_inout_flags, libndr_flags ndr_push_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	PyObject *ret = NULL;
	struct ndr_push *push = NULL;
	DATA_BLOB blob;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 117) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_LogJobInfoForBranchOffice_ndr_pack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[116];

	push = ndr_push_init_ctx(pytalloc_get_mem_ctx(py_obj));
	if (push == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	push->flags |= ndr_push_flags;

	err = call->ndr_push(push, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(push);
		PyErr_SetNdrError(err);
		return NULL;
	}
	blob = ndr_push_blob(push);
	ret = PyBytes_FromStringAndSize((char *)blob.data, blob.length);
	TALLOC_FREE(push);
	return ret;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_pack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_in__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_LogJobInfoForBranchOffice_ndr_pack(py_obj, NDR_IN, ndr_push_flags);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_pack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	const char * const kwnames[] = { "bigendian", "ndr64", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_push_flags = 0;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OO:__ndr_pack_out__",
		discard_const_p(char *, kwnames),
		&bigendian_obj,
		&ndr64_obj)) {
		return NULL;
	}

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_push_flags |= LIBNDR_FLAG_NDR64;
	}

	return py_spoolss_LogJobInfoForBranchOffice_ndr_pack(py_obj, NDR_OUT, ndr_push_flags);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_unpack(PyObject *py_obj, const DATA_BLOB *blob, ndr_flags_type ndr_inout_flags, libndr_flags ndr_pull_flags, bool allow_remaining)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	struct ndr_pull *pull = NULL;
	enum ndr_err_code err;

	if (ndr_table_spoolss.num_calls < 117) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_LogJobInfoForBranchOffice_ndr_unpack");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[116];

	pull = ndr_pull_init_blob(blob, object);
	if (pull == NULL) {
		PyErr_SetNdrError(NDR_ERR_ALLOC);
		return NULL;
	}

	pull->flags |= ndr_pull_flags;

	err = call->ndr_pull(pull, ndr_inout_flags, object);
	if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
		TALLOC_FREE(pull);
		PyErr_SetNdrError(err);
		return NULL;
	}
	if (!allow_remaining) {
		uint32_t highest_ofs;

		if (pull->offset > pull->relative_highest_offset) {
			highest_ofs = pull->offset;
		} else {
			highest_ofs = pull->relative_highest_offset;
		}
		if (highest_ofs < pull->data_size) {
			err = ndr_pull_error(pull, NDR_ERR_UNREAD_BYTES,
				"not all bytes consumed ofs[%u] size[%u]",
				highest_ofs, pull->data_size);
			TALLOC_FREE(pull);
			PyErr_SetNdrError(err);
			return NULL;
		}
	}

	TALLOC_FREE(pull);
	Py_RETURN_NONE;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_unpack_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_in__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_LogJobInfoForBranchOffice_ndr_unpack(py_obj, &blob, NDR_IN, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_unpack_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	DATA_BLOB blob;
	Py_ssize_t blob_length = 0;
	const char * const kwnames[] = { "data_blob", "bigendian", "ndr64", "allow_remaining", NULL };
	PyObject *bigendian_obj = NULL;
	PyObject *ndr64_obj = NULL;
	libndr_flags ndr_pull_flags = LIBNDR_FLAG_REF_ALLOC;
	PyObject *allow_remaining_obj = NULL;
	bool allow_remaining = false;

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, PYARG_BYTES_LEN "|OOO:__ndr_unpack_out__",
		discard_const_p(char *, kwnames),
		&blob.data, &blob_length,
		&bigendian_obj,
		&ndr64_obj,
		&allow_remaining_obj)) {
		return NULL;
	}
	blob.length = blob_length;

	if (bigendian_obj && PyObject_IsTrue(bigendian_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_BIGENDIAN;
	}
	if (ndr64_obj && PyObject_IsTrue(ndr64_obj)) {
		ndr_pull_flags |= LIBNDR_FLAG_NDR64;
	}

	if (allow_remaining_obj && PyObject_IsTrue(allow_remaining_obj)) {
		allow_remaining = true;
	}

	return py_spoolss_LogJobInfoForBranchOffice_ndr_unpack(py_obj, &blob, NDR_OUT, ndr_pull_flags, allow_remaining);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_print(PyObject *py_obj, PyObject *args, PyObject *kwargs, const char *name, ndr_flags_type ndr_inout_flags)
{
	const struct ndr_interface_call *call = NULL;
	struct spoolss_LogJobInfoForBranchOffice *object = pytalloc_get_ptr(py_obj);
	const char * const kwnames[] = { "print_secrets", NULL };
	PyObject *py_print_secrets = NULL;
	PyObject *ret;
	char *retstr;
	bool ok;

	ok = PyArg_ParseTupleAndKeywords(args, kwargs, "|O:__ndr_print__",
		discard_const_p(char *, kwnames),
		&py_print_secrets);
	if (!ok) {
		return NULL;
	}

	if (ndr_table_spoolss.num_calls < 117) {
		PyErr_SetString(PyExc_TypeError, "Internal Error, ndr_interface_call missing for py_spoolss_LogJobInfoForBranchOffice_ndr_print");
		return NULL;
	}
	call = &ndr_table_spoolss.calls[116];

	if (py_print_secrets != NULL && PyObject_IsTrue(py_print_secrets)) {
		retstr = ndr_print_function_secret_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	} else {
		retstr = ndr_print_function_string(pytalloc_get_mem_ctx(py_obj), call->ndr_print, name, ndr_inout_flags, object);
	}
	ret = PyUnicode_FromString(retstr);
	TALLOC_FREE(retstr);

	return ret;
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_print_in(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_LogJobInfoForBranchOffice_ndr_print(py_obj, args, kwargs, "spoolss_LogJobInfoForBranchOffice_in", NDR_IN);
}

static PyObject *py_spoolss_LogJobInfoForBranchOffice_ndr_print_out(PyObject *py_obj, PyObject *args, PyObject *kwargs)
{
	return py_spoolss_LogJobInfoForBranchOffice_ndr_print(py_obj, args, kwargs, "spoolss_LogJobInfoForBranchOffice_out", NDR_OUT);
}

static PyMethodDef py_spoolss_LogJobInfoForBranchOffice_methods[] = {
	{ "opnum", (PyCFunction)py_spoolss_LogJobInfoForBranchOffice_ndr_opnum, METH_NOARGS|METH_CLASS,
		"spoolss.LogJobInfoForBranchOffice.opnum() -> 116 (0x74) " },
	{ "__ndr_pack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_pack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_in(object, bigendian=False, ndr64=False) -> blob\nNDR pack input" },
	{ "__ndr_pack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_pack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_pack_out(object, bigendian=False, ndr64=False) -> blob\nNDR pack output" },
	{ "__ndr_unpack_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_unpack_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_in(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack input" },
	{ "__ndr_unpack_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_unpack_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_unpack_out(class, blob, bigendian=False, ndr64=False, allow_remaining=False) -> None\nNDR unpack output" },
	{ "__ndr_print_in__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_print_in), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_in(object, print_secrets=False) -> String\nNDR print input" },
	{ "__ndr_print_out__", PY_DISCARD_FUNC_SIG(PyCFunction,py_spoolss_LogJobInfoForBranchOffice_ndr_print_out), METH_VARARGS|METH_KEYWORDS,
		"S.ndr_print_out(object, print_secrets=False) -> String\nNDR print output" },
	{ NULL, NULL, 0, NULL }
};


static PyTypeObject spoolss_LogJobInfoForBranchOffice_Type = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.LogJobInfoForBranchOffice",
	.tp_getset = py_spoolss_LogJobInfoForBranchOffice_getsetters,
	.tp_methods = py_spoolss_LogJobInfoForBranchOffice_methods,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = py_spoolss_LogJobInfoForBranchOffice_new,
};

static bool pack_py_spoolss_LogJobInfoForBranchOffice_args_in(PyObject *args, PyObject *kwargs, struct spoolss_LogJobInfoForBranchOffice *r)
{
	PyObject *py_hPrinter;
	PyObject *py_pBranchOfficeJobDataContainer;
	const char *kwnames[] = {
		"hPrinter", "pBranchOfficeJobDataContainer", NULL
	};

	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO:spoolss_LogJobInfoForBranchOffice", discard_const_p(char *, kwnames), &py_hPrinter, &py_pBranchOfficeJobDataContainer)) {
		return false;
	}

	if (py_hPrinter == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.hPrinter");
		return false;
	}
	r->in.hPrinter = talloc_ptrtype(r, r->in.hPrinter);
	if (r->in.hPrinter == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(policy_handle_Type, py_hPrinter, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_hPrinter)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.hPrinter = (struct policy_handle *)pytalloc_get_ptr(py_hPrinter);
	if (py_pBranchOfficeJobDataContainer == NULL) {
		PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: r->in.pBranchOfficeJobDataContainer");
		return false;
	}
	r->in.pBranchOfficeJobDataContainer = talloc_ptrtype(r, r->in.pBranchOfficeJobDataContainer);
	if (r->in.pBranchOfficeJobDataContainer == NULL) {
		PyErr_NoMemory();
		return false;
	}
	PY_CHECK_TYPE(&spoolss_BranchOfficeJobDataContainer_Type, py_pBranchOfficeJobDataContainer, return false;);
	if (talloc_reference(r, pytalloc_get_mem_ctx(py_pBranchOfficeJobDataContainer)) == NULL) {
		PyErr_NoMemory();
		return false;
	}
	r->in.pBranchOfficeJobDataContainer = (struct spoolss_BranchOfficeJobDataContainer *)pytalloc_get_ptr(py_pBranchOfficeJobDataContainer);
	return true;
}

static PyObject *unpack_py_spoolss_LogJobInfoForBranchOffice_args_out(struct spoolss_LogJobInfoForBranchOffice *r, bool raise_result_exception)
{
	PyObject *result = NULL;
	size_t result_size = 0;

	if (raise_result_exception) {
		if (!W_ERROR_IS_OK(r->out.result)) {
			PyErr_SetWERROR(r->out.result);
			return NULL;
		}

	} else {
		/* WERROR will be part of the results */
		result_size += 1;
	}

	if (!raise_result_exception) {
		result = PyErr_FromWERROR(r->out.result);
	}

	if (result_size == 0) {
		result = Py_None;
		Py_INCREF(result);
	}

	return result;
}

const struct PyNdrRpcMethodDef py_ndr_spoolss_methods[] = {
	{
		.name = "EnumPrinters",
		.doc = "S.EnumPrinters(flags, server, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrinters_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrinters_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrinters_args_out,
		.opnum = 0,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "OpenPrinter",
		.doc = "S.OpenPrinter(printername, datatype, devmode_ctr, access_mask) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_OpenPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_OpenPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_OpenPrinter_args_out,
		.opnum = 1,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetJob",
		.doc = "S.SetJob(handle, job_id, ctr, command) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetJob_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetJob_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetJob_args_out,
		.opnum = 2,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetJob",
		.doc = "S.GetJob(handle, job_id, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetJob_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetJob_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetJob_args_out,
		.opnum = 3,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumJobs",
		.doc = "S.EnumJobs(handle, firstjob, numjobs, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumJobs_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumJobs_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumJobs_args_out,
		.opnum = 4,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPrinter",
		.doc = "S.AddPrinter(server, info_ctr, devmode_ctr, secdesc_ctr) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPrinter_args_out,
		.opnum = 5,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinter",
		.doc = "S.DeletePrinter(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinter_args_out,
		.opnum = 6,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetPrinter",
		.doc = "S.SetPrinter(handle, info_ctr, devmode_ctr, secdesc_ctr, command) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetPrinter_args_out,
		.opnum = 7,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinter",
		.doc = "S.GetPrinter(handle, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinter_args_out,
		.opnum = 8,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPrinterDriver",
		.doc = "S.AddPrinterDriver(servername, info_ctr) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPrinterDriver_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPrinterDriver_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPrinterDriver_args_out,
		.opnum = 9,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrinterDrivers",
		.doc = "S.EnumPrinterDrivers(server, environment, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrinterDrivers_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrinterDrivers_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrinterDrivers_args_out,
		.opnum = 10,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterDriver",
		.doc = "S.GetPrinterDriver(handle, architecture, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterDriver_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterDriver_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterDriver_args_out,
		.opnum = 11,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterDriverDirectory",
		.doc = "S.GetPrinterDriverDirectory(server, environment, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterDriverDirectory_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterDriverDirectory_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterDriverDirectory_args_out,
		.opnum = 12,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterDriver",
		.doc = "S.DeletePrinterDriver(server, architecture, driver) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterDriver_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterDriver_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterDriver_args_out,
		.opnum = 13,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPrintProcessor",
		.doc = "S.AddPrintProcessor(server, architecture, path_name, print_processor_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPrintProcessor_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPrintProcessor_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPrintProcessor_args_out,
		.opnum = 14,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrintProcessors",
		.doc = "S.EnumPrintProcessors(servername, environment, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrintProcessors_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrintProcessors_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrintProcessors_args_out,
		.opnum = 15,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrintProcessorDirectory",
		.doc = "S.GetPrintProcessorDirectory(server, environment, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrintProcessorDirectory_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrintProcessorDirectory_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrintProcessorDirectory_args_out,
		.opnum = 16,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "StartDocPrinter",
		.doc = "S.StartDocPrinter(handle, info_ctr) -> job_id",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_StartDocPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_StartDocPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_StartDocPrinter_args_out,
		.opnum = 17,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "StartPagePrinter",
		.doc = "S.StartPagePrinter(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_StartPagePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_StartPagePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_StartPagePrinter_args_out,
		.opnum = 18,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "WritePrinter",
		.doc = "S.WritePrinter(handle, data, _data_size) -> num_written",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_WritePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_WritePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_WritePrinter_args_out,
		.opnum = 19,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EndPagePrinter",
		.doc = "S.EndPagePrinter(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EndPagePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EndPagePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EndPagePrinter_args_out,
		.opnum = 20,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AbortPrinter",
		.doc = "S.AbortPrinter(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AbortPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AbortPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AbortPrinter_args_out,
		.opnum = 21,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ReadPrinter",
		.doc = "S.ReadPrinter(handle, data_size) -> (data, _data_size)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ReadPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ReadPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ReadPrinter_args_out,
		.opnum = 22,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EndDocPrinter",
		.doc = "S.EndDocPrinter(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EndDocPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EndDocPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EndDocPrinter_args_out,
		.opnum = 23,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddJob",
		.doc = "S.AddJob(handle, level, buffer) -> (buffer, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddJob_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddJob_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddJob_args_out,
		.opnum = 24,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ScheduleJob",
		.doc = "S.ScheduleJob(handle, jobid) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ScheduleJob_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ScheduleJob_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ScheduleJob_args_out,
		.opnum = 25,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterData",
		.doc = "S.GetPrinterData(handle, value_name, offered) -> (type, data, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterData_args_out,
		.opnum = 26,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetPrinterData",
		.doc = "S.SetPrinterData(handle, value_name, type, data) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetPrinterData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetPrinterData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetPrinterData_args_out,
		.opnum = 27,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ClosePrinter",
		.doc = "S.ClosePrinter(handle) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ClosePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ClosePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ClosePrinter_args_out,
		.opnum = 29,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddForm",
		.doc = "S.AddForm(handle, info_ctr) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddForm_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddForm_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddForm_args_out,
		.opnum = 30,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeleteForm",
		.doc = "S.DeleteForm(handle, form_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeleteForm_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeleteForm_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeleteForm_args_out,
		.opnum = 31,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetForm",
		.doc = "S.GetForm(handle, form_name, level, buffer, offered) -> (info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetForm_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetForm_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetForm_args_out,
		.opnum = 32,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetForm",
		.doc = "S.SetForm(handle, form_name, info_ctr) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetForm_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetForm_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetForm_args_out,
		.opnum = 33,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumForms",
		.doc = "S.EnumForms(handle, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumForms_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumForms_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumForms_args_out,
		.opnum = 34,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPorts",
		.doc = "S.EnumPorts(servername, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPorts_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPorts_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPorts_args_out,
		.opnum = 35,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumMonitors",
		.doc = "S.EnumMonitors(servername, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumMonitors_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumMonitors_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumMonitors_args_out,
		.opnum = 36,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPort",
		.doc = "S.AddPort(server_name, unknown, monitor_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPort_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPort_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPort_args_out,
		.opnum = 37,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePort",
		.doc = "S.DeletePort(server_name, ptr, port_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePort_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePort_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePort_args_out,
		.opnum = 39,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "CreatePrinterIC",
		.doc = "S.CreatePrinterIC(handle, devmode_ctr) -> gdi_handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_CreatePrinterIC_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_CreatePrinterIC_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_CreatePrinterIC_args_out,
		.opnum = 40,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "PlayGDIScriptOnPrinterIC",
		.doc = "S.PlayGDIScriptOnPrinterIC(gdi_handle, pIn, cOut, ul) -> pOut",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_PlayGDIScriptOnPrinterIC_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_PlayGDIScriptOnPrinterIC_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_PlayGDIScriptOnPrinterIC_args_out,
		.opnum = 41,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterIC",
		.doc = "S.DeletePrinterIC(gdi_handle) -> gdi_handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterIC_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterIC_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterIC_args_out,
		.opnum = 42,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrintProcessor",
		.doc = "S.DeletePrintProcessor(server, architecture, print_processor_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrintProcessor_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrintProcessor_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrintProcessor_args_out,
		.opnum = 48,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrintProcessorDataTypes",
		.doc = "S.EnumPrintProcessorDataTypes(servername, print_processor_name, level, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrintProcessorDataTypes_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrintProcessorDataTypes_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrintProcessorDataTypes_args_out,
		.opnum = 51,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ResetPrinter",
		.doc = "S.ResetPrinter(handle, data_type, devmode_ctr) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ResetPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ResetPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ResetPrinter_args_out,
		.opnum = 52,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterDriver2",
		.doc = "S.GetPrinterDriver2(handle, architecture, level, buffer, offered, client_major_version, client_minor_version) -> (info, needed, server_major_version, server_minor_version)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterDriver2_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterDriver2_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterDriver2_args_out,
		.opnum = 53,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "FindClosePrinterNotify",
		.doc = "S.FindClosePrinterNotify(handle) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_FindClosePrinterNotify_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_FindClosePrinterNotify_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_FindClosePrinterNotify_args_out,
		.opnum = 56,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ReplyOpenPrinter",
		.doc = "S.ReplyOpenPrinter(server_name, printer_local, type, buffer) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ReplyOpenPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ReplyOpenPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ReplyOpenPrinter_args_out,
		.opnum = 58,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "RouterReplyPrinter",
		.doc = "S.RouterReplyPrinter(handle, flags, buffer) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_RouterReplyPrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_RouterReplyPrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_RouterReplyPrinter_args_out,
		.opnum = 59,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "ReplyClosePrinter",
		.doc = "S.ReplyClosePrinter(handle) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_ReplyClosePrinter_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_ReplyClosePrinter_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_ReplyClosePrinter_args_out,
		.opnum = 60,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPortEx",
		.doc = "S.AddPortEx(servername, port_ctr, port_var_ctr, monitor_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPortEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPortEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPortEx_args_out,
		.opnum = 61,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "RemoteFindFirstPrinterChangeNotifyEx",
		.doc = "S.RemoteFindFirstPrinterChangeNotifyEx(handle, flags, options, local_machine, printer_local, notify_options) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_RemoteFindFirstPrinterChangeNotifyEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_RemoteFindFirstPrinterChangeNotifyEx_args_out,
		.opnum = 65,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "RouterReplyPrinterEx",
		.doc = "S.RouterReplyPrinterEx(handle, color, flags, reply_type, info) -> reply_result",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_RouterReplyPrinterEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_RouterReplyPrinterEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_RouterReplyPrinterEx_args_out,
		.opnum = 66,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "RouterRefreshPrinterChangeNotify",
		.doc = "S.RouterRefreshPrinterChangeNotify(handle, change_low, options) -> info",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_RouterRefreshPrinterChangeNotify_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_RouterRefreshPrinterChangeNotify_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_RouterRefreshPrinterChangeNotify_args_out,
		.opnum = 67,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "OpenPrinterEx",
		.doc = "S.OpenPrinterEx(printername, datatype, devmode_ctr, access_mask, userlevel_ctr) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_OpenPrinterEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_OpenPrinterEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_OpenPrinterEx_args_out,
		.opnum = 69,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPrinterEx",
		.doc = "S.AddPrinterEx(server, info_ctr, devmode_ctr, secdesc_ctr, userlevel_ctr) -> handle",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPrinterEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPrinterEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPrinterEx_args_out,
		.opnum = 70,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetPort",
		.doc = "S.SetPort(servername, port_name, port_ctr) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetPort_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetPort_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetPort_args_out,
		.opnum = 71,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrinterData",
		.doc = "S.EnumPrinterData(handle, enum_index, value_offered, data_offered) -> (value_name, value_needed, type, data, data_needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrinterData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrinterData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrinterData_args_out,
		.opnum = 72,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterData",
		.doc = "S.DeletePrinterData(handle, value_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterData_args_out,
		.opnum = 73,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetPrinterDataEx",
		.doc = "S.SetPrinterDataEx(handle, key_name, value_name, type, data) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetPrinterDataEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetPrinterDataEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetPrinterDataEx_args_out,
		.opnum = 77,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterDataEx",
		.doc = "S.GetPrinterDataEx(handle, key_name, value_name, offered) -> (type, data, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterDataEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterDataEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterDataEx_args_out,
		.opnum = 78,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrinterDataEx",
		.doc = "S.EnumPrinterDataEx(handle, key_name, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrinterDataEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrinterDataEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrinterDataEx_args_out,
		.opnum = 79,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPrinterKey",
		.doc = "S.EnumPrinterKey(handle, key_name, offered) -> (_ndr_size, key_buffer, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPrinterKey_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPrinterKey_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPrinterKey_args_out,
		.opnum = 80,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterDataEx",
		.doc = "S.DeletePrinterDataEx(handle, key_name, value_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterDataEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterDataEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterDataEx_args_out,
		.opnum = 81,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterKey",
		.doc = "S.DeletePrinterKey(handle, key_name) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterKey_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterKey_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterKey_args_out,
		.opnum = 82,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePrinterDriverEx",
		.doc = "S.DeletePrinterDriverEx(server, architecture, driver, delete_flags, version) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePrinterDriverEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePrinterDriverEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePrinterDriverEx_args_out,
		.opnum = 84,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPerMachineConnection",
		.doc = "S.AddPerMachineConnection(server, printername, printserver, provider) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPerMachineConnection_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPerMachineConnection_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPerMachineConnection_args_out,
		.opnum = 85,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeletePerMachineConnection",
		.doc = "S.DeletePerMachineConnection(server, printername) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeletePerMachineConnection_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeletePerMachineConnection_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeletePerMachineConnection_args_out,
		.opnum = 86,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumPerMachineConnections",
		.doc = "S.EnumPerMachineConnections(server, buffer, offered) -> (count, info, needed)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumPerMachineConnections_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumPerMachineConnections_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumPerMachineConnections_args_out,
		.opnum = 87,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "XcvData",
		.doc = "S.XcvData(handle, function_name, in_data, _in_data_length, out_data_size, status_code) -> (out_data, needed, status_code)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_XcvData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_XcvData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_XcvData_args_out,
		.opnum = 88,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "AddPrinterDriverEx",
		.doc = "S.AddPrinterDriverEx(servername, info_ctr, flags) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_AddPrinterDriverEx_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_AddPrinterDriverEx_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_AddPrinterDriverEx_args_out,
		.opnum = 89,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SendRecvBidiData",
		.doc = "S.SendRecvBidiData(hPrinter, pAction, pReqData) -> ppRespData",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SendRecvBidiData_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SendRecvBidiData_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SendRecvBidiData_args_out,
		.opnum = 97,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetCorePrinterDrivers",
		.doc = "S.GetCorePrinterDrivers(servername, architecture, core_driver_dependencies, core_printer_driver_count) -> (core_printer_drivers, result)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetCorePrinterDrivers_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetCorePrinterDrivers_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetCorePrinterDrivers_args_out,
		.opnum = 102,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetPrinterDriverPackagePath",
		.doc = "S.GetPrinterDriverPackagePath(servername, architecture, language, package_id, driver_package_cab) -> (driver_package_cab, required, result)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetPrinterDriverPackagePath_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetPrinterDriverPackagePath_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetPrinterDriverPackagePath_args_out,
		.opnum = 104,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "GetJobNamedPropertyValue",
		.doc = "S.GetJobNamedPropertyValue(hPrinter, JobId, pszName) -> pValue",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_GetJobNamedPropertyValue_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_GetJobNamedPropertyValue_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_GetJobNamedPropertyValue_args_out,
		.opnum = 110,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "SetJobNamedProperty",
		.doc = "S.SetJobNamedProperty(hPrinter, JobId, pProperty) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_SetJobNamedProperty_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_SetJobNamedProperty_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_SetJobNamedProperty_args_out,
		.opnum = 111,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "DeleteJobNamedProperty",
		.doc = "S.DeleteJobNamedProperty(hPrinter, JobId, pszName) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_DeleteJobNamedProperty_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_DeleteJobNamedProperty_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_DeleteJobNamedProperty_args_out,
		.opnum = 112,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "EnumJobNamedProperties",
		.doc = "S.EnumJobNamedProperties(hPrinter, JobId) -> (pcProperties, ppProperties)",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_EnumJobNamedProperties_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_EnumJobNamedProperties_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_EnumJobNamedProperties_args_out,
		.opnum = 113,
		.table = &ndr_table_spoolss,
	},
	{
		.name = "LogJobInfoForBranchOffice",
		.doc = "S.LogJobInfoForBranchOffice(hPrinter, pBranchOfficeJobDataContainer) -> None",
		.call = (py_dcerpc_call_fn)dcerpc_spoolss_LogJobInfoForBranchOffice_r,
		.pack_in_data = (py_data_pack_fn)pack_py_spoolss_LogJobInfoForBranchOffice_args_in,
		.unpack_out_data = (py_data_unpack_fn)unpack_py_spoolss_LogJobInfoForBranchOffice_args_out,
		.opnum = 116,
		.table = &ndr_table_spoolss,
	},
	{
		.name = NULL,
	},
};

static PyObject *interface_spoolss_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_spoolss);
}

#define PY_DOC_SPOOLSS "Spooler SubSystem"
static PyTypeObject spoolss_InterfaceType = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.spoolss",
	.tp_basicsize = sizeof(dcerpc_InterfaceObject),
	.tp_doc = "spoolss(binding, lp_ctx=None, credentials=None, basis_connection=None) -> connection\n"
"\n\n"
"Parameters\n"
"----------\n"
"binding : str\n"
"    A DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
"lp_ctx : param.LoadParm\n"
"    Should be a path to a smb.conf file or a param.LoadParm object\n"
"credentials : credentials.Credentials, optional\n"
"    A credentials.Credentials object (default is None).\n"
"basis_connection : samba.dcerpc.ClientConnection, optional\n"
"    A spoolss client connection object (default is None).\n"
"\n\n"
"Returns\n"
"-------\n"
"samba.dcerpc.ClientConnection\n"
"    A ClientConnection object\n"
"\n\n"
"Raises\n"
"------\n"
"samba.NTSTATUSError\n"
"    An NTSTATUS error\n"
"\n"PY_DOC_SPOOLSS,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = interface_spoolss_new,
};

static PyObject *syntax_spoolss_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
	return py_dcerpc_syntax_init_helper(type, args, kwargs, &ndr_table_spoolss.syntax_id);
}

#define PY_DOC_SPOOLSS_SYNTAX "Spooler SubSystem"
static PyTypeObject spoolss_SyntaxType = {
	PyVarObject_HEAD_INIT(NULL, 0)
	.tp_name = "spoolss.spoolss_abstract_syntax",
	.tp_doc = "spoolss_abstract_syntax()\n"PY_DOC_SPOOLSS_SYNTAX,
	.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
	.tp_new = syntax_spoolss_new,
};

static PyMethodDef spoolss_methods[] = {
	{ NULL, NULL, 0, NULL }
};

static struct PyModuleDef moduledef = {
	PyModuleDef_HEAD_INIT,
	.m_name = "spoolss",
	.m_doc = "spoolss DCE/RPC",
	.m_size = -1,
	.m_methods = spoolss_methods,
};
MODULE_INIT_FUNC(spoolss)
{
	PyObject *m = NULL;
	PyObject *dep_samba_dcerpc_misc = NULL;
	PyObject *dep_samba_dcerpc_security = NULL;
	PyObject *dep_samba_dcerpc_winreg = NULL;
	PyObject *dep_talloc = NULL;
	PyObject *dep_samba_dcerpc_base = NULL;

	dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
	if (dep_samba_dcerpc_misc == NULL)
		goto out;

	dep_samba_dcerpc_security = PyImport_ImportModule("samba.dcerpc.security");
	if (dep_samba_dcerpc_security == NULL)
		goto out;

	dep_samba_dcerpc_winreg = PyImport_ImportModule("samba.dcerpc.winreg");
	if (dep_samba_dcerpc_winreg == NULL)
		goto out;

	dep_talloc = PyImport_ImportModule("talloc");
	if (dep_talloc == NULL)
		goto out;

	dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
	if (dep_samba_dcerpc_base == NULL)
		goto out;

	BaseObject_Type = (PyTypeObject *)PyObject_GetAttrString(dep_talloc, "BaseObject");
	if (BaseObject_Type == NULL)
		goto out;

	security_descriptor_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "descriptor");
	if (security_descriptor_Type == NULL)
		goto out;

	sec_desc_buf_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_security, "sec_desc_buf");
	if (sec_desc_buf_Type == NULL)
		goto out;

	GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
	if (GUID_Type == NULL)
		goto out;

	policy_handle_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "policy_handle");
	if (policy_handle_Type == NULL)
		goto out;

	ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
	if (ClientConnection_Type == NULL)
		goto out;

	ndr_syntax_id_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "ndr_syntax_id");
	if (ndr_syntax_id_Type == NULL)
		goto out;

	spoolss_Time_Type.tp_base = BaseObject_Type;
	spoolss_Time_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_TimeCtr_Type.tp_base = BaseObject_Type;
	spoolss_TimeCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo0_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo0_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PSDRVEXTRA351_Type.tp_base = BaseObject_Type;
	spoolss_PSDRVEXTRA351_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PSDRVEXTRA400_Type.tp_base = BaseObject_Type;
	spoolss_PSDRVEXTRA400_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PSDRVEXTRA500_Type.tp_base = BaseObject_Type;
	spoolss_PSDRVEXTRA500_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PSDRVEXTRA_Type.tp_base = BaseObject_Type;
	spoolss_PSDRVEXTRA_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UNIDRVEXTRA3_4_Type.tp_base = BaseObject_Type;
	spoolss_UNIDRVEXTRA3_4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UNIDRVEXTRA500_Type.tp_base = BaseObject_Type;
	spoolss_UNIDRVEXTRA500_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UNIDRVEXTRA_Type.tp_base = BaseObject_Type;
	spoolss_UNIDRVEXTRA_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JTEXP_Type.tp_base = BaseObject_Type;
	spoolss_JTEXP_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_OEM_DMEXTRA_Type.tp_base = BaseObject_Type;
	spoolss_OEM_DMEXTRA_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeviceModeExtraDataPostScript_Type.tp_base = BaseObject_Type;
	spoolss_DeviceModeExtraDataPostScript_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeviceModeExtraDataUniDriver_Type.tp_base = BaseObject_Type;
	spoolss_DeviceModeExtraDataUniDriver_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeviceMode_Type.tp_base = BaseObject_Type;
	spoolss_DeviceMode_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo1_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo2_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo3_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo4_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo5_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo6_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo7_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo7_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeviceModeInfo_Type.tp_base = BaseObject_Type;
	spoolss_DeviceModeInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterInfo_Type.tp_base = BaseObject_Type;
	spoolss_PrinterInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DevmodeContainer_Type.tp_base = BaseObject_Type;
	spoolss_DevmodeContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfo1_Type.tp_base = BaseObject_Type;
	spoolss_JobInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfo2_Type.tp_base = BaseObject_Type;
	spoolss_JobInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfo3_Type.tp_base = BaseObject_Type;
	spoolss_JobInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfo4_Type.tp_base = BaseObject_Type;
	spoolss_JobInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfo_Type.tp_base = BaseObject_Type;
	spoolss_JobInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJobInfo1_Type.tp_base = BaseObject_Type;
	spoolss_SetJobInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJobInfo2_Type.tp_base = BaseObject_Type;
	spoolss_SetJobInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJobInfo4_Type.tp_base = BaseObject_Type;
	spoolss_SetJobInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJobInfo_Type.tp_base = BaseObject_Type;
	spoolss_SetJobInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_JobInfoContainer_Type.tp_base = BaseObject_Type;
	spoolss_JobInfoContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo0_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo0_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo1_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo2_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo3_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo4_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo5_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo6_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo7_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo7_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo8_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo8_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo9_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo9_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfo_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterInfoCtr_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterInfoCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_StringArray_Type.tp_base = BaseObject_Type;
	spoolss_StringArray_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo1_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo2_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo3_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo4_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo5_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo6_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo8_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo8_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfo_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddDriverInfoCtr_Type.tp_base = BaseObject_Type;
	spoolss_AddDriverInfoCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo1_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo2_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo3_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo4_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo4_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo5_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo5_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo6_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo6_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo7_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo7_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo8_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo8_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverFileInfo_Type.tp_base = BaseObject_Type;
	spoolss_DriverFileInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo101_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo101_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverInfo_Type.tp_base = BaseObject_Type;
	spoolss_DriverInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverDirectoryInfo1_Type.tp_base = BaseObject_Type;
	spoolss_DriverDirectoryInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DriverDirectoryInfo_Type.tp_base = BaseObject_Type;
	spoolss_DriverDirectoryInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcessorInfo1_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcessorInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcessorInfo_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcessorInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcessorDirectoryInfo1_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcessorDirectoryInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcessorDirectoryInfo_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcessorDirectoryInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DocumentInfo1_Type.tp_base = BaseObject_Type;
	spoolss_DocumentInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DocumentInfo_Type.tp_base = BaseObject_Type;
	spoolss_DocumentInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DocumentInfoCtr_Type.tp_base = BaseObject_Type;
	spoolss_DocumentInfoCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_OSVersion_Type.tp_base = BaseObject_Type;
	spoolss_OSVersion_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_OSVersionEx_Type.tp_base = BaseObject_Type;
	spoolss_OSVersionEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterData_Type.tp_base = BaseObject_Type;
	spoolss_PrinterData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FormSize_Type.tp_base = BaseObject_Type;
	spoolss_FormSize_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FormArea_Type.tp_base = BaseObject_Type;
	spoolss_FormArea_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FormInfo1_Type.tp_base = BaseObject_Type;
	spoolss_FormInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FormInfo2_Type.tp_base = BaseObject_Type;
	spoolss_FormInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FormInfo_Type.tp_base = BaseObject_Type;
	spoolss_FormInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddFormInfo1_Type.tp_base = BaseObject_Type;
	spoolss_AddFormInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddFormInfo2_Type.tp_base = BaseObject_Type;
	spoolss_AddFormInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddFormInfo_Type.tp_base = BaseObject_Type;
	spoolss_AddFormInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddFormInfoCtr_Type.tp_base = BaseObject_Type;
	spoolss_AddFormInfoCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortInfo1_Type.tp_base = BaseObject_Type;
	spoolss_PortInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortInfo2_Type.tp_base = BaseObject_Type;
	spoolss_PortInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortInfo3_Type.tp_base = BaseObject_Type;
	spoolss_PortInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortInfoFF_Type.tp_base = BaseObject_Type;
	spoolss_PortInfoFF_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortInfo_Type.tp_base = BaseObject_Type;
	spoolss_PortInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_MonitorInfo1_Type.tp_base = BaseObject_Type;
	spoolss_MonitorInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_MonitorInfo2_Type.tp_base = BaseObject_Type;
	spoolss_MonitorInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_MonitorInfo_Type.tp_base = BaseObject_Type;
	spoolss_MonitorInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfo1_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfo2_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfo3_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfo3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfoFF_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfoFF_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfo_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPortInfoContainer_Type.tp_base = BaseObject_Type;
	spoolss_SetPortInfoContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	UNIVERSAL_FONT_ID_Type.tp_base = BaseObject_Type;
	UNIVERSAL_FONT_ID_Type.tp_basicsize = pytalloc_BaseObject_size();

	UNIVERSAL_FONT_ID_ctr_Type.tp_base = BaseObject_Type;
	UNIVERSAL_FONT_ID_ctr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddMonitorInfo1_Type.tp_base = BaseObject_Type;
	spoolss_AddMonitorInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddMonitorInfo2_Type.tp_base = BaseObject_Type;
	spoolss_AddMonitorInfo2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddMonitorInfo_Type.tp_base = BaseObject_Type;
	spoolss_AddMonitorInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_MonitorContainer_Type.tp_base = BaseObject_Type;
	spoolss_MonitorContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcDataTypesInfo1_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcDataTypesInfo1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintProcDataTypesInfo_Type.tp_base = BaseObject_Type;
	spoolss_PrintProcDataTypesInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortVarContainer_Type.tp_base = BaseObject_Type;
	spoolss_PortVarContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_Field_Type.tp_base = BaseObject_Type;
	spoolss_Field_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_NotifyOptionType_Type.tp_base = BaseObject_Type;
	spoolss_NotifyOptionType_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_NotifyOption_Type.tp_base = BaseObject_Type;
	spoolss_NotifyOption_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_NotifyString_Type.tp_base = BaseObject_Type;
	spoolss_NotifyString_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_NotifyData_Type.tp_base = BaseObject_Type;
	spoolss_NotifyData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_Notify_Type.tp_base = BaseObject_Type;
	spoolss_Notify_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_NotifyInfo_Type.tp_base = BaseObject_Type;
	spoolss_NotifyInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ReplyPrinterInfo_Type.tp_base = BaseObject_Type;
	spoolss_ReplyPrinterInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UserLevel1_Type.tp_base = BaseObject_Type;
	spoolss_UserLevel1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UserLevel2_Type.tp_base = BaseObject_Type;
	spoolss_UserLevel2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UserLevel3_Type.tp_base = BaseObject_Type;
	spoolss_UserLevel3_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UserLevel_Type.tp_base = BaseObject_Type;
	spoolss_UserLevel_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_UserLevelCtr_Type.tp_base = BaseObject_Type;
	spoolss_UserLevelCtr_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrinterEnumValues_Type.tp_base = BaseObject_Type;
	spoolss_PrinterEnumValues_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_KeyNames_Type.tp_base = BaseObject_Type;
	spoolss_KeyNames_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortData1_Type.tp_base = BaseObject_Type;
	spoolss_PortData1_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PortData2_Type.tp_base = BaseObject_Type;
	spoolss_PortData2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_MonitorUi_Type.tp_base = BaseObject_Type;
	spoolss_MonitorUi_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BINARY_CONTAINER_Type.tp_base = BaseObject_Type;
	RPC_BINARY_CONTAINER_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_DATA_u_Type.tp_base = BaseObject_Type;
	RPC_BIDI_DATA_u_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_DATA_Type.tp_base = BaseObject_Type;
	RPC_BIDI_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_REQUEST_DATA_Type.tp_base = BaseObject_Type;
	RPC_BIDI_REQUEST_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_REQUEST_CONTAINER_Type.tp_base = BaseObject_Type;
	RPC_BIDI_REQUEST_CONTAINER_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_RESPONSE_DATA_Type.tp_base = BaseObject_Type;
	RPC_BIDI_RESPONSE_DATA_Type.tp_basicsize = pytalloc_BaseObject_size();

	RPC_BIDI_RESPONSE_CONTAINER_Type.tp_base = BaseObject_Type;
	RPC_BIDI_RESPONSE_CONTAINER_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_CorePrinterDriver_Type.tp_base = BaseObject_Type;
	spoolss_CorePrinterDriver_Type.tp_basicsize = pytalloc_BaseObject_size();

	propertyBlob_Type.tp_base = BaseObject_Type;
	propertyBlob_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintPropertyValueUnion_Type.tp_base = BaseObject_Type;
	spoolss_PrintPropertyValueUnion_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintPropertyValue_Type.tp_base = BaseObject_Type;
	spoolss_PrintPropertyValue_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PrintNamedProperty_Type.tp_base = BaseObject_Type;
	spoolss_PrintNamedProperty_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobDataPrinted_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobDataPrinted_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobDataRendered_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobDataRendered_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobDataError_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobDataError_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobDataPipelineFailed_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobDataPipelineFailed_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeLogOfflineFileFull_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeLogOfflineFileFull_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobInfo_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobInfo_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobData_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_BranchOfficeJobDataContainer_Type.tp_base = BaseObject_Type;
	spoolss_BranchOfficeJobDataContainer_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrinters_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrinters_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_OpenPrinter_Type.tp_base = BaseObject_Type;
	spoolss_OpenPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJob_Type.tp_base = BaseObject_Type;
	spoolss_SetJob_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetJob_Type.tp_base = BaseObject_Type;
	spoolss_GetJob_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumJobs_Type.tp_base = BaseObject_Type;
	spoolss_EnumJobs_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPrinter_Type.tp_base = BaseObject_Type;
	spoolss_AddPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinter_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinter_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinter_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPrinterDriver_Type.tp_base = BaseObject_Type;
	spoolss_AddPrinterDriver_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrinterDrivers_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrinterDrivers_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterDriver_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterDriver_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterDriverDirectory_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterDriverDirectory_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterDriver_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterDriver_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPrintProcessor_Type.tp_base = BaseObject_Type;
	spoolss_AddPrintProcessor_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrintProcessors_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrintProcessors_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrintProcessorDirectory_Type.tp_base = BaseObject_Type;
	spoolss_GetPrintProcessorDirectory_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_StartDocPrinter_Type.tp_base = BaseObject_Type;
	spoolss_StartDocPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_StartPagePrinter_Type.tp_base = BaseObject_Type;
	spoolss_StartPagePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_WritePrinter_Type.tp_base = BaseObject_Type;
	spoolss_WritePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EndPagePrinter_Type.tp_base = BaseObject_Type;
	spoolss_EndPagePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AbortPrinter_Type.tp_base = BaseObject_Type;
	spoolss_AbortPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ReadPrinter_Type.tp_base = BaseObject_Type;
	spoolss_ReadPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EndDocPrinter_Type.tp_base = BaseObject_Type;
	spoolss_EndDocPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddJob_Type.tp_base = BaseObject_Type;
	spoolss_AddJob_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ScheduleJob_Type.tp_base = BaseObject_Type;
	spoolss_ScheduleJob_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterData_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterData_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ClosePrinter_Type.tp_base = BaseObject_Type;
	spoolss_ClosePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddForm_Type.tp_base = BaseObject_Type;
	spoolss_AddForm_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeleteForm_Type.tp_base = BaseObject_Type;
	spoolss_DeleteForm_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetForm_Type.tp_base = BaseObject_Type;
	spoolss_GetForm_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetForm_Type.tp_base = BaseObject_Type;
	spoolss_SetForm_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumForms_Type.tp_base = BaseObject_Type;
	spoolss_EnumForms_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPorts_Type.tp_base = BaseObject_Type;
	spoolss_EnumPorts_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumMonitors_Type.tp_base = BaseObject_Type;
	spoolss_EnumMonitors_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPort_Type.tp_base = BaseObject_Type;
	spoolss_AddPort_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePort_Type.tp_base = BaseObject_Type;
	spoolss_DeletePort_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_CreatePrinterIC_Type.tp_base = BaseObject_Type;
	spoolss_CreatePrinterIC_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_PlayGDIScriptOnPrinterIC_Type.tp_base = BaseObject_Type;
	spoolss_PlayGDIScriptOnPrinterIC_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterIC_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterIC_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrintProcessor_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrintProcessor_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrintProcessorDataTypes_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrintProcessorDataTypes_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ResetPrinter_Type.tp_base = BaseObject_Type;
	spoolss_ResetPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterDriver2_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterDriver2_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_FindClosePrinterNotify_Type.tp_base = BaseObject_Type;
	spoolss_FindClosePrinterNotify_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ReplyOpenPrinter_Type.tp_base = BaseObject_Type;
	spoolss_ReplyOpenPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_RouterReplyPrinter_Type.tp_base = BaseObject_Type;
	spoolss_RouterReplyPrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_ReplyClosePrinter_Type.tp_base = BaseObject_Type;
	spoolss_ReplyClosePrinter_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPortEx_Type.tp_base = BaseObject_Type;
	spoolss_AddPortEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type.tp_base = BaseObject_Type;
	spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_RouterReplyPrinterEx_Type.tp_base = BaseObject_Type;
	spoolss_RouterReplyPrinterEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_RouterRefreshPrinterChangeNotify_Type.tp_base = BaseObject_Type;
	spoolss_RouterRefreshPrinterChangeNotify_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_OpenPrinterEx_Type.tp_base = BaseObject_Type;
	spoolss_OpenPrinterEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPrinterEx_Type.tp_base = BaseObject_Type;
	spoolss_AddPrinterEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPort_Type.tp_base = BaseObject_Type;
	spoolss_SetPort_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrinterData_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrinterData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterData_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetPrinterDataEx_Type.tp_base = BaseObject_Type;
	spoolss_SetPrinterDataEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterDataEx_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterDataEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrinterDataEx_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrinterDataEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPrinterKey_Type.tp_base = BaseObject_Type;
	spoolss_EnumPrinterKey_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterDataEx_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterDataEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterKey_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterKey_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePrinterDriverEx_Type.tp_base = BaseObject_Type;
	spoolss_DeletePrinterDriverEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPerMachineConnection_Type.tp_base = BaseObject_Type;
	spoolss_AddPerMachineConnection_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeletePerMachineConnection_Type.tp_base = BaseObject_Type;
	spoolss_DeletePerMachineConnection_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumPerMachineConnections_Type.tp_base = BaseObject_Type;
	spoolss_EnumPerMachineConnections_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_XcvData_Type.tp_base = BaseObject_Type;
	spoolss_XcvData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_AddPrinterDriverEx_Type.tp_base = BaseObject_Type;
	spoolss_AddPrinterDriverEx_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SendRecvBidiData_Type.tp_base = BaseObject_Type;
	spoolss_SendRecvBidiData_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetCorePrinterDrivers_Type.tp_base = BaseObject_Type;
	spoolss_GetCorePrinterDrivers_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetPrinterDriverPackagePath_Type.tp_base = BaseObject_Type;
	spoolss_GetPrinterDriverPackagePath_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_GetJobNamedPropertyValue_Type.tp_base = BaseObject_Type;
	spoolss_GetJobNamedPropertyValue_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_SetJobNamedProperty_Type.tp_base = BaseObject_Type;
	spoolss_SetJobNamedProperty_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_DeleteJobNamedProperty_Type.tp_base = BaseObject_Type;
	spoolss_DeleteJobNamedProperty_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_EnumJobNamedProperties_Type.tp_base = BaseObject_Type;
	spoolss_EnumJobNamedProperties_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_LogJobInfoForBranchOffice_Type.tp_base = BaseObject_Type;
	spoolss_LogJobInfoForBranchOffice_Type.tp_basicsize = pytalloc_BaseObject_size();

	spoolss_InterfaceType.tp_base = ClientConnection_Type;

	spoolss_SyntaxType.tp_base = ndr_syntax_id_Type;
	spoolss_SyntaxType.tp_basicsize = pytalloc_BaseObject_size();

	if (PyType_Ready(&spoolss_Time_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_TimeCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo0_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PSDRVEXTRA351_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PSDRVEXTRA400_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PSDRVEXTRA500_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PSDRVEXTRA_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UNIDRVEXTRA3_4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UNIDRVEXTRA500_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UNIDRVEXTRA_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JTEXP_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_OEM_DMEXTRA_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeviceModeExtraDataPostScript_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeviceModeExtraDataUniDriver_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeviceMode_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo5_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo6_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo7_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeviceModeInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DevmodeContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJobInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJobInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJobInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJobInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_JobInfoContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo0_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo5_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo6_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo7_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo8_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo9_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterInfoCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_StringArray_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo5_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo6_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo8_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddDriverInfoCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo4_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo5_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo6_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo7_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo8_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverFileInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo101_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverDirectoryInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DriverDirectoryInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcessorInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcessorInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcessorDirectoryInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcessorDirectoryInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DocumentInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DocumentInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DocumentInfoCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_OSVersion_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_OSVersionEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FormSize_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FormArea_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FormInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FormInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FormInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddFormInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddFormInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddFormInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddFormInfoCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortInfoFF_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_MonitorInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_MonitorInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_MonitorInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfo3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfoFF_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPortInfoContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&UNIVERSAL_FONT_ID_Type) < 0)
		goto out;
	if (PyType_Ready(&UNIVERSAL_FONT_ID_ctr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddMonitorInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddMonitorInfo2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddMonitorInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_MonitorContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcDataTypesInfo1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintProcDataTypesInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortVarContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_Field_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_NotifyOptionType_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_NotifyOption_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_NotifyString_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_NotifyData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_Notify_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_NotifyInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ReplyPrinterInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UserLevel1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UserLevel2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UserLevel3_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UserLevel_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_UserLevelCtr_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrinterEnumValues_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_KeyNames_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortData1_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PortData2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_MonitorUi_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BINARY_CONTAINER_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_DATA_u_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_DATA_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_REQUEST_DATA_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_REQUEST_CONTAINER_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_RESPONSE_DATA_Type) < 0)
		goto out;
	if (PyType_Ready(&RPC_BIDI_RESPONSE_CONTAINER_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_CorePrinterDriver_Type) < 0)
		goto out;
	if (PyType_Ready(&propertyBlob_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintPropertyValueUnion_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintPropertyValue_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PrintNamedProperty_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobDataPrinted_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobDataRendered_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobDataError_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobDataPipelineFailed_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeLogOfflineFileFull_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobInfo_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_BranchOfficeJobDataContainer_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrinters_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_OpenPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJob_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetJob_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumJobs_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPrinterDriver_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrinterDrivers_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterDriver_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterDriverDirectory_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterDriver_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPrintProcessor_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrintProcessors_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrintProcessorDirectory_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_StartDocPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_StartPagePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_WritePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EndPagePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AbortPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ReadPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EndDocPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddJob_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ScheduleJob_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ClosePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddForm_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeleteForm_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetForm_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetForm_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumForms_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPorts_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumMonitors_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPort_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePort_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_CreatePrinterIC_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_PlayGDIScriptOnPrinterIC_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterIC_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrintProcessor_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrintProcessorDataTypes_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ResetPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterDriver2_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_FindClosePrinterNotify_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ReplyOpenPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_RouterReplyPrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_ReplyClosePrinter_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPortEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_RouterReplyPrinterEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_RouterRefreshPrinterChangeNotify_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_OpenPrinterEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPrinterEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPort_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrinterData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetPrinterDataEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterDataEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrinterDataEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPrinterKey_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterDataEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterKey_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePrinterDriverEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPerMachineConnection_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeletePerMachineConnection_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumPerMachineConnections_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_XcvData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_AddPrinterDriverEx_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SendRecvBidiData_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetCorePrinterDrivers_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetPrinterDriverPackagePath_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_GetJobNamedPropertyValue_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SetJobNamedProperty_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_DeleteJobNamedProperty_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_EnumJobNamedProperties_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_LogJobInfoForBranchOffice_Type) < 0)
		goto out;
	if (PyType_Ready(&spoolss_InterfaceType) < 0)
		goto out;
	if (PyType_Ready(&spoolss_SyntaxType) < 0)
		goto out;
	if (!PyInterface_AddNdrRpcMethods(&spoolss_InterfaceType, py_ndr_spoolss_methods))
		return NULL;

#ifdef PY_TIME_PATCH
	PY_TIME_PATCH(&spoolss_Time_Type);
#endif
#ifdef PY_TIMECTR_PATCH
	PY_TIMECTR_PATCH(&spoolss_TimeCtr_Type);
#endif
#ifdef PY_PRINTERINFO0_PATCH
	PY_PRINTERINFO0_PATCH(&spoolss_PrinterInfo0_Type);
#endif
#ifdef PY_PSDRVEXTRA351_PATCH
	PY_PSDRVEXTRA351_PATCH(&spoolss_PSDRVEXTRA351_Type);
#endif
#ifdef PY_PSDRVEXTRA400_PATCH
	PY_PSDRVEXTRA400_PATCH(&spoolss_PSDRVEXTRA400_Type);
#endif
#ifdef PY_PSDRVEXTRA500_PATCH
	PY_PSDRVEXTRA500_PATCH(&spoolss_PSDRVEXTRA500_Type);
#endif
#ifdef PY_PSDRVEXTRA_PATCH
	PY_PSDRVEXTRA_PATCH(&spoolss_PSDRVEXTRA_Type);
#endif
#ifdef PY_UNIDRVEXTRA3_4_PATCH
	PY_UNIDRVEXTRA3_4_PATCH(&spoolss_UNIDRVEXTRA3_4_Type);
#endif
#ifdef PY_UNIDRVEXTRA500_PATCH
	PY_UNIDRVEXTRA500_PATCH(&spoolss_UNIDRVEXTRA500_Type);
#endif
#ifdef PY_UNIDRVEXTRA_PATCH
	PY_UNIDRVEXTRA_PATCH(&spoolss_UNIDRVEXTRA_Type);
#endif
#ifdef PY_JTEXP_PATCH
	PY_JTEXP_PATCH(&spoolss_JTEXP_Type);
#endif
#ifdef PY_OEM_DMEXTRA_PATCH
	PY_OEM_DMEXTRA_PATCH(&spoolss_OEM_DMEXTRA_Type);
#endif
#ifdef PY_DEVICEMODEEXTRADATAPOSTSCRIPT_PATCH
	PY_DEVICEMODEEXTRADATAPOSTSCRIPT_PATCH(&spoolss_DeviceModeExtraDataPostScript_Type);
#endif
#ifdef PY_DEVICEMODEEXTRADATAUNIDRIVER_PATCH
	PY_DEVICEMODEEXTRADATAUNIDRIVER_PATCH(&spoolss_DeviceModeExtraDataUniDriver_Type);
#endif
#ifdef PY_DEVICEMODE_PATCH
	PY_DEVICEMODE_PATCH(&spoolss_DeviceMode_Type);
#endif
#ifdef PY_PRINTERINFO1_PATCH
	PY_PRINTERINFO1_PATCH(&spoolss_PrinterInfo1_Type);
#endif
#ifdef PY_PRINTERINFO2_PATCH
	PY_PRINTERINFO2_PATCH(&spoolss_PrinterInfo2_Type);
#endif
#ifdef PY_PRINTERINFO3_PATCH
	PY_PRINTERINFO3_PATCH(&spoolss_PrinterInfo3_Type);
#endif
#ifdef PY_PRINTERINFO4_PATCH
	PY_PRINTERINFO4_PATCH(&spoolss_PrinterInfo4_Type);
#endif
#ifdef PY_PRINTERINFO5_PATCH
	PY_PRINTERINFO5_PATCH(&spoolss_PrinterInfo5_Type);
#endif
#ifdef PY_PRINTERINFO6_PATCH
	PY_PRINTERINFO6_PATCH(&spoolss_PrinterInfo6_Type);
#endif
#ifdef PY_PRINTERINFO7_PATCH
	PY_PRINTERINFO7_PATCH(&spoolss_PrinterInfo7_Type);
#endif
#ifdef PY_DEVICEMODEINFO_PATCH
	PY_DEVICEMODEINFO_PATCH(&spoolss_DeviceModeInfo_Type);
#endif
#ifdef PY_PRINTERINFO_PATCH
	PY_PRINTERINFO_PATCH(&spoolss_PrinterInfo_Type);
#endif
#ifdef PY_DEVMODECONTAINER_PATCH
	PY_DEVMODECONTAINER_PATCH(&spoolss_DevmodeContainer_Type);
#endif
#ifdef PY_JOBINFO1_PATCH
	PY_JOBINFO1_PATCH(&spoolss_JobInfo1_Type);
#endif
#ifdef PY_JOBINFO2_PATCH
	PY_JOBINFO2_PATCH(&spoolss_JobInfo2_Type);
#endif
#ifdef PY_JOBINFO3_PATCH
	PY_JOBINFO3_PATCH(&spoolss_JobInfo3_Type);
#endif
#ifdef PY_JOBINFO4_PATCH
	PY_JOBINFO4_PATCH(&spoolss_JobInfo4_Type);
#endif
#ifdef PY_JOBINFO_PATCH
	PY_JOBINFO_PATCH(&spoolss_JobInfo_Type);
#endif
#ifdef PY_SETJOBINFO1_PATCH
	PY_SETJOBINFO1_PATCH(&spoolss_SetJobInfo1_Type);
#endif
#ifdef PY_SETJOBINFO2_PATCH
	PY_SETJOBINFO2_PATCH(&spoolss_SetJobInfo2_Type);
#endif
#ifdef PY_SETJOBINFO4_PATCH
	PY_SETJOBINFO4_PATCH(&spoolss_SetJobInfo4_Type);
#endif
#ifdef PY_SETJOBINFO_PATCH
	PY_SETJOBINFO_PATCH(&spoolss_SetJobInfo_Type);
#endif
#ifdef PY_JOBINFOCONTAINER_PATCH
	PY_JOBINFOCONTAINER_PATCH(&spoolss_JobInfoContainer_Type);
#endif
#ifdef PY_SETPRINTERINFO0_PATCH
	PY_SETPRINTERINFO0_PATCH(&spoolss_SetPrinterInfo0_Type);
#endif
#ifdef PY_SETPRINTERINFO1_PATCH
	PY_SETPRINTERINFO1_PATCH(&spoolss_SetPrinterInfo1_Type);
#endif
#ifdef PY_SETPRINTERINFO2_PATCH
	PY_SETPRINTERINFO2_PATCH(&spoolss_SetPrinterInfo2_Type);
#endif
#ifdef PY_SETPRINTERINFO3_PATCH
	PY_SETPRINTERINFO3_PATCH(&spoolss_SetPrinterInfo3_Type);
#endif
#ifdef PY_SETPRINTERINFO4_PATCH
	PY_SETPRINTERINFO4_PATCH(&spoolss_SetPrinterInfo4_Type);
#endif
#ifdef PY_SETPRINTERINFO5_PATCH
	PY_SETPRINTERINFO5_PATCH(&spoolss_SetPrinterInfo5_Type);
#endif
#ifdef PY_SETPRINTERINFO6_PATCH
	PY_SETPRINTERINFO6_PATCH(&spoolss_SetPrinterInfo6_Type);
#endif
#ifdef PY_SETPRINTERINFO7_PATCH
	PY_SETPRINTERINFO7_PATCH(&spoolss_SetPrinterInfo7_Type);
#endif
#ifdef PY_SETPRINTERINFO8_PATCH
	PY_SETPRINTERINFO8_PATCH(&spoolss_SetPrinterInfo8_Type);
#endif
#ifdef PY_SETPRINTERINFO9_PATCH
	PY_SETPRINTERINFO9_PATCH(&spoolss_SetPrinterInfo9_Type);
#endif
#ifdef PY_SETPRINTERINFO_PATCH
	PY_SETPRINTERINFO_PATCH(&spoolss_SetPrinterInfo_Type);
#endif
#ifdef PY_SETPRINTERINFOCTR_PATCH
	PY_SETPRINTERINFOCTR_PATCH(&spoolss_SetPrinterInfoCtr_Type);
#endif
#ifdef PY_STRINGARRAY_PATCH
	PY_STRINGARRAY_PATCH(&spoolss_StringArray_Type);
#endif
#ifdef PY_ADDDRIVERINFO1_PATCH
	PY_ADDDRIVERINFO1_PATCH(&spoolss_AddDriverInfo1_Type);
#endif
#ifdef PY_ADDDRIVERINFO2_PATCH
	PY_ADDDRIVERINFO2_PATCH(&spoolss_AddDriverInfo2_Type);
#endif
#ifdef PY_ADDDRIVERINFO3_PATCH
	PY_ADDDRIVERINFO3_PATCH(&spoolss_AddDriverInfo3_Type);
#endif
#ifdef PY_ADDDRIVERINFO4_PATCH
	PY_ADDDRIVERINFO4_PATCH(&spoolss_AddDriverInfo4_Type);
#endif
#ifdef PY_ADDDRIVERINFO5_PATCH
	PY_ADDDRIVERINFO5_PATCH(&spoolss_AddDriverInfo5_Type);
#endif
#ifdef PY_ADDDRIVERINFO6_PATCH
	PY_ADDDRIVERINFO6_PATCH(&spoolss_AddDriverInfo6_Type);
#endif
#ifdef PY_ADDDRIVERINFO8_PATCH
	PY_ADDDRIVERINFO8_PATCH(&spoolss_AddDriverInfo8_Type);
#endif
#ifdef PY_ADDDRIVERINFO_PATCH
	PY_ADDDRIVERINFO_PATCH(&spoolss_AddDriverInfo_Type);
#endif
#ifdef PY_ADDDRIVERINFOCTR_PATCH
	PY_ADDDRIVERINFOCTR_PATCH(&spoolss_AddDriverInfoCtr_Type);
#endif
#ifdef PY_DRIVERINFO1_PATCH
	PY_DRIVERINFO1_PATCH(&spoolss_DriverInfo1_Type);
#endif
#ifdef PY_DRIVERINFO2_PATCH
	PY_DRIVERINFO2_PATCH(&spoolss_DriverInfo2_Type);
#endif
#ifdef PY_DRIVERINFO3_PATCH
	PY_DRIVERINFO3_PATCH(&spoolss_DriverInfo3_Type);
#endif
#ifdef PY_DRIVERINFO4_PATCH
	PY_DRIVERINFO4_PATCH(&spoolss_DriverInfo4_Type);
#endif
#ifdef PY_DRIVERINFO5_PATCH
	PY_DRIVERINFO5_PATCH(&spoolss_DriverInfo5_Type);
#endif
#ifdef PY_DRIVERINFO6_PATCH
	PY_DRIVERINFO6_PATCH(&spoolss_DriverInfo6_Type);
#endif
#ifdef PY_DRIVERINFO7_PATCH
	PY_DRIVERINFO7_PATCH(&spoolss_DriverInfo7_Type);
#endif
#ifdef PY_DRIVERINFO8_PATCH
	PY_DRIVERINFO8_PATCH(&spoolss_DriverInfo8_Type);
#endif
#ifdef PY_DRIVERFILEINFO_PATCH
	PY_DRIVERFILEINFO_PATCH(&spoolss_DriverFileInfo_Type);
#endif
#ifdef PY_DRIVERINFO101_PATCH
	PY_DRIVERINFO101_PATCH(&spoolss_DriverInfo101_Type);
#endif
#ifdef PY_DRIVERINFO_PATCH
	PY_DRIVERINFO_PATCH(&spoolss_DriverInfo_Type);
#endif
#ifdef PY_DRIVERDIRECTORYINFO1_PATCH
	PY_DRIVERDIRECTORYINFO1_PATCH(&spoolss_DriverDirectoryInfo1_Type);
#endif
#ifdef PY_DRIVERDIRECTORYINFO_PATCH
	PY_DRIVERDIRECTORYINFO_PATCH(&spoolss_DriverDirectoryInfo_Type);
#endif
#ifdef PY_PRINTPROCESSORINFO1_PATCH
	PY_PRINTPROCESSORINFO1_PATCH(&spoolss_PrintProcessorInfo1_Type);
#endif
#ifdef PY_PRINTPROCESSORINFO_PATCH
	PY_PRINTPROCESSORINFO_PATCH(&spoolss_PrintProcessorInfo_Type);
#endif
#ifdef PY_PRINTPROCESSORDIRECTORYINFO1_PATCH
	PY_PRINTPROCESSORDIRECTORYINFO1_PATCH(&spoolss_PrintProcessorDirectoryInfo1_Type);
#endif
#ifdef PY_PRINTPROCESSORDIRECTORYINFO_PATCH
	PY_PRINTPROCESSORDIRECTORYINFO_PATCH(&spoolss_PrintProcessorDirectoryInfo_Type);
#endif
#ifdef PY_DOCUMENTINFO1_PATCH
	PY_DOCUMENTINFO1_PATCH(&spoolss_DocumentInfo1_Type);
#endif
#ifdef PY_DOCUMENTINFO_PATCH
	PY_DOCUMENTINFO_PATCH(&spoolss_DocumentInfo_Type);
#endif
#ifdef PY_DOCUMENTINFOCTR_PATCH
	PY_DOCUMENTINFOCTR_PATCH(&spoolss_DocumentInfoCtr_Type);
#endif
#ifdef PY_OSVERSION_PATCH
	PY_OSVERSION_PATCH(&spoolss_OSVersion_Type);
#endif
#ifdef PY_OSVERSIONEX_PATCH
	PY_OSVERSIONEX_PATCH(&spoolss_OSVersionEx_Type);
#endif
#ifdef PY_PRINTERDATA_PATCH
	PY_PRINTERDATA_PATCH(&spoolss_PrinterData_Type);
#endif
#ifdef PY_FORMSIZE_PATCH
	PY_FORMSIZE_PATCH(&spoolss_FormSize_Type);
#endif
#ifdef PY_FORMAREA_PATCH
	PY_FORMAREA_PATCH(&spoolss_FormArea_Type);
#endif
#ifdef PY_FORMINFO1_PATCH
	PY_FORMINFO1_PATCH(&spoolss_FormInfo1_Type);
#endif
#ifdef PY_FORMINFO2_PATCH
	PY_FORMINFO2_PATCH(&spoolss_FormInfo2_Type);
#endif
#ifdef PY_FORMINFO_PATCH
	PY_FORMINFO_PATCH(&spoolss_FormInfo_Type);
#endif
#ifdef PY_ADDFORMINFO1_PATCH
	PY_ADDFORMINFO1_PATCH(&spoolss_AddFormInfo1_Type);
#endif
#ifdef PY_ADDFORMINFO2_PATCH
	PY_ADDFORMINFO2_PATCH(&spoolss_AddFormInfo2_Type);
#endif
#ifdef PY_ADDFORMINFO_PATCH
	PY_ADDFORMINFO_PATCH(&spoolss_AddFormInfo_Type);
#endif
#ifdef PY_ADDFORMINFOCTR_PATCH
	PY_ADDFORMINFOCTR_PATCH(&spoolss_AddFormInfoCtr_Type);
#endif
#ifdef PY_PORTINFO1_PATCH
	PY_PORTINFO1_PATCH(&spoolss_PortInfo1_Type);
#endif
#ifdef PY_PORTINFO2_PATCH
	PY_PORTINFO2_PATCH(&spoolss_PortInfo2_Type);
#endif
#ifdef PY_PORTINFO3_PATCH
	PY_PORTINFO3_PATCH(&spoolss_PortInfo3_Type);
#endif
#ifdef PY_PORTINFOFF_PATCH
	PY_PORTINFOFF_PATCH(&spoolss_PortInfoFF_Type);
#endif
#ifdef PY_PORTINFO_PATCH
	PY_PORTINFO_PATCH(&spoolss_PortInfo_Type);
#endif
#ifdef PY_MONITORINFO1_PATCH
	PY_MONITORINFO1_PATCH(&spoolss_MonitorInfo1_Type);
#endif
#ifdef PY_MONITORINFO2_PATCH
	PY_MONITORINFO2_PATCH(&spoolss_MonitorInfo2_Type);
#endif
#ifdef PY_MONITORINFO_PATCH
	PY_MONITORINFO_PATCH(&spoolss_MonitorInfo_Type);
#endif
#ifdef PY_SETPORTINFO1_PATCH
	PY_SETPORTINFO1_PATCH(&spoolss_SetPortInfo1_Type);
#endif
#ifdef PY_SETPORTINFO2_PATCH
	PY_SETPORTINFO2_PATCH(&spoolss_SetPortInfo2_Type);
#endif
#ifdef PY_SETPORTINFO3_PATCH
	PY_SETPORTINFO3_PATCH(&spoolss_SetPortInfo3_Type);
#endif
#ifdef PY_SETPORTINFOFF_PATCH
	PY_SETPORTINFOFF_PATCH(&spoolss_SetPortInfoFF_Type);
#endif
#ifdef PY_SETPORTINFO_PATCH
	PY_SETPORTINFO_PATCH(&spoolss_SetPortInfo_Type);
#endif
#ifdef PY_SETPORTINFOCONTAINER_PATCH
	PY_SETPORTINFOCONTAINER_PATCH(&spoolss_SetPortInfoContainer_Type);
#endif
#ifdef PY_UNIVERSAL_FONT_ID_PATCH
	PY_UNIVERSAL_FONT_ID_PATCH(&UNIVERSAL_FONT_ID_Type);
#endif
#ifdef PY_UNIVERSAL_FONT_ID_CTR_PATCH
	PY_UNIVERSAL_FONT_ID_CTR_PATCH(&UNIVERSAL_FONT_ID_ctr_Type);
#endif
#ifdef PY_ADDMONITORINFO1_PATCH
	PY_ADDMONITORINFO1_PATCH(&spoolss_AddMonitorInfo1_Type);
#endif
#ifdef PY_ADDMONITORINFO2_PATCH
	PY_ADDMONITORINFO2_PATCH(&spoolss_AddMonitorInfo2_Type);
#endif
#ifdef PY_ADDMONITORINFO_PATCH
	PY_ADDMONITORINFO_PATCH(&spoolss_AddMonitorInfo_Type);
#endif
#ifdef PY_MONITORCONTAINER_PATCH
	PY_MONITORCONTAINER_PATCH(&spoolss_MonitorContainer_Type);
#endif
#ifdef PY_PRINTPROCDATATYPESINFO1_PATCH
	PY_PRINTPROCDATATYPESINFO1_PATCH(&spoolss_PrintProcDataTypesInfo1_Type);
#endif
#ifdef PY_PRINTPROCDATATYPESINFO_PATCH
	PY_PRINTPROCDATATYPESINFO_PATCH(&spoolss_PrintProcDataTypesInfo_Type);
#endif
#ifdef PY_PORTVARCONTAINER_PATCH
	PY_PORTVARCONTAINER_PATCH(&spoolss_PortVarContainer_Type);
#endif
#ifdef PY_FIELD_PATCH
	PY_FIELD_PATCH(&spoolss_Field_Type);
#endif
#ifdef PY_NOTIFYOPTIONTYPE_PATCH
	PY_NOTIFYOPTIONTYPE_PATCH(&spoolss_NotifyOptionType_Type);
#endif
#ifdef PY_NOTIFYOPTION_PATCH
	PY_NOTIFYOPTION_PATCH(&spoolss_NotifyOption_Type);
#endif
#ifdef PY_NOTIFYSTRING_PATCH
	PY_NOTIFYSTRING_PATCH(&spoolss_NotifyString_Type);
#endif
#ifdef PY_NOTIFYDATA_PATCH
	PY_NOTIFYDATA_PATCH(&spoolss_NotifyData_Type);
#endif
#ifdef PY_NOTIFY_PATCH
	PY_NOTIFY_PATCH(&spoolss_Notify_Type);
#endif
#ifdef PY_NOTIFYINFO_PATCH
	PY_NOTIFYINFO_PATCH(&spoolss_NotifyInfo_Type);
#endif
#ifdef PY_REPLYPRINTERINFO_PATCH
	PY_REPLYPRINTERINFO_PATCH(&spoolss_ReplyPrinterInfo_Type);
#endif
#ifdef PY_USERLEVEL1_PATCH
	PY_USERLEVEL1_PATCH(&spoolss_UserLevel1_Type);
#endif
#ifdef PY_USERLEVEL2_PATCH
	PY_USERLEVEL2_PATCH(&spoolss_UserLevel2_Type);
#endif
#ifdef PY_USERLEVEL3_PATCH
	PY_USERLEVEL3_PATCH(&spoolss_UserLevel3_Type);
#endif
#ifdef PY_USERLEVEL_PATCH
	PY_USERLEVEL_PATCH(&spoolss_UserLevel_Type);
#endif
#ifdef PY_USERLEVELCTR_PATCH
	PY_USERLEVELCTR_PATCH(&spoolss_UserLevelCtr_Type);
#endif
#ifdef PY_PRINTERENUMVALUES_PATCH
	PY_PRINTERENUMVALUES_PATCH(&spoolss_PrinterEnumValues_Type);
#endif
#ifdef PY_KEYNAMES_PATCH
	PY_KEYNAMES_PATCH(&spoolss_KeyNames_Type);
#endif
#ifdef PY_PORTDATA1_PATCH
	PY_PORTDATA1_PATCH(&spoolss_PortData1_Type);
#endif
#ifdef PY_PORTDATA2_PATCH
	PY_PORTDATA2_PATCH(&spoolss_PortData2_Type);
#endif
#ifdef PY_MONITORUI_PATCH
	PY_MONITORUI_PATCH(&spoolss_MonitorUi_Type);
#endif
#ifdef PY_RPC_BINARY_CONTAINER_PATCH
	PY_RPC_BINARY_CONTAINER_PATCH(&RPC_BINARY_CONTAINER_Type);
#endif
#ifdef PY_RPC_BIDI_DATA_U_PATCH
	PY_RPC_BIDI_DATA_U_PATCH(&RPC_BIDI_DATA_u_Type);
#endif
#ifdef PY_RPC_BIDI_DATA_PATCH
	PY_RPC_BIDI_DATA_PATCH(&RPC_BIDI_DATA_Type);
#endif
#ifdef PY_RPC_BIDI_REQUEST_DATA_PATCH
	PY_RPC_BIDI_REQUEST_DATA_PATCH(&RPC_BIDI_REQUEST_DATA_Type);
#endif
#ifdef PY_RPC_BIDI_REQUEST_CONTAINER_PATCH
	PY_RPC_BIDI_REQUEST_CONTAINER_PATCH(&RPC_BIDI_REQUEST_CONTAINER_Type);
#endif
#ifdef PY_RPC_BIDI_RESPONSE_DATA_PATCH
	PY_RPC_BIDI_RESPONSE_DATA_PATCH(&RPC_BIDI_RESPONSE_DATA_Type);
#endif
#ifdef PY_RPC_BIDI_RESPONSE_CONTAINER_PATCH
	PY_RPC_BIDI_RESPONSE_CONTAINER_PATCH(&RPC_BIDI_RESPONSE_CONTAINER_Type);
#endif
#ifdef PY_COREPRINTERDRIVER_PATCH
	PY_COREPRINTERDRIVER_PATCH(&spoolss_CorePrinterDriver_Type);
#endif
#ifdef PY_PROPERTYBLOB_PATCH
	PY_PROPERTYBLOB_PATCH(&propertyBlob_Type);
#endif
#ifdef PY_PRINTPROPERTYVALUEUNION_PATCH
	PY_PRINTPROPERTYVALUEUNION_PATCH(&spoolss_PrintPropertyValueUnion_Type);
#endif
#ifdef PY_PRINTPROPERTYVALUE_PATCH
	PY_PRINTPROPERTYVALUE_PATCH(&spoolss_PrintPropertyValue_Type);
#endif
#ifdef PY_PRINTNAMEDPROPERTY_PATCH
	PY_PRINTNAMEDPROPERTY_PATCH(&spoolss_PrintNamedProperty_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATAPRINTED_PATCH
	PY_BRANCHOFFICEJOBDATAPRINTED_PATCH(&spoolss_BranchOfficeJobDataPrinted_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATARENDERED_PATCH
	PY_BRANCHOFFICEJOBDATARENDERED_PATCH(&spoolss_BranchOfficeJobDataRendered_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATAERROR_PATCH
	PY_BRANCHOFFICEJOBDATAERROR_PATCH(&spoolss_BranchOfficeJobDataError_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATAPIPELINEFAILED_PATCH
	PY_BRANCHOFFICEJOBDATAPIPELINEFAILED_PATCH(&spoolss_BranchOfficeJobDataPipelineFailed_Type);
#endif
#ifdef PY_BRANCHOFFICELOGOFFLINEFILEFULL_PATCH
	PY_BRANCHOFFICELOGOFFLINEFILEFULL_PATCH(&spoolss_BranchOfficeLogOfflineFileFull_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBINFO_PATCH
	PY_BRANCHOFFICEJOBINFO_PATCH(&spoolss_BranchOfficeJobInfo_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATA_PATCH
	PY_BRANCHOFFICEJOBDATA_PATCH(&spoolss_BranchOfficeJobData_Type);
#endif
#ifdef PY_BRANCHOFFICEJOBDATACONTAINER_PATCH
	PY_BRANCHOFFICEJOBDATACONTAINER_PATCH(&spoolss_BranchOfficeJobDataContainer_Type);
#endif
#ifdef PY_ENUMPRINTERS_PATCH
	PY_ENUMPRINTERS_PATCH(&spoolss_EnumPrinters_Type);
#endif
#ifdef PY_OPENPRINTER_PATCH
	PY_OPENPRINTER_PATCH(&spoolss_OpenPrinter_Type);
#endif
#ifdef PY_SETJOB_PATCH
	PY_SETJOB_PATCH(&spoolss_SetJob_Type);
#endif
#ifdef PY_GETJOB_PATCH
	PY_GETJOB_PATCH(&spoolss_GetJob_Type);
#endif
#ifdef PY_ENUMJOBS_PATCH
	PY_ENUMJOBS_PATCH(&spoolss_EnumJobs_Type);
#endif
#ifdef PY_ADDPRINTER_PATCH
	PY_ADDPRINTER_PATCH(&spoolss_AddPrinter_Type);
#endif
#ifdef PY_DELETEPRINTER_PATCH
	PY_DELETEPRINTER_PATCH(&spoolss_DeletePrinter_Type);
#endif
#ifdef PY_SETPRINTER_PATCH
	PY_SETPRINTER_PATCH(&spoolss_SetPrinter_Type);
#endif
#ifdef PY_GETPRINTER_PATCH
	PY_GETPRINTER_PATCH(&spoolss_GetPrinter_Type);
#endif
#ifdef PY_ADDPRINTERDRIVER_PATCH
	PY_ADDPRINTERDRIVER_PATCH(&spoolss_AddPrinterDriver_Type);
#endif
#ifdef PY_ENUMPRINTERDRIVERS_PATCH
	PY_ENUMPRINTERDRIVERS_PATCH(&spoolss_EnumPrinterDrivers_Type);
#endif
#ifdef PY_GETPRINTERDRIVER_PATCH
	PY_GETPRINTERDRIVER_PATCH(&spoolss_GetPrinterDriver_Type);
#endif
#ifdef PY_GETPRINTERDRIVERDIRECTORY_PATCH
	PY_GETPRINTERDRIVERDIRECTORY_PATCH(&spoolss_GetPrinterDriverDirectory_Type);
#endif
#ifdef PY_DELETEPRINTERDRIVER_PATCH
	PY_DELETEPRINTERDRIVER_PATCH(&spoolss_DeletePrinterDriver_Type);
#endif
#ifdef PY_ADDPRINTPROCESSOR_PATCH
	PY_ADDPRINTPROCESSOR_PATCH(&spoolss_AddPrintProcessor_Type);
#endif
#ifdef PY_ENUMPRINTPROCESSORS_PATCH
	PY_ENUMPRINTPROCESSORS_PATCH(&spoolss_EnumPrintProcessors_Type);
#endif
#ifdef PY_GETPRINTPROCESSORDIRECTORY_PATCH
	PY_GETPRINTPROCESSORDIRECTORY_PATCH(&spoolss_GetPrintProcessorDirectory_Type);
#endif
#ifdef PY_STARTDOCPRINTER_PATCH
	PY_STARTDOCPRINTER_PATCH(&spoolss_StartDocPrinter_Type);
#endif
#ifdef PY_STARTPAGEPRINTER_PATCH
	PY_STARTPAGEPRINTER_PATCH(&spoolss_StartPagePrinter_Type);
#endif
#ifdef PY_WRITEPRINTER_PATCH
	PY_WRITEPRINTER_PATCH(&spoolss_WritePrinter_Type);
#endif
#ifdef PY_ENDPAGEPRINTER_PATCH
	PY_ENDPAGEPRINTER_PATCH(&spoolss_EndPagePrinter_Type);
#endif
#ifdef PY_ABORTPRINTER_PATCH
	PY_ABORTPRINTER_PATCH(&spoolss_AbortPrinter_Type);
#endif
#ifdef PY_READPRINTER_PATCH
	PY_READPRINTER_PATCH(&spoolss_ReadPrinter_Type);
#endif
#ifdef PY_ENDDOCPRINTER_PATCH
	PY_ENDDOCPRINTER_PATCH(&spoolss_EndDocPrinter_Type);
#endif
#ifdef PY_ADDJOB_PATCH
	PY_ADDJOB_PATCH(&spoolss_AddJob_Type);
#endif
#ifdef PY_SCHEDULEJOB_PATCH
	PY_SCHEDULEJOB_PATCH(&spoolss_ScheduleJob_Type);
#endif
#ifdef PY_GETPRINTERDATA_PATCH
	PY_GETPRINTERDATA_PATCH(&spoolss_GetPrinterData_Type);
#endif
#ifdef PY_SETPRINTERDATA_PATCH
	PY_SETPRINTERDATA_PATCH(&spoolss_SetPrinterData_Type);
#endif
#ifdef PY_CLOSEPRINTER_PATCH
	PY_CLOSEPRINTER_PATCH(&spoolss_ClosePrinter_Type);
#endif
#ifdef PY_ADDFORM_PATCH
	PY_ADDFORM_PATCH(&spoolss_AddForm_Type);
#endif
#ifdef PY_DELETEFORM_PATCH
	PY_DELETEFORM_PATCH(&spoolss_DeleteForm_Type);
#endif
#ifdef PY_GETFORM_PATCH
	PY_GETFORM_PATCH(&spoolss_GetForm_Type);
#endif
#ifdef PY_SETFORM_PATCH
	PY_SETFORM_PATCH(&spoolss_SetForm_Type);
#endif
#ifdef PY_ENUMFORMS_PATCH
	PY_ENUMFORMS_PATCH(&spoolss_EnumForms_Type);
#endif
#ifdef PY_ENUMPORTS_PATCH
	PY_ENUMPORTS_PATCH(&spoolss_EnumPorts_Type);
#endif
#ifdef PY_ENUMMONITORS_PATCH
	PY_ENUMMONITORS_PATCH(&spoolss_EnumMonitors_Type);
#endif
#ifdef PY_ADDPORT_PATCH
	PY_ADDPORT_PATCH(&spoolss_AddPort_Type);
#endif
#ifdef PY_DELETEPORT_PATCH
	PY_DELETEPORT_PATCH(&spoolss_DeletePort_Type);
#endif
#ifdef PY_CREATEPRINTERIC_PATCH
	PY_CREATEPRINTERIC_PATCH(&spoolss_CreatePrinterIC_Type);
#endif
#ifdef PY_PLAYGDISCRIPTONPRINTERIC_PATCH
	PY_PLAYGDISCRIPTONPRINTERIC_PATCH(&spoolss_PlayGDIScriptOnPrinterIC_Type);
#endif
#ifdef PY_DELETEPRINTERIC_PATCH
	PY_DELETEPRINTERIC_PATCH(&spoolss_DeletePrinterIC_Type);
#endif
#ifdef PY_DELETEPRINTPROCESSOR_PATCH
	PY_DELETEPRINTPROCESSOR_PATCH(&spoolss_DeletePrintProcessor_Type);
#endif
#ifdef PY_ENUMPRINTPROCESSORDATATYPES_PATCH
	PY_ENUMPRINTPROCESSORDATATYPES_PATCH(&spoolss_EnumPrintProcessorDataTypes_Type);
#endif
#ifdef PY_RESETPRINTER_PATCH
	PY_RESETPRINTER_PATCH(&spoolss_ResetPrinter_Type);
#endif
#ifdef PY_GETPRINTERDRIVER2_PATCH
	PY_GETPRINTERDRIVER2_PATCH(&spoolss_GetPrinterDriver2_Type);
#endif
#ifdef PY_FINDCLOSEPRINTERNOTIFY_PATCH
	PY_FINDCLOSEPRINTERNOTIFY_PATCH(&spoolss_FindClosePrinterNotify_Type);
#endif
#ifdef PY_REPLYOPENPRINTER_PATCH
	PY_REPLYOPENPRINTER_PATCH(&spoolss_ReplyOpenPrinter_Type);
#endif
#ifdef PY_ROUTERREPLYPRINTER_PATCH
	PY_ROUTERREPLYPRINTER_PATCH(&spoolss_RouterReplyPrinter_Type);
#endif
#ifdef PY_REPLYCLOSEPRINTER_PATCH
	PY_REPLYCLOSEPRINTER_PATCH(&spoolss_ReplyClosePrinter_Type);
#endif
#ifdef PY_ADDPORTEX_PATCH
	PY_ADDPORTEX_PATCH(&spoolss_AddPortEx_Type);
#endif
#ifdef PY_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX_PATCH
	PY_REMOTEFINDFIRSTPRINTERCHANGENOTIFYEX_PATCH(&spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type);
#endif
#ifdef PY_ROUTERREPLYPRINTEREX_PATCH
	PY_ROUTERREPLYPRINTEREX_PATCH(&spoolss_RouterReplyPrinterEx_Type);
#endif
#ifdef PY_ROUTERREFRESHPRINTERCHANGENOTIFY_PATCH
	PY_ROUTERREFRESHPRINTERCHANGENOTIFY_PATCH(&spoolss_RouterRefreshPrinterChangeNotify_Type);
#endif
#ifdef PY_OPENPRINTEREX_PATCH
	PY_OPENPRINTEREX_PATCH(&spoolss_OpenPrinterEx_Type);
#endif
#ifdef PY_ADDPRINTEREX_PATCH
	PY_ADDPRINTEREX_PATCH(&spoolss_AddPrinterEx_Type);
#endif
#ifdef PY_SETPORT_PATCH
	PY_SETPORT_PATCH(&spoolss_SetPort_Type);
#endif
#ifdef PY_ENUMPRINTERDATA_PATCH
	PY_ENUMPRINTERDATA_PATCH(&spoolss_EnumPrinterData_Type);
#endif
#ifdef PY_DELETEPRINTERDATA_PATCH
	PY_DELETEPRINTERDATA_PATCH(&spoolss_DeletePrinterData_Type);
#endif
#ifdef PY_SETPRINTERDATAEX_PATCH
	PY_SETPRINTERDATAEX_PATCH(&spoolss_SetPrinterDataEx_Type);
#endif
#ifdef PY_GETPRINTERDATAEX_PATCH
	PY_GETPRINTERDATAEX_PATCH(&spoolss_GetPrinterDataEx_Type);
#endif
#ifdef PY_ENUMPRINTERDATAEX_PATCH
	PY_ENUMPRINTERDATAEX_PATCH(&spoolss_EnumPrinterDataEx_Type);
#endif
#ifdef PY_ENUMPRINTERKEY_PATCH
	PY_ENUMPRINTERKEY_PATCH(&spoolss_EnumPrinterKey_Type);
#endif
#ifdef PY_DELETEPRINTERDATAEX_PATCH
	PY_DELETEPRINTERDATAEX_PATCH(&spoolss_DeletePrinterDataEx_Type);
#endif
#ifdef PY_DELETEPRINTERKEY_PATCH
	PY_DELETEPRINTERKEY_PATCH(&spoolss_DeletePrinterKey_Type);
#endif
#ifdef PY_DELETEPRINTERDRIVEREX_PATCH
	PY_DELETEPRINTERDRIVEREX_PATCH(&spoolss_DeletePrinterDriverEx_Type);
#endif
#ifdef PY_ADDPERMACHINECONNECTION_PATCH
	PY_ADDPERMACHINECONNECTION_PATCH(&spoolss_AddPerMachineConnection_Type);
#endif
#ifdef PY_DELETEPERMACHINECONNECTION_PATCH
	PY_DELETEPERMACHINECONNECTION_PATCH(&spoolss_DeletePerMachineConnection_Type);
#endif
#ifdef PY_ENUMPERMACHINECONNECTIONS_PATCH
	PY_ENUMPERMACHINECONNECTIONS_PATCH(&spoolss_EnumPerMachineConnections_Type);
#endif
#ifdef PY_XCVDATA_PATCH
	PY_XCVDATA_PATCH(&spoolss_XcvData_Type);
#endif
#ifdef PY_ADDPRINTERDRIVEREX_PATCH
	PY_ADDPRINTERDRIVEREX_PATCH(&spoolss_AddPrinterDriverEx_Type);
#endif
#ifdef PY_SENDRECVBIDIDATA_PATCH
	PY_SENDRECVBIDIDATA_PATCH(&spoolss_SendRecvBidiData_Type);
#endif
#ifdef PY_GETCOREPRINTERDRIVERS_PATCH
	PY_GETCOREPRINTERDRIVERS_PATCH(&spoolss_GetCorePrinterDrivers_Type);
#endif
#ifdef PY_GETPRINTERDRIVERPACKAGEPATH_PATCH
	PY_GETPRINTERDRIVERPACKAGEPATH_PATCH(&spoolss_GetPrinterDriverPackagePath_Type);
#endif
#ifdef PY_GETJOBNAMEDPROPERTYVALUE_PATCH
	PY_GETJOBNAMEDPROPERTYVALUE_PATCH(&spoolss_GetJobNamedPropertyValue_Type);
#endif
#ifdef PY_SETJOBNAMEDPROPERTY_PATCH
	PY_SETJOBNAMEDPROPERTY_PATCH(&spoolss_SetJobNamedProperty_Type);
#endif
#ifdef PY_DELETEJOBNAMEDPROPERTY_PATCH
	PY_DELETEJOBNAMEDPROPERTY_PATCH(&spoolss_DeleteJobNamedProperty_Type);
#endif
#ifdef PY_ENUMJOBNAMEDPROPERTIES_PATCH
	PY_ENUMJOBNAMEDPROPERTIES_PATCH(&spoolss_EnumJobNamedProperties_Type);
#endif
#ifdef PY_LOGJOBINFOFORBRANCHOFFICE_PATCH
	PY_LOGJOBINFOFORBRANCHOFFICE_PATCH(&spoolss_LogJobInfoForBranchOffice_Type);
#endif
#ifdef PY_SPOOLSS_PATCH
	PY_SPOOLSS_PATCH(&spoolss_InterfaceType);
#endif
#ifdef PY_SPOOLSS_ABSTRACT_SYNTAX_PATCH
	PY_SPOOLSS_ABSTRACT_SYNTAX_PATCH(&spoolss_SyntaxType);
#endif
#ifdef PY_ABSTRACT_SYNTAX_PATCH
	PY_ABSTRACT_SYNTAX_PATCH(&spoolss_SyntaxType);
#endif

	m = PyModule_Create(&moduledef);
	if (m == NULL)
		goto out;

	PyModule_AddObject(m, "PRINTER_STATUS_OK", PyLong_FromUnsignedLongLong(0x00000000));
	PyModule_AddObject(m, "JOB_STATUS_QUEUED", PyLong_FromUnsignedLongLong(0x0000));
	PyModule_AddObject(m, "MAXDEVICENAME", PyLong_FromUnsignedLongLong(32));
	PyModule_AddObject(m, "PRINTER_ENUM_ICONMASK", PyLong_FromLong((PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8)));
	PyModule_AddObject(m, "SPL_ARCH_WIN40", PyUnicode_FromString("WIN40"));
	PyModule_AddObject(m, "SPL_ARCH_W32X86", PyUnicode_FromString("W32X86"));
	PyModule_AddObject(m, "SPL_ARCH_W32MIPS", PyUnicode_FromString("W32MIPS"));
	PyModule_AddObject(m, "SPL_ARCH_W32ALPHA", PyUnicode_FromString("W32ALPHA"));
	PyModule_AddObject(m, "SPL_ARCH_W32PPC", PyUnicode_FromString("W32PPC"));
	PyModule_AddObject(m, "SPL_ARCH_IA64", PyUnicode_FromString("IA64"));
	PyModule_AddObject(m, "SPL_ARCH_X64", PyUnicode_FromString("x64"));
	PyModule_AddObject(m, "SPL_ARCH_ARM", PyUnicode_FromString("ARM"));
	PyModule_AddObject(m, "SPL_ARCH_ARM64", PyUnicode_FromString("ARM64"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_ALL", PyUnicode_FromString("All"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_ALL_CLUSTER", PyUnicode_FromString("AllCluster"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_NT_X86", PyUnicode_FromString("Windows NT x86"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_IA_64", PyUnicode_FromString("Windows IA64"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_x64", PyUnicode_FromString("Windows x64"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_4_0", PyUnicode_FromString("Windows 4.0"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_W32MIPS", PyUnicode_FromString("Windows NT R4000"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_W32PPC", PyUnicode_FromString("Windows NT PowerPC"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_W32ALPHA", PyUnicode_FromString("Windows NT Alpha AXP"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_ARM", PyUnicode_FromString("Windows ARM"));
	PyModule_AddObject(m, "SPOOLSS_ARCHITECTURE_ARM64", PyUnicode_FromString("Windows ARM64"));
	PyModule_AddObject(m, "SPOOLSS_DEFAULT_SERVER_PATH", PyUnicode_FromString("C:\\WINDOWS\\system32\\spool"));
	PyModule_AddObject(m, "SPOOL_PRINTERDATA_KEY", PyUnicode_FromString("PrinterDriverData"));
	PyModule_AddObject(m, "SPOOL_DSSPOOLER_KEY", PyUnicode_FromString("DsSpooler"));
	PyModule_AddObject(m, "SPOOL_DSDRIVER_KEY", PyUnicode_FromString("DsDriver"));
	PyModule_AddObject(m, "SPOOL_DSUSER_KEY", PyUnicode_FromString("DsUser"));
	PyModule_AddObject(m, "SPOOL_PNPDATA_KEY", PyUnicode_FromString("PnPData"));
	PyModule_AddObject(m, "SPOOL_OID_KEY", PyUnicode_FromString("OID"));
	PyModule_AddObject(m, "SPOOL_REG_ASSETNUMBER", PyUnicode_FromString("assetNumber"));
	PyModule_AddObject(m, "SPOOL_REG_BYTESPERMINUTE", PyUnicode_FromString("bytesPerMinute"));
	PyModule_AddObject(m, "SPOOL_REG_DEFAULTPRIORITY", PyUnicode_FromString("defaultPriority"));
	PyModule_AddObject(m, "SPOOL_REG_DESCRIPTION", PyUnicode_FromString("description"));
	PyModule_AddObject(m, "SPOOL_REG_DRIVERNAME", PyUnicode_FromString("driverName"));
	PyModule_AddObject(m, "SPOOL_REG_DRIVERVERSION", PyUnicode_FromString("driverVersion"));
	PyModule_AddObject(m, "SPOOL_REG_FLAGS", PyUnicode_FromString("flags"));
	PyModule_AddObject(m, "SPOOL_REG_LOCATION", PyUnicode_FromString("location"));
	PyModule_AddObject(m, "SPOOL_REG_OPERATINGSYSTEM", PyUnicode_FromString("operatingSystem"));
	PyModule_AddObject(m, "SPOOL_REG_OPERATINGSYSTEMHOTFIX", PyUnicode_FromString("operatingSystemHotfix"));
	PyModule_AddObject(m, "SPOOL_REG_OPERATINGSYSTEMSERVICEPACK", PyUnicode_FromString("operatingSystemServicePack"));
	PyModule_AddObject(m, "SPOOL_REG_OPERATINGSYSTEMVERSION", PyUnicode_FromString("operatingSystemVersion"));
	PyModule_AddObject(m, "SPOOL_REG_PORTNAME", PyUnicode_FromString("portName"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTATTRIBUTES", PyUnicode_FromString("printAttributes"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTBINNAMES", PyUnicode_FromString("printBinNames"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTCOLLATE", PyUnicode_FromString("printCollate"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTCOLOR", PyUnicode_FromString("printColor"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTDUPLEXSUPPORTED", PyUnicode_FromString("printDuplexSupported"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTENDTIME", PyUnicode_FromString("printEndTime"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTERNAME", PyUnicode_FromString("printerName"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTFORMNAME", PyUnicode_FromString("printFormName"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTKEEPPRINTEDJOBS", PyUnicode_FromString("printKeepPrintedJobs"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTLANGUAGE", PyUnicode_FromString("printLanguage"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMACADDRESS", PyUnicode_FromString("printMACAddress"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMAXCOPIES", PyUnicode_FromString("printMaxCopies"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMAXRESOLUTIONSUPPORTED", PyUnicode_FromString("printMaxResolutionSupported"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMAXXEXTENT", PyUnicode_FromString("printMaxXExtent"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMAXYEXTENT", PyUnicode_FromString("printMaxYExtent"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMEDIAREADY", PyUnicode_FromString("printMediaReady"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMEDIASUPPORTED", PyUnicode_FromString("printMediaSupported"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMEMORY", PyUnicode_FromString("printMemory"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMINXEXTENT", PyUnicode_FromString("printMinXExtent"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTMINYEXTENT", PyUnicode_FromString("printMinYExtent"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTNETWORKADDRESS", PyUnicode_FromString("printNetworkAddress"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTNOTIFY", PyUnicode_FromString("printNotify"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTNUMBERUP", PyUnicode_FromString("printNumberUp"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTORIENTATIONSSUPPORTED", PyUnicode_FromString("printOrientationsSupported"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTOWNER", PyUnicode_FromString("printOwner"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTPAGESPERMINUTE", PyUnicode_FromString("printPagesPerMinute"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTRATE", PyUnicode_FromString("printRate"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTRATEUNIT", PyUnicode_FromString("printRateUnit"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSEPARATORFILE", PyUnicode_FromString("printSeparatorFile"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSHARENAME", PyUnicode_FromString("printShareName"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSPOOLING", PyUnicode_FromString("printSpooling"));
	PyModule_AddObject(m, "SPOOL_REGVAL_PRINTWHILESPOOLING", PyUnicode_FromString("PrintWhileSpooling"));
	PyModule_AddObject(m, "SPOOL_REGVAL_PRINTAFTERSPOOLED", PyUnicode_FromString("PrintAfterSpooled"));
	PyModule_AddObject(m, "SPOOL_REGVAL_PRINTDIRECT", PyUnicode_FromString("PrintDirect"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSTAPLINGSUPPORTED", PyUnicode_FromString("printStaplingSupported"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSTARTTIME", PyUnicode_FromString("printStartTime"));
	PyModule_AddObject(m, "SPOOL_REG_PRINTSTATUS", PyUnicode_FromString("printStatus"));
	PyModule_AddObject(m, "SPOOL_REG_PRIORITY", PyUnicode_FromString("priority"));
	PyModule_AddObject(m, "SPOOL_REG_SERVERNAME", PyUnicode_FromString("serverName"));
	PyModule_AddObject(m, "SPOOL_REG_SHORTSERVERNAME", PyUnicode_FromString("shortServerName"));
	PyModule_AddObject(m, "SPOOL_REG_UNCNAME", PyUnicode_FromString("uNCName"));
	PyModule_AddObject(m, "SPOOL_REG_URL", PyUnicode_FromString("url"));
	PyModule_AddObject(m, "SPOOL_REG_VERSIONNUMBER", PyUnicode_FromString("versionNumber"));
	PyModule_AddObject(m, "SPL_LOCAL_PORT", PyUnicode_FromString("Local Port"));
	PyModule_AddObject(m, "SPL_TCPIP_PORT", PyUnicode_FromString("Standard TCP/IP Port"));
	PyModule_AddObject(m, "SPL_XCV_MONITOR_LOCALMON", PyUnicode_FromString(",XcvMonitor Local Port"));
	PyModule_AddObject(m, "SPL_XCV_MONITOR_TCPMON", PyUnicode_FromString(",XcvMonitor Standard TCP/IP Port"));
	PyModule_AddObject(m, "PRINTER_CHANGE_PRINTER", PyLong_FromUnsignedLongLong(0x000000FF));
	PyModule_AddObject(m, "PRINTER_CHANGE_JOB", PyLong_FromUnsignedLongLong(0x0000FF00));
	PyModule_AddObject(m, "PRINTER_CHANGE_FORM", PyLong_FromLong((PRINTER_CHANGE_ADD_FORM|PRINTER_CHANGE_SET_FORM|PRINTER_CHANGE_DELETE_FORM)));
	PyModule_AddObject(m, "PRINTER_CHANGE_PORT", PyLong_FromLong((PRINTER_CHANGE_ADD_PORT|PRINTER_CHANGE_CONFIGURE_PORT|PRINTER_CHANGE_DELETE_PORT)));
	PyModule_AddObject(m, "PRINTER_CHANGE_PRINT_PROCESSOR", PyLong_FromUnsignedLongLong(0x07000000));
	PyModule_AddObject(m, "PRINTER_CHANGE_PRINTER_DRIVER", PyLong_FromLong((PRINTER_CHANGE_ADD_PRINTER_DRIVER|PRINTER_CHANGE_SET_PRINTER_DRIVER|PRINTER_CHANGE_DELETE_PRINTER_DRIVER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ALL", PyLong_FromLong((PRINTER_CHANGE_PRINTER|PRINTER_CHANGE_JOB|PRINTER_CHANGE_FORM|PRINTER_CHANGE_PORT|PRINTER_CHANGE_PRINT_PROCESSOR|PRINTER_CHANGE_PRINTER_DRIVER)));
	PyModule_AddObject(m, "SERVER_ALL_ACCESS", PyLong_FromLong(SEC_STD_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE));
	PyModule_AddObject(m, "SERVER_READ", PyLong_FromLong(SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE));
	PyModule_AddObject(m, "SERVER_WRITE", PyLong_FromLong(STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE));
	PyModule_AddObject(m, "SERVER_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE));
	PyModule_AddObject(m, "PRINTER_ALL_ACCESS", PyLong_FromLong(SEC_STD_REQUIRED|PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE));
	PyModule_AddObject(m, "PRINTER_READ", PyLong_FromLong(SEC_STD_READ_CONTROL|PRINTER_ACCESS_USE));
	PyModule_AddObject(m, "PRINTER_WRITE", PyLong_FromLong(STANDARD_RIGHTS_WRITE_ACCESS|PRINTER_ACCESS_USE));
	PyModule_AddObject(m, "PRINTER_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|PRINTER_ACCESS_USE));
	PyModule_AddObject(m, "JOB_ALL_ACCESS", PyLong_FromLong(SEC_STD_REQUIRED|JOB_ACCESS_ADMINISTER));
	PyModule_AddObject(m, "JOB_READ", PyLong_FromLong(SEC_STD_READ_CONTROL|JOB_ACCESS_ADMINISTER));
	PyModule_AddObject(m, "JOB_WRITE", PyLong_FromLong(STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER));
	PyModule_AddObject(m, "JOB_EXECUTE", PyLong_FromLong(SEC_STD_READ_CONTROL|JOB_ACCESS_ADMINISTER));
	PyModule_AddObject(m, "PRINTER_ACE_FULL_CONTROL", PyLong_FromLong(SEC_GENERIC_ALL|PRINTER_ALL_ACCESS));
	PyModule_AddObject(m, "PRINTER_ACE_MANAGE_DOCUMENTS", PyLong_FromLong(SEC_GENERIC_ALL|SEC_STD_READ_CONTROL));
	PyModule_AddObject(m, "PRINTER_ACE_PRINT", PyLong_FromLong(SEC_GENERIC_EXECUTE|SEC_STD_READ_CONTROL|PRINTER_ACCESS_USE));
	PyModule_AddObject(m, "BIDI_ACTION_ENUM_SCHEMA", PyUnicode_FromString("EnumSchema"));
	PyModule_AddObject(m, "BIDI_ACTION_GET", PyUnicode_FromString("Get"));
	PyModule_AddObject(m, "BIDI_ACTION_SET", PyUnicode_FromString("Set"));
	PyModule_AddObject(m, "BIDI_ACTION_GET_ALL", PyUnicode_FromString("GetAll"));
	PyModule_AddObject(m, "SPOOLSS_CORE_PRINT_PACKAGE_FILES_UNIDRV", PyUnicode_FromString("{D20EA372-DD35-4950-9ED8-A6335AFE79F0}"));
	PyModule_AddObject(m, "SPOOLSS_CORE_PRINT_PACKAGE_FILES_PSCRIPT", PyUnicode_FromString("{D20EA372-DD35-4950-9ED8-A6335AFE79F1}"));
	PyModule_AddObject(m, "SPOOLSS_CORE_PRINT_PACKAGE_FILES_PCLXL", PyUnicode_FromString("{D20EA372-DD35-4950-9ED8-A6335AFE79F2}"));
	PyModule_AddObject(m, "SPOOLSS_CORE_PRINT_PACKAGE_FILES_PLOTTER", PyUnicode_FromString("{D20EA372-DD35-4950-9ED8-A6335AFE79F4}"));
	PyModule_AddObject(m, "SPOOLSS_CORE_PRINT_PACKAGE_FILES_XPSDRV", PyUnicode_FromString("{D20EA372-DD35-4950-9ED8-A6335AFE79F5}"));
	PyModule_AddObject(m, "SPLFILE_CONTENT_TYPE_PROP_NAME", PyUnicode_FromString("Spool File Contents"));
	PyModule_AddObject(m, "SPLFILE_CONTENT_TYPE_XPS_MS", PyUnicode_FromString("TYPE_XPS_MS"));
	PyModule_AddObject(m, "SPLFILE_CONTENT_TYPE_XPS_OPEN", PyUnicode_FromString("TYPE_XPS_OPEN"));
	PyModule_AddObject(m, "SPLFILE_CONTENT_TYPE_PDL_POSTSCRIPT", PyUnicode_FromString("TYPE_PDL_POSTSCRIPT"));
	PyModule_AddObject(m, "SPLFILE_CONTENT_TYPE_PDL_UNKNOWN", PyUnicode_FromString("TYPE_PDL_UNKNOWN"));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_INTEL", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_INTEL)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_MIPS", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_MIPS)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_ALPHA", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_ALPHA)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_PPC", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_PPC)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_SHX", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_SHX)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_ARM", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_ARM)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_IA64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_IA64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_ALPHA64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_ALPHA64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_MSIL", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_MSIL)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_AMD64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_AMD64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_IA32_ON_WIN64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_IA32_ON_WIN64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_NEUTRAL", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_NEUTRAL)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_ARM64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_ARM64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_IA32_ON_ARM64", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_IA32_ON_ARM64)));
	PyModule_AddObject(m, "PROCESSOR_ARCHITECTURE_UNKNOWN", PyLong_FromLong((uint16_t)(PROCESSOR_ARCHITECTURE_UNKNOWN)));
	PyModule_AddObject(m, "PROCESSOR_INTEL_386", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_INTEL_386)));
	PyModule_AddObject(m, "PROCESSOR_INTEL_486", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_INTEL_486)));
	PyModule_AddObject(m, "PROCESSOR_INTEL_PENTIUM", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_INTEL_PENTIUM)));
	PyModule_AddObject(m, "PROCESSOR_INTEL_860", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_INTEL_860)));
	PyModule_AddObject(m, "PROCESSOR_INTEL_IA64", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_INTEL_IA64)));
	PyModule_AddObject(m, "PROCESSOR_AMD_X8664", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_AMD_X8664)));
	PyModule_AddObject(m, "PROCESSOR_MIPS_R2000", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_MIPS_R2000)));
	PyModule_AddObject(m, "PROCESSOR_MIPS_R3000", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_MIPS_R3000)));
	PyModule_AddObject(m, "PROCESSOR_ALPHA_21064", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_ALPHA_21064)));
	PyModule_AddObject(m, "PROCESSOR_PPC_601", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_PPC_601)));
	PyModule_AddObject(m, "PROCESSOR_PPC_603", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_PPC_603)));
	PyModule_AddObject(m, "PROCESSOR_PPC_604", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_PPC_604)));
	PyModule_AddObject(m, "PROCESSOR_PPC_620", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_PPC_620)));
	PyModule_AddObject(m, "PROCESSOR_HITACHI_SH3", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_HITACHI_SH3)));
	PyModule_AddObject(m, "PROCESSOR_HITACHI_SH3E", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_HITACHI_SH3E)));
	PyModule_AddObject(m, "PROCESSOR_HITACHI_SH4", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_HITACHI_SH4)));
	PyModule_AddObject(m, "PROCESSOR_MOTOROLA_821", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_MOTOROLA_821)));
	PyModule_AddObject(m, "PROCESSOR_STRONGARM", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_STRONGARM)));
	PyModule_AddObject(m, "PROCESSOR_ARM720", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_ARM720)));
	PyModule_AddObject(m, "PROCESSOR_ARM820", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_ARM820)));
	PyModule_AddObject(m, "PROCESSOR_ARM920", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_ARM920)));
	PyModule_AddObject(m, "PROCESSOR_ARM_7TDMI", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_ARM_7TDMI)));
	PyModule_AddObject(m, "PROCESSOR_OPTIL", PyLong_FromUnsignedLongLong((uint32_t)(PROCESSOR_OPTIL)));
	PyModule_AddObject(m, "SPOOLSS_MAJOR_VERSION_NT4_95_98_ME", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MAJOR_VERSION_NT4_95_98_ME)));
	PyModule_AddObject(m, "SPOOLSS_MAJOR_VERSION_2000_2003_XP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MAJOR_VERSION_2000_2003_XP)));
	PyModule_AddObject(m, "SPOOLSS_MAJOR_VERSION_2008_VISTA", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MAJOR_VERSION_2008_VISTA)));
	PyModule_AddObject(m, "SPOOLSS_MINOR_VERSION_0", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MINOR_VERSION_0)));
	PyModule_AddObject(m, "SPOOLSS_MINOR_VERSION_XP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MINOR_VERSION_XP)));
	PyModule_AddObject(m, "SPOOLSS_MINOR_VERSION_2003_XP64", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MINOR_VERSION_2003_XP64)));
	PyModule_AddObject(m, "SPOOLSS_MINOR_VERSION_98", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MINOR_VERSION_98)));
	PyModule_AddObject(m, "SPOOLSS_MINOR_VERSION_ME", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_MINOR_VERSION_ME)));
	PyModule_AddObject(m, "PRINTER_STATUS_PAUSED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PAUSED)));
	PyModule_AddObject(m, "PRINTER_STATUS_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_ERROR)));
	PyModule_AddObject(m, "PRINTER_STATUS_PENDING_DELETION", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PENDING_DELETION)));
	PyModule_AddObject(m, "PRINTER_STATUS_PAPER_JAM", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PAPER_JAM)));
	PyModule_AddObject(m, "PRINTER_STATUS_PAPER_OUT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PAPER_OUT)));
	PyModule_AddObject(m, "PRINTER_STATUS_MANUAL_FEED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_MANUAL_FEED)));
	PyModule_AddObject(m, "PRINTER_STATUS_PAPER_PROBLEM", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PAPER_PROBLEM)));
	PyModule_AddObject(m, "PRINTER_STATUS_OFFLINE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_OFFLINE)));
	PyModule_AddObject(m, "PRINTER_STATUS_IO_ACTIVE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_IO_ACTIVE)));
	PyModule_AddObject(m, "PRINTER_STATUS_BUSY", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_BUSY)));
	PyModule_AddObject(m, "PRINTER_STATUS_PRINTING", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PRINTING)));
	PyModule_AddObject(m, "PRINTER_STATUS_OUTPUT_BIN_FULL", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_OUTPUT_BIN_FULL)));
	PyModule_AddObject(m, "PRINTER_STATUS_NOT_AVAILABLE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_NOT_AVAILABLE)));
	PyModule_AddObject(m, "PRINTER_STATUS_WAITING", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_WAITING)));
	PyModule_AddObject(m, "PRINTER_STATUS_PROCESSING", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PROCESSING)));
	PyModule_AddObject(m, "PRINTER_STATUS_INITIALIZING", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_INITIALIZING)));
	PyModule_AddObject(m, "PRINTER_STATUS_WARMING_UP", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_WARMING_UP)));
	PyModule_AddObject(m, "PRINTER_STATUS_TONER_LOW", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_TONER_LOW)));
	PyModule_AddObject(m, "PRINTER_STATUS_NO_TONER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_NO_TONER)));
	PyModule_AddObject(m, "PRINTER_STATUS_PAGE_PUNT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_PAGE_PUNT)));
	PyModule_AddObject(m, "PRINTER_STATUS_USER_INTERVENTION", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_USER_INTERVENTION)));
	PyModule_AddObject(m, "PRINTER_STATUS_OUT_OF_MEMORY", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_OUT_OF_MEMORY)));
	PyModule_AddObject(m, "PRINTER_STATUS_DOOR_OPEN", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_DOOR_OPEN)));
	PyModule_AddObject(m, "PRINTER_STATUS_SERVER_UNKNOWN", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_SERVER_UNKNOWN)));
	PyModule_AddObject(m, "PRINTER_STATUS_POWER_SAVE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_STATUS_POWER_SAVE)));
	PyModule_AddObject(m, "JOB_STATUS_PAUSED", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_PAUSED)));
	PyModule_AddObject(m, "JOB_STATUS_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_ERROR)));
	PyModule_AddObject(m, "JOB_STATUS_DELETING", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_DELETING)));
	PyModule_AddObject(m, "JOB_STATUS_SPOOLING", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_SPOOLING)));
	PyModule_AddObject(m, "JOB_STATUS_PRINTING", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_PRINTING)));
	PyModule_AddObject(m, "JOB_STATUS_OFFLINE", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_OFFLINE)));
	PyModule_AddObject(m, "JOB_STATUS_PAPEROUT", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_PAPEROUT)));
	PyModule_AddObject(m, "JOB_STATUS_PRINTED", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_PRINTED)));
	PyModule_AddObject(m, "JOB_STATUS_DELETED", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_DELETED)));
	PyModule_AddObject(m, "JOB_STATUS_BLOCKED_DEVQ", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_BLOCKED_DEVQ)));
	PyModule_AddObject(m, "JOB_STATUS_USER_INTERVENTION", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_USER_INTERVENTION)));
	PyModule_AddObject(m, "JOB_STATUS_RESTART", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_RESTART)));
	PyModule_AddObject(m, "JOB_STATUS_COMPLETE", PyLong_FromUnsignedLongLong((uint32_t)(JOB_STATUS_COMPLETE)));
	PyModule_AddObject(m, "SPOOLSS_DEBUGGING_BUILD", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DEBUGGING_BUILD)));
	PyModule_AddObject(m, "SPOOLSS_RELEASE_BUILD", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_RELEASE_BUILD)));
	PyModule_AddObject(m, "SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_SIGNATURE_UNIDRVEXTRA)));
	PyModule_AddObject(m, "SPOOLSS_DM_SIGNATURE_JTEXP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_SIGNATURE_JTEXP)));
	PyModule_AddObject(m, "SPOOLSS_DM_SIGNATURE_PSEXTRA", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_SIGNATURE_PSEXTRA)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_DISABLED", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_DISABLED)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_2", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_2)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_4", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_4)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_6", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_6)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_9", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_9)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_NUP_16", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_NUP_16)));
	PyModule_AddObject(m, "SPOOLSS_DM_LAYOUT_BOOKLET", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_LAYOUT_BOOKLET)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_DIRECTION_L2R_T2B", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_DIRECTION_L2R_T2B)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_DIRECTION_T2B_L2R", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_DIRECTION_T2B_L2R)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_DIRECTION_R2L_T2B", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_DIRECTION_R2L_T2B)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_DIRECTION_T2B_R2L", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_DIRECTION_T2B_R2L)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_BORDER_PRINT", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_BORDER_PRINT)));
	PyModule_AddObject(m, "SPOOLSS_DM_NUP_BORDER_NONE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_NUP_BORDER_NONE)));
	PyModule_AddObject(m, "SPOOLSS_DM_BOOKLET_LEFT_FLIP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_BOOKLET_LEFT_FLIP)));
	PyModule_AddObject(m, "SPOOLSS_DM_BOOKLET_RIGHT_FLIP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_BOOKLET_RIGHT_FLIP)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_DRV_ERROR_HANDLER", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_DRV_ERROR_HANDLER)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_PRINT_MIRROR", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_PRINT_MIRROR)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_PRINT_NEGATIVE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_PRINT_NEGATIVE)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_COMPRESS_BITMAP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_COMPRESS_BITMAP)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_ROTATE_180", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_ROTATE_180)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FLAGS_GDI_METAFILE_SPOOL", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_FLAGS_GDI_METAFILE_SPOOL)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_OPTIMIZE_SPEED", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_OPTIMIZE_SPEED)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_OPTIMIZE_PORTABILITY", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_OPTIMIZE_PORTABILITY)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_OPTIMIZE_EPS", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_OPTIMIZE_EPS)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_OPTIMIZE_ARCHIVAL", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_OPTIMIZE_ARCHIVAL)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_TTDLFMT_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_TTDLFMT_DEFAULT)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_TTDLFMT_TYPE_1", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_TTDLFMT_TYPE_1)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_TTDLFMT_TYPE_3", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_TTDLFMT_TYPE_3)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_TTDLFMT_TYPE_42", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_TTDLFMT_TYPE_42)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_PSLEVEL_1", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_PSLEVEL_1)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_PSLEVEL_2", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_PSLEVEL_2)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_PSLEVEL_3", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_PS_PSLEVEL_3)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST", PyLong_FromLong((uint16_t)(SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST", PyLong_FromLong((uint16_t)(SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST_UPSIDEDOWN", PyLong_FromLong((uint16_t)(SPOOLSS_DM_PS_FEED_DIRECTION_LONG_EDGE_FIRST_UPSIDEDOWN)));
	PyModule_AddObject(m, "SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST_UPSIDEDOWN", PyLong_FromLong((uint16_t)(SPOOLSS_DM_PS_FEED_DIRECTION_SHORT_EDGE_FIRST_UPSIDEDOWN)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_QUALITY_BEST", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_QUALITY_BEST)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_QUALITY_MEDIUM", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_QUALITY_MEDIUM)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_QUALITY_DRAFT", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_QUALITY_DRAFT)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_FLAGS_PRINT_TEXT_AS_GRAPHICS", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_FLAGS_PRINT_TEXT_AS_GRAPHICS)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_FLAGS_AVOID_EMFSPOOL", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_FLAGS_AVOID_EMFSPOOL)));
	PyModule_AddObject(m, "SPOOLSS_DM_UNI_FLAGS_CUSTOM_HALFTONING", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DM_UNI_FLAGS_CUSTOM_HALFTONING)));
	PyModule_AddObject(m, "DEVMODE_ORIENTATION", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_ORIENTATION)));
	PyModule_AddObject(m, "DEVMODE_PAPERSIZE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PAPERSIZE)));
	PyModule_AddObject(m, "DEVMODE_PAPERLENGTH", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PAPERLENGTH)));
	PyModule_AddObject(m, "DEVMODE_PAPERWIDTH", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PAPERWIDTH)));
	PyModule_AddObject(m, "DEVMODE_SCALE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_SCALE)));
	PyModule_AddObject(m, "DEVMODE_POSITION", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_POSITION)));
	PyModule_AddObject(m, "DEVMODE_NUP", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_NUP)));
	PyModule_AddObject(m, "DEVMODE_COPIES", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_COPIES)));
	PyModule_AddObject(m, "DEVMODE_DEFAULTSOURCE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_DEFAULTSOURCE)));
	PyModule_AddObject(m, "DEVMODE_PRINTQUALITY", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PRINTQUALITY)));
	PyModule_AddObject(m, "DEVMODE_COLOR", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_COLOR)));
	PyModule_AddObject(m, "DEVMODE_DUPLEX", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_DUPLEX)));
	PyModule_AddObject(m, "DEVMODE_YRESOLUTION", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_YRESOLUTION)));
	PyModule_AddObject(m, "DEVMODE_TTOPTION", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_TTOPTION)));
	PyModule_AddObject(m, "DEVMODE_COLLATE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_COLLATE)));
	PyModule_AddObject(m, "DEVMODE_FORMNAME", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_FORMNAME)));
	PyModule_AddObject(m, "DEVMODE_LOGPIXELS", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_LOGPIXELS)));
	PyModule_AddObject(m, "DEVMODE_BITSPERPEL", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_BITSPERPEL)));
	PyModule_AddObject(m, "DEVMODE_PELSWIDTH", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PELSWIDTH)));
	PyModule_AddObject(m, "DEVMODE_PELSHEIGHT", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PELSHEIGHT)));
	PyModule_AddObject(m, "DEVMODE_DISPLAYFLAGS", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_DISPLAYFLAGS)));
	PyModule_AddObject(m, "DEVMODE_DISPLAYFREQUENCY", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_DISPLAYFREQUENCY)));
	PyModule_AddObject(m, "DEVMODE_ICMMETHOD", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_ICMMETHOD)));
	PyModule_AddObject(m, "DEVMODE_ICMINTENT", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_ICMINTENT)));
	PyModule_AddObject(m, "DEVMODE_MEDIATYPE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_MEDIATYPE)));
	PyModule_AddObject(m, "DEVMODE_DITHERTYPE", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_DITHERTYPE)));
	PyModule_AddObject(m, "DEVMODE_PANNINGWIDTH", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PANNINGWIDTH)));
	PyModule_AddObject(m, "DEVMODE_PANNINGHEIGHT", PyLong_FromUnsignedLongLong((uint32_t)(DEVMODE_PANNINGHEIGHT)));
	PyModule_AddObject(m, "DMSPEC_NT3", PyLong_FromLong((uint16_t)(DMSPEC_NT3)));
	PyModule_AddObject(m, "DMSPEC_WIN95_98_ME", PyLong_FromLong((uint16_t)(DMSPEC_WIN95_98_ME)));
	PyModule_AddObject(m, "DMSPEC_NT4_AND_ABOVE", PyLong_FromLong((uint16_t)(DMSPEC_NT4_AND_ABOVE)));
	PyModule_AddObject(m, "DMORIENT_PORTRAIT", PyLong_FromLong((uint16_t)(DMORIENT_PORTRAIT)));
	PyModule_AddObject(m, "DMORIENT_LANDSCAPE", PyLong_FromLong((uint16_t)(DMORIENT_LANDSCAPE)));
	PyModule_AddObject(m, "DMPAPER_LETTER", PyLong_FromLong((uint16_t)(DMPAPER_LETTER)));
	PyModule_AddObject(m, "DMPAPER_LETTERSMALL", PyLong_FromLong((uint16_t)(DMPAPER_LETTERSMALL)));
	PyModule_AddObject(m, "DMPAPER_TABLOID", PyLong_FromLong((uint16_t)(DMPAPER_TABLOID)));
	PyModule_AddObject(m, "DMPAPER_LEDGER", PyLong_FromLong((uint16_t)(DMPAPER_LEDGER)));
	PyModule_AddObject(m, "DMPAPER_LEGAL", PyLong_FromLong((uint16_t)(DMPAPER_LEGAL)));
	PyModule_AddObject(m, "DMPAPER_STATEMENT", PyLong_FromLong((uint16_t)(DMPAPER_STATEMENT)));
	PyModule_AddObject(m, "DMPAPER_EXECUTIVE", PyLong_FromLong((uint16_t)(DMPAPER_EXECUTIVE)));
	PyModule_AddObject(m, "DMPAPER_A3", PyLong_FromLong((uint16_t)(DMPAPER_A3)));
	PyModule_AddObject(m, "DMPAPER_A4", PyLong_FromLong((uint16_t)(DMPAPER_A4)));
	PyModule_AddObject(m, "DMPAPER_A4SMALL", PyLong_FromLong((uint16_t)(DMPAPER_A4SMALL)));
	PyModule_AddObject(m, "DMPAPER_A5", PyLong_FromLong((uint16_t)(DMPAPER_A5)));
	PyModule_AddObject(m, "DMPAPER_B4", PyLong_FromLong((uint16_t)(DMPAPER_B4)));
	PyModule_AddObject(m, "DMPAPER_B5", PyLong_FromLong((uint16_t)(DMPAPER_B5)));
	PyModule_AddObject(m, "DMPAPER_FOLIO", PyLong_FromLong((uint16_t)(DMPAPER_FOLIO)));
	PyModule_AddObject(m, "DMPAPER_QUARTO", PyLong_FromLong((uint16_t)(DMPAPER_QUARTO)));
	PyModule_AddObject(m, "DMPAPER_10X14", PyLong_FromLong((uint16_t)(DMPAPER_10X14)));
	PyModule_AddObject(m, "DMPAPER_11X17", PyLong_FromLong((uint16_t)(DMPAPER_11X17)));
	PyModule_AddObject(m, "DMPAPER_NOTE", PyLong_FromLong((uint16_t)(DMPAPER_NOTE)));
	PyModule_AddObject(m, "DMPAPER_ENV_9", PyLong_FromLong((uint16_t)(DMPAPER_ENV_9)));
	PyModule_AddObject(m, "DMPAPER_ENV_10", PyLong_FromLong((uint16_t)(DMPAPER_ENV_10)));
	PyModule_AddObject(m, "DMPAPER_ENV_11", PyLong_FromLong((uint16_t)(DMPAPER_ENV_11)));
	PyModule_AddObject(m, "DMPAPER_ENV_12", PyLong_FromLong((uint16_t)(DMPAPER_ENV_12)));
	PyModule_AddObject(m, "DMPAPER_ENV_14", PyLong_FromLong((uint16_t)(DMPAPER_ENV_14)));
	PyModule_AddObject(m, "DMPAPER_CSHEET", PyLong_FromLong((uint16_t)(DMPAPER_CSHEET)));
	PyModule_AddObject(m, "DMPAPER_DSHEET", PyLong_FromLong((uint16_t)(DMPAPER_DSHEET)));
	PyModule_AddObject(m, "DMPAPER_ESHEET", PyLong_FromLong((uint16_t)(DMPAPER_ESHEET)));
	PyModule_AddObject(m, "DMPAPER_ENV_DL", PyLong_FromLong((uint16_t)(DMPAPER_ENV_DL)));
	PyModule_AddObject(m, "DMPAPER_ENV_C5", PyLong_FromLong((uint16_t)(DMPAPER_ENV_C5)));
	PyModule_AddObject(m, "DMPAPER_ENV_C3", PyLong_FromLong((uint16_t)(DMPAPER_ENV_C3)));
	PyModule_AddObject(m, "DMPAPER_ENV_C4", PyLong_FromLong((uint16_t)(DMPAPER_ENV_C4)));
	PyModule_AddObject(m, "DMPAPER_ENV_C6", PyLong_FromLong((uint16_t)(DMPAPER_ENV_C6)));
	PyModule_AddObject(m, "DMPAPER_ENV_C65", PyLong_FromLong((uint16_t)(DMPAPER_ENV_C65)));
	PyModule_AddObject(m, "DMPAPER_ENV_B4", PyLong_FromLong((uint16_t)(DMPAPER_ENV_B4)));
	PyModule_AddObject(m, "DMPAPER_ENV_B5", PyLong_FromLong((uint16_t)(DMPAPER_ENV_B5)));
	PyModule_AddObject(m, "DMPAPER_ENV_B6", PyLong_FromLong((uint16_t)(DMPAPER_ENV_B6)));
	PyModule_AddObject(m, "DMPAPER_ENV_ITALY", PyLong_FromLong((uint16_t)(DMPAPER_ENV_ITALY)));
	PyModule_AddObject(m, "DMPAPER_ENV_MONARCH", PyLong_FromLong((uint16_t)(DMPAPER_ENV_MONARCH)));
	PyModule_AddObject(m, "DMPAPER_ENV_PERSONAL", PyLong_FromLong((uint16_t)(DMPAPER_ENV_PERSONAL)));
	PyModule_AddObject(m, "DMPAPER_FANFOLD_US", PyLong_FromLong((uint16_t)(DMPAPER_FANFOLD_US)));
	PyModule_AddObject(m, "DMPAPER_FANFOLD_STD_GERMAN", PyLong_FromLong((uint16_t)(DMPAPER_FANFOLD_STD_GERMAN)));
	PyModule_AddObject(m, "DMPAPER_FANFOLD_LGL_GERMAN", PyLong_FromLong((uint16_t)(DMPAPER_FANFOLD_LGL_GERMAN)));
	PyModule_AddObject(m, "DMPAPER_DBL_JAPANESE_POSTCARD", PyLong_FromLong((uint16_t)(DMPAPER_DBL_JAPANESE_POSTCARD)));
	PyModule_AddObject(m, "DMPAPER_A6", PyLong_FromLong((uint16_t)(DMPAPER_A6)));
	PyModule_AddObject(m, "DMPAPER_JENV_KAKU2", PyLong_FromLong((uint16_t)(DMPAPER_JENV_KAKU2)));
	PyModule_AddObject(m, "DMPAPER_JENV_KAKU3", PyLong_FromLong((uint16_t)(DMPAPER_JENV_KAKU3)));
	PyModule_AddObject(m, "DMPAPER_JENV_CHOU3", PyLong_FromLong((uint16_t)(DMPAPER_JENV_CHOU3)));
	PyModule_AddObject(m, "DMPAPER_JENV_CHOU4", PyLong_FromLong((uint16_t)(DMPAPER_JENV_CHOU4)));
	PyModule_AddObject(m, "DMPAPER_LETTER_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_LETTER_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_A3_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_A3_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_A4_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_A4_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_A5_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_A5_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_B4_JIS_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_B4_JIS_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_B5_JIS_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_B5_JIS_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_JAPANESE_POSTCARD_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JAPANESE_POSTCARD_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_A6_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_A6_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_JENV_KAKU2_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JENV_KAKU2_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_JENV_KAKU3_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JENV_KAKU3_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_JENV_CHOU3_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JENV_CHOU3_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_JENV_CHOU4_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JENV_CHOU4_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_B6_JIS", PyLong_FromLong((uint16_t)(DMPAPER_B6_JIS)));
	PyModule_AddObject(m, "DMPAPER_B6_JIS_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_B6_JIS_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_12X11", PyLong_FromLong((uint16_t)(DMPAPER_12X11)));
	PyModule_AddObject(m, "DMPAPER_JENV_YOU4", PyLong_FromLong((uint16_t)(DMPAPER_JENV_YOU4)));
	PyModule_AddObject(m, "DMPAPER_JENV_YOU4_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_JENV_YOU4_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_P16K", PyLong_FromLong((uint16_t)(DMPAPER_P16K)));
	PyModule_AddObject(m, "DMPAPER_P32K", PyLong_FromLong((uint16_t)(DMPAPER_P32K)));
	PyModule_AddObject(m, "DMPAPER_P32KBIG", PyLong_FromLong((uint16_t)(DMPAPER_P32KBIG)));
	PyModule_AddObject(m, "DMPAPER_PENV_1", PyLong_FromLong((uint16_t)(DMPAPER_PENV_1)));
	PyModule_AddObject(m, "DMPAPER_PENV_2", PyLong_FromLong((uint16_t)(DMPAPER_PENV_2)));
	PyModule_AddObject(m, "DMPAPER_PENV_3", PyLong_FromLong((uint16_t)(DMPAPER_PENV_3)));
	PyModule_AddObject(m, "DMPAPER_PENV_4", PyLong_FromLong((uint16_t)(DMPAPER_PENV_4)));
	PyModule_AddObject(m, "DMPAPER_PENV_5", PyLong_FromLong((uint16_t)(DMPAPER_PENV_5)));
	PyModule_AddObject(m, "DMPAPER_PENV_6", PyLong_FromLong((uint16_t)(DMPAPER_PENV_6)));
	PyModule_AddObject(m, "DMPAPER_PENV_7", PyLong_FromLong((uint16_t)(DMPAPER_PENV_7)));
	PyModule_AddObject(m, "DMPAPER_PENV_8", PyLong_FromLong((uint16_t)(DMPAPER_PENV_8)));
	PyModule_AddObject(m, "DMPAPER_PENV_9", PyLong_FromLong((uint16_t)(DMPAPER_PENV_9)));
	PyModule_AddObject(m, "DMPAPER_PENV_10", PyLong_FromLong((uint16_t)(DMPAPER_PENV_10)));
	PyModule_AddObject(m, "DMPAPER_P16K_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_P16K_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_P32K_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_P32K_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_P32KBIG_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_P32KBIG_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_1_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_1_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_2_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_2_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_3_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_3_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_4_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_4_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_5_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_5_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_6_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_6_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_7_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_7_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_8_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_8_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_9_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_9_ROTATED)));
	PyModule_AddObject(m, "DMPAPER_PENV_10_ROTATED", PyLong_FromLong((uint16_t)(DMPAPER_PENV_10_ROTATED)));
	PyModule_AddObject(m, "DMBIN_UPPER", PyLong_FromLong((uint16_t)(DMBIN_UPPER)));
	PyModule_AddObject(m, "DMBIN_LOWER", PyLong_FromLong((uint16_t)(DMBIN_LOWER)));
	PyModule_AddObject(m, "DMBIN_MIDDLE", PyLong_FromLong((uint16_t)(DMBIN_MIDDLE)));
	PyModule_AddObject(m, "DMBIN_MANUAL", PyLong_FromLong((uint16_t)(DMBIN_MANUAL)));
	PyModule_AddObject(m, "DMBIN_ENVELOPE", PyLong_FromLong((uint16_t)(DMBIN_ENVELOPE)));
	PyModule_AddObject(m, "DMBIN_ENVMANUAL", PyLong_FromLong((uint16_t)(DMBIN_ENVMANUAL)));
	PyModule_AddObject(m, "DMBIN_AUTO", PyLong_FromLong((uint16_t)(DMBIN_AUTO)));
	PyModule_AddObject(m, "DMBIN_TRACTOR", PyLong_FromLong((uint16_t)(DMBIN_TRACTOR)));
	PyModule_AddObject(m, "DMBIN_SMALLFMT", PyLong_FromLong((uint16_t)(DMBIN_SMALLFMT)));
	PyModule_AddObject(m, "DMBIN_LARGEFMT", PyLong_FromLong((uint16_t)(DMBIN_LARGEFMT)));
	PyModule_AddObject(m, "DMBIN_LARGECAPACITY", PyLong_FromLong((uint16_t)(DMBIN_LARGECAPACITY)));
	PyModule_AddObject(m, "DMBIN_CASSETTE", PyLong_FromLong((uint16_t)(DMBIN_CASSETTE)));
	PyModule_AddObject(m, "DMBIN_FORMSOURCE", PyLong_FromLong((uint16_t)(DMBIN_FORMSOURCE)));
	PyModule_AddObject(m, "DMRES_HIGH", PyLong_FromLong((uint16_t)(DMRES_HIGH)));
	PyModule_AddObject(m, "DMRES_MEDIUM", PyLong_FromLong((uint16_t)(DMRES_MEDIUM)));
	PyModule_AddObject(m, "DMRES_LOW", PyLong_FromLong((uint16_t)(DMRES_LOW)));
	PyModule_AddObject(m, "DMRES_DRAFT", PyLong_FromLong((uint16_t)(DMRES_DRAFT)));
	PyModule_AddObject(m, "DMRES_MONOCHROME", PyLong_FromLong((uint16_t)(DMRES_MONOCHROME)));
	PyModule_AddObject(m, "DMRES_COLOR", PyLong_FromLong((uint16_t)(DMRES_COLOR)));
	PyModule_AddObject(m, "DMDUP_SIMPLEX", PyLong_FromLong((uint16_t)(DMDUP_SIMPLEX)));
	PyModule_AddObject(m, "DMDUP_VERTICAL", PyLong_FromLong((uint16_t)(DMDUP_VERTICAL)));
	PyModule_AddObject(m, "DMDUP_HORIZONTAL", PyLong_FromLong((uint16_t)(DMDUP_HORIZONTAL)));
	PyModule_AddObject(m, "DMTT_BITMAP", PyLong_FromLong((uint16_t)(DMTT_BITMAP)));
	PyModule_AddObject(m, "DMTT_DOWNLOAD", PyLong_FromLong((uint16_t)(DMTT_DOWNLOAD)));
	PyModule_AddObject(m, "DMTT_SUBDEV", PyLong_FromLong((uint16_t)(DMTT_SUBDEV)));
	PyModule_AddObject(m, "DMTT_DOWNLOAD_OUTLINE", PyLong_FromLong((uint16_t)(DMTT_DOWNLOAD_OUTLINE)));
	PyModule_AddObject(m, "DMCOLLATE_FALSE", PyLong_FromLong((uint16_t)(DMCOLLATE_FALSE)));
	PyModule_AddObject(m, "DMCOLLATE_TRUE", PyLong_FromLong((uint16_t)(DMCOLLATE_TRUE)));
	PyModule_AddObject(m, "DMNUP_SYSTEM", PyLong_FromUnsignedLongLong((uint32_t)(DMNUP_SYSTEM)));
	PyModule_AddObject(m, "DMNUP_ONEUP", PyLong_FromUnsignedLongLong((uint32_t)(DMNUP_ONEUP)));
	PyModule_AddObject(m, "DMICMMETHOD_NONE", PyLong_FromUnsignedLongLong((uint32_t)(DMICMMETHOD_NONE)));
	PyModule_AddObject(m, "DMICMMETHOD_SYSTEM", PyLong_FromUnsignedLongLong((uint32_t)(DMICMMETHOD_SYSTEM)));
	PyModule_AddObject(m, "DMICMMETHOD_DRIVER", PyLong_FromUnsignedLongLong((uint32_t)(DMICMMETHOD_DRIVER)));
	PyModule_AddObject(m, "DMICMMETHOD_DEVICE", PyLong_FromUnsignedLongLong((uint32_t)(DMICMMETHOD_DEVICE)));
	PyModule_AddObject(m, "DMICM_SATURATE", PyLong_FromUnsignedLongLong((uint32_t)(DMICM_SATURATE)));
	PyModule_AddObject(m, "DMICM_CONTRAST", PyLong_FromUnsignedLongLong((uint32_t)(DMICM_CONTRAST)));
	PyModule_AddObject(m, "DMICM_COLORIMETRIC", PyLong_FromUnsignedLongLong((uint32_t)(DMICM_COLORIMETRIC)));
	PyModule_AddObject(m, "DMICM_ABS_COLORIMETRIC", PyLong_FromUnsignedLongLong((uint32_t)(DMICM_ABS_COLORIMETRIC)));
	PyModule_AddObject(m, "DMMEDIA_STANDARD", PyLong_FromUnsignedLongLong((uint32_t)(DMMEDIA_STANDARD)));
	PyModule_AddObject(m, "DMMEDIA_TRANSPARENCY", PyLong_FromUnsignedLongLong((uint32_t)(DMMEDIA_TRANSPARENCY)));
	PyModule_AddObject(m, "DMMEDIA_GLOSSY", PyLong_FromUnsignedLongLong((uint32_t)(DMMEDIA_GLOSSY)));
	PyModule_AddObject(m, "DMDITHER_NONE", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_NONE)));
	PyModule_AddObject(m, "DMDITHER_COARSE", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_COARSE)));
	PyModule_AddObject(m, "DMDITHER_FINE", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_FINE)));
	PyModule_AddObject(m, "DMDITHER_LINEART", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_LINEART)));
	PyModule_AddObject(m, "DMDITHER_ERRORDIFFUSION", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_ERRORDIFFUSION)));
	PyModule_AddObject(m, "DMDITHER_RESERVED6", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_RESERVED6)));
	PyModule_AddObject(m, "DMDITHER_RESERVED7", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_RESERVED7)));
	PyModule_AddObject(m, "DMDITHER_RESERVED8", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_RESERVED8)));
	PyModule_AddObject(m, "DMDITHER_RESERVED9", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_RESERVED9)));
	PyModule_AddObject(m, "DMDITHER_GRAYSCALE", PyLong_FromUnsignedLongLong((uint32_t)(DMDITHER_GRAYSCALE)));
	PyModule_AddObject(m, "PRINTER_ENUM_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_DEFAULT)));
	PyModule_AddObject(m, "PRINTER_ENUM_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_LOCAL)));
	PyModule_AddObject(m, "PRINTER_ENUM_CONNECTIONS", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_CONNECTIONS)));
	PyModule_AddObject(m, "PRINTER_ENUM_FAVORITE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_FAVORITE)));
	PyModule_AddObject(m, "PRINTER_ENUM_NAME", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_NAME)));
	PyModule_AddObject(m, "PRINTER_ENUM_REMOTE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_REMOTE)));
	PyModule_AddObject(m, "PRINTER_ENUM_SHARED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_SHARED)));
	PyModule_AddObject(m, "PRINTER_ENUM_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_NETWORK)));
	PyModule_AddObject(m, "PRINTER_ENUM_EXPAND", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_EXPAND)));
	PyModule_AddObject(m, "PRINTER_ENUM_CONTAINER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_CONTAINER)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON1", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON1)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON2", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON2)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON3", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON3)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON4", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON4)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON5", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON5)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON6", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON6)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON7", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON7)));
	PyModule_AddObject(m, "PRINTER_ENUM_ICON8", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_ICON8)));
	PyModule_AddObject(m, "PRINTER_ENUM_HIDE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ENUM_HIDE)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_QUEUED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_QUEUED)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_DIRECT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_DIRECT)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_DEFAULT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_DEFAULT)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_SHARED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_SHARED)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_NETWORK", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_NETWORK)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_HIDDEN", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_HIDDEN)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_LOCAL", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_LOCAL)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_ENABLE_DEVQ", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_ENABLE_DEVQ)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_WORK_OFFLINE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_WORK_OFFLINE)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_ENABLE_BIDI", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_ENABLE_BIDI)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_RAW_ONLY", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_RAW_ONLY)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_PUBLISHED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_PUBLISHED)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_FAX", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_FAX)));
	PyModule_AddObject(m, "PRINTER_ATTRIBUTE_TS", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ATTRIBUTE_TS)));
	PyModule_AddObject(m, "DSPRINT_PUBLISH", PyLong_FromUnsignedLongLong((uint32_t)(DSPRINT_PUBLISH)));
	PyModule_AddObject(m, "DSPRINT_UPDATE", PyLong_FromUnsignedLongLong((uint32_t)(DSPRINT_UPDATE)));
	PyModule_AddObject(m, "DSPRINT_UNPUBLISH", PyLong_FromUnsignedLongLong((uint32_t)(DSPRINT_UNPUBLISH)));
	PyModule_AddObject(m, "DSPRINT_REPUBLISH", PyLong_FromUnsignedLongLong((uint32_t)(DSPRINT_REPUBLISH)));
	PyModule_AddObject(m, "DSPRINT_PENDING", PyLong_FromUnsignedLongLong((uint32_t)(DSPRINT_PENDING)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_NOOP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_NOOP)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_PAUSE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_PAUSE)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_RESUME", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_RESUME)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_CANCEL", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_CANCEL)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_RESTART", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_RESTART)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_DELETE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_DELETE)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_RETAIN", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_RETAIN)));
	PyModule_AddObject(m, "SPOOLSS_JOB_CONTROL_RELEASE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_JOB_CONTROL_RELEASE)));
	PyModule_AddObject(m, "SPOOLSS_PRINTER_CONTROL_UNPAUSE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PRINTER_CONTROL_UNPAUSE)));
	PyModule_AddObject(m, "SPOOLSS_PRINTER_CONTROL_PAUSE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PRINTER_CONTROL_PAUSE)));
	PyModule_AddObject(m, "SPOOLSS_PRINTER_CONTROL_RESUME", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PRINTER_CONTROL_RESUME)));
	PyModule_AddObject(m, "SPOOLSS_PRINTER_CONTROL_PURGE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PRINTER_CONTROL_PURGE)));
	PyModule_AddObject(m, "SPOOLSS_PRINTER_CONTROL_SET_STATUS", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PRINTER_CONTROL_SET_STATUS)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_VERSION_9X", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_VERSION_9X)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_VERSION_NT35", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_VERSION_NT35)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_VERSION_NT4", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_VERSION_NT4)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_VERSION_200X", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_VERSION_200X)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_VERSION_2012", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_VERSION_2012)));
	PyModule_AddObject(m, "PRINTER_DRIVER_PACKAGE_AWARE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_PACKAGE_AWARE)));
	PyModule_AddObject(m, "PRINTER_DRIVER_XPS", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_XPS)));
	PyModule_AddObject(m, "PRINTER_DRIVER_SANDBOX_ENABLED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_SANDBOX_ENABLED)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CLASS", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CLASS)));
	PyModule_AddObject(m, "PRINTER_DRIVER_DERIVED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_DERIVED)));
	PyModule_AddObject(m, "PRINTER_DRIVER_NOT_SHAREABLE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_NOT_SHAREABLE)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CATEGORY_FAX", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CATEGORY_FAX)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CATEGORY_FILE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CATEGORY_FILE)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CATEGORY_VIRTUAL", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CATEGORY_VIRTUAL)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CATEGORY_SERVICE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CATEGORY_SERVICE)));
	PyModule_AddObject(m, "PRINTER_DRIVER_SOFT_RESET_REQUIRED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_SOFT_RESET_REQUIRED)));
	PyModule_AddObject(m, "PRINTER_DRIVER_CATEGORY_3D", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_DRIVER_CATEGORY_3D)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_FILE_TYPE_RENDERING", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_FILE_TYPE_RENDERING)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_FILE_TYPE_DATA", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_FILE_TYPE_DATA)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_FILE_TYPE_HELP", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_FILE_TYPE_HELP)));
	PyModule_AddObject(m, "SPOOLSS_DRIVER_FILE_TYPE_OTHER", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_DRIVER_FILE_TYPE_OTHER)));
	PyModule_AddObject(m, "SPOOLSS_FORM_USER", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_USER)));
	PyModule_AddObject(m, "SPOOLSS_FORM_BUILTIN", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_BUILTIN)));
	PyModule_AddObject(m, "SPOOLSS_FORM_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_PRINTER)));
	PyModule_AddObject(m, "SPOOLSS_FORM_STRING_TYPE_NONE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_STRING_TYPE_NONE)));
	PyModule_AddObject(m, "SPOOLSS_FORM_STRING_TYPE_MUI_DLL", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_STRING_TYPE_MUI_DLL)));
	PyModule_AddObject(m, "SPOOLSS_FORM_STRING_TYPE_LANG_PAIR", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_FORM_STRING_TYPE_LANG_PAIR)));
	PyModule_AddObject(m, "SPOOLSS_PORT_TYPE_WRITE", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PORT_TYPE_WRITE)));
	PyModule_AddObject(m, "SPOOLSS_PORT_TYPE_READ", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PORT_TYPE_READ)));
	PyModule_AddObject(m, "SPOOLSS_PORT_TYPE_REDIRECTED", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PORT_TYPE_REDIRECTED)));
	PyModule_AddObject(m, "SPOOLSS_PORT_TYPE_NET_ATTACHED", PyLong_FromUnsignedLongLong((uint32_t)(SPOOLSS_PORT_TYPE_NET_ATTACHED)));
	PyModule_AddObject(m, "PORT_STATUS_CLEAR", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_CLEAR)));
	PyModule_AddObject(m, "PORT_STATUS_OFFLINE", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_OFFLINE)));
	PyModule_AddObject(m, "PORT_STATUS_PAPER_JAM", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_PAPER_JAM)));
	PyModule_AddObject(m, "PORT_STATUS_PAPER_OUT", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_PAPER_OUT)));
	PyModule_AddObject(m, "PORT_STATUS_OUTPUT_BIN_FULL", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_OUTPUT_BIN_FULL)));
	PyModule_AddObject(m, "PORT_STATUS_PAPER_PROBLEM", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_PAPER_PROBLEM)));
	PyModule_AddObject(m, "PORT_STATUS_NO_TONER", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_NO_TONER)));
	PyModule_AddObject(m, "PORT_STATUS_DOOR_OPEN", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_DOOR_OPEN)));
	PyModule_AddObject(m, "PORT_STATUS_USER_INTERVENTION", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_USER_INTERVENTION)));
	PyModule_AddObject(m, "PORT_STATUS_OUT_OF_MEMORY", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_OUT_OF_MEMORY)));
	PyModule_AddObject(m, "PORT_STATUS_TONER_LOW", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_TONER_LOW)));
	PyModule_AddObject(m, "PORT_STATUS_WARMING_UP", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_WARMING_UP)));
	PyModule_AddObject(m, "PORT_STATUS_POWER_SAVE", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_POWER_SAVE)));
	PyModule_AddObject(m, "PORT_STATUS_TYPE_ERROR", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_TYPE_ERROR)));
	PyModule_AddObject(m, "PORT_STATUS_TYPE_WARNING", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_TYPE_WARNING)));
	PyModule_AddObject(m, "PORT_STATUS_TYPE_INFO", PyLong_FromUnsignedLongLong((uint32_t)(PORT_STATUS_TYPE_INFO)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_PRINTER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_SET_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_SET_PRINTER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_PRINTER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_FAILED_CONNECTION_PRINTER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_FAILED_CONNECTION_PRINTER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_JOB", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_JOB)));
	PyModule_AddObject(m, "PRINTER_CHANGE_SET_JOB", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_SET_JOB)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_JOB", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_JOB)));
	PyModule_AddObject(m, "PRINTER_CHANGE_WRITE_JOB", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_WRITE_JOB)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_FORM", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_FORM)));
	PyModule_AddObject(m, "PRINTER_CHANGE_SET_FORM", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_SET_FORM)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_FORM", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_FORM)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_PORT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_PORT)));
	PyModule_AddObject(m, "PRINTER_CHANGE_CONFIGURE_PORT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_CONFIGURE_PORT)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_PORT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_PORT)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_PRINT_PROCESSOR", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_PRINT_PROCESSOR)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_PRINT_PROCESSOR", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_PRINT_PROCESSOR)));
	PyModule_AddObject(m, "PRINTER_CHANGE_SERVER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_SERVER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_ADD_PRINTER_DRIVER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_ADD_PRINTER_DRIVER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_SET_PRINTER_DRIVER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_SET_PRINTER_DRIVER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_DELETE_PRINTER_DRIVER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_DELETE_PRINTER_DRIVER)));
	PyModule_AddObject(m, "PRINTER_CHANGE_TIMEOUT", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_CHANGE_TIMEOUT)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PRINTER_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PRINTER_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_MACHINE_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_MACHINE_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PORT_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PORT_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_USER_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_USER_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_NOTIFY_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_NOTIFY_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_DATATYPE", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_DATATYPE)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PRINT_PROCESSOR", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PRINT_PROCESSOR)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PARAMETERS", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PARAMETERS)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_DRIVER_NAME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_DRIVER_NAME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_DEVMODE", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_DEVMODE)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_STATUS", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_STATUS)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_STATUS_STRING", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_STATUS_STRING)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_DOCUMENT", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_DOCUMENT)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PRIORITY", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PRIORITY)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_POSITION", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_POSITION)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_SUBMITTED", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_SUBMITTED)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_START_TIME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_START_TIME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_UNTIL_TIME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_UNTIL_TIME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_TIME", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_TIME)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_TOTAL_PAGES", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_TOTAL_PAGES)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_PAGES_PRINTED", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_PAGES_PRINTED)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_TOTAL_BYTES", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_TOTAL_BYTES)));
	PyModule_AddObject(m, "JOB_NOTIFY_FIELD_BYTES_PRINTED", PyLong_FromLong((uint16_t)(JOB_NOTIFY_FIELD_BYTES_PRINTED)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_SERVER_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_SERVER_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PRINTER_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PRINTER_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_SHARE_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_SHARE_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PORT_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PORT_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_DRIVER_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_DRIVER_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_COMMENT", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_COMMENT)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_LOCATION", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_LOCATION)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_DEVMODE", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_DEVMODE)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_SEPFILE", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_SEPFILE)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PARAMETERS", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PARAMETERS)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_DATATYPE", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_DATATYPE)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_ATTRIBUTES", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_ATTRIBUTES)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PRIORITY", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PRIORITY)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_START_TIME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_START_TIME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_UNTIL_TIME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_UNTIL_TIME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_STATUS", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_STATUS)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_STATUS_STRING", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_STATUS_STRING)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_CJOBS", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_CJOBS)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_AVERAGE_PPM", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_AVERAGE_PPM)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_TOTAL_PAGES", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_TOTAL_PAGES)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_PAGES_PRINTED", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_PAGES_PRINTED)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_TOTAL_BYTES", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_TOTAL_BYTES)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_BYTES_PRINTED", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_BYTES_PRINTED)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_OBJECT_GUID", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_OBJECT_GUID)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_FIELD_FRIENDLY_NAME", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_FIELD_FRIENDLY_NAME)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_TYPE", PyLong_FromLong((uint16_t)(PRINTER_NOTIFY_TYPE)));
	PyModule_AddObject(m, "JOB_NOTIFY_TYPE", PyLong_FromLong((uint16_t)(JOB_NOTIFY_TYPE)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_OPTIONS_REFRESH", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_NOTIFY_OPTIONS_REFRESH)));
	PyModule_AddObject(m, "NOTIFY_TABLE_DWORD", PyLong_FromUnsignedLongLong((uint32_t)(NOTIFY_TABLE_DWORD)));
	PyModule_AddObject(m, "NOTIFY_TABLE_STRING", PyLong_FromUnsignedLongLong((uint32_t)(NOTIFY_TABLE_STRING)));
	PyModule_AddObject(m, "NOTIFY_TABLE_DEVMODE", PyLong_FromUnsignedLongLong((uint32_t)(NOTIFY_TABLE_DEVMODE)));
	PyModule_AddObject(m, "NOTIFY_TABLE_TIME", PyLong_FromUnsignedLongLong((uint32_t)(NOTIFY_TABLE_TIME)));
	PyModule_AddObject(m, "NOTIFY_TABLE_SECURITYDESCRIPTOR", PyLong_FromUnsignedLongLong((uint32_t)(NOTIFY_TABLE_SECURITYDESCRIPTOR)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_INFO_DISCARDED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_NOTIFY_INFO_DISCARDED)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_INFO_DISCARDNOTED", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_NOTIFY_INFO_DISCARDNOTED)));
	PyModule_AddObject(m, "PRINTER_NOTIFY_INFO_COLOR_MISMATCH", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_NOTIFY_INFO_COLOR_MISMATCH)));
	PyModule_AddObject(m, "SERVER_ACCESS_ADMINISTER", PyLong_FromUnsignedLongLong((uint32_t)(SERVER_ACCESS_ADMINISTER)));
	PyModule_AddObject(m, "SERVER_ACCESS_ENUMERATE", PyLong_FromUnsignedLongLong((uint32_t)(SERVER_ACCESS_ENUMERATE)));
	PyModule_AddObject(m, "PRINTER_ACCESS_ADMINISTER", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ACCESS_ADMINISTER)));
	PyModule_AddObject(m, "PRINTER_ACCESS_USE", PyLong_FromUnsignedLongLong((uint32_t)(PRINTER_ACCESS_USE)));
	PyModule_AddObject(m, "JOB_ACCESS_ADMINISTER", PyLong_FromUnsignedLongLong((uint32_t)(JOB_ACCESS_ADMINISTER)));
	PyModule_AddObject(m, "JOB_ACCESS_READ", PyLong_FromUnsignedLongLong((uint32_t)(JOB_ACCESS_READ)));
	PyModule_AddObject(m, "DPD_DELETE_UNUSED_FILES", PyLong_FromUnsignedLongLong((uint32_t)(DPD_DELETE_UNUSED_FILES)));
	PyModule_AddObject(m, "DPD_DELETE_SPECIFIC_VERSION", PyLong_FromUnsignedLongLong((uint32_t)(DPD_DELETE_SPECIFIC_VERSION)));
	PyModule_AddObject(m, "DPD_DELETE_ALL_FILES", PyLong_FromUnsignedLongLong((uint32_t)(DPD_DELETE_ALL_FILES)));
	PyModule_AddObject(m, "PROTOCOL_RAWTCP_TYPE", PyLong_FromUnsignedLongLong((uint32_t)(PROTOCOL_RAWTCP_TYPE)));
	PyModule_AddObject(m, "PROTOCOL_LPR_TYPE", PyLong_FromUnsignedLongLong((uint32_t)(PROTOCOL_LPR_TYPE)));
	PyModule_AddObject(m, "APD_STRICT_UPGRADE", PyLong_FromUnsignedLongLong((uint32_t)(APD_STRICT_UPGRADE)));
	PyModule_AddObject(m, "APD_STRICT_DOWNGRADE", PyLong_FromUnsignedLongLong((uint32_t)(APD_STRICT_DOWNGRADE)));
	PyModule_AddObject(m, "APD_COPY_ALL_FILES", PyLong_FromUnsignedLongLong((uint32_t)(APD_COPY_ALL_FILES)));
	PyModule_AddObject(m, "APD_COPY_NEW_FILES", PyLong_FromUnsignedLongLong((uint32_t)(APD_COPY_NEW_FILES)));
	PyModule_AddObject(m, "APD_COPY_FROM_DIRECTORY", PyLong_FromUnsignedLongLong((uint32_t)(APD_COPY_FROM_DIRECTORY)));
	PyModule_AddObject(m, "APD_DONT_COPY_FILES_TO_CLUSTER", PyLong_FromUnsignedLongLong((uint32_t)(APD_DONT_COPY_FILES_TO_CLUSTER)));
	PyModule_AddObject(m, "APD_COPY_TO_ALL_SPOOLERS", PyLong_FromUnsignedLongLong((uint32_t)(APD_COPY_TO_ALL_SPOOLERS)));
	PyModule_AddObject(m, "APD_RETURN_BLOCKING_STATUS_CODE", PyLong_FromUnsignedLongLong((uint32_t)(APD_RETURN_BLOCKING_STATUS_CODE)));
	PyModule_AddObject(m, "BIDI_NULL", PyLong_FromLong((uint16_t)(BIDI_NULL)));
	PyModule_AddObject(m, "BIDI_INT", PyLong_FromLong((uint16_t)(BIDI_INT)));
	PyModule_AddObject(m, "BIDI_FLOAT", PyLong_FromLong((uint16_t)(BIDI_FLOAT)));
	PyModule_AddObject(m, "BIDI_BOOL", PyLong_FromLong((uint16_t)(BIDI_BOOL)));
	PyModule_AddObject(m, "BIDI_STRING", PyLong_FromLong((uint16_t)(BIDI_STRING)));
	PyModule_AddObject(m, "BIDI_TEXT", PyLong_FromLong((uint16_t)(BIDI_TEXT)));
	PyModule_AddObject(m, "BIDI_ENUM", PyLong_FromLong((uint16_t)(BIDI_ENUM)));
	PyModule_AddObject(m, "BIDI_BLOB", PyLong_FromLong((uint16_t)(BIDI_BLOB)));
	PyModule_AddObject(m, "kRpcPropertyTypeString", PyLong_FromLong((uint16_t)(kRpcPropertyTypeString)));
	PyModule_AddObject(m, "kRpcPropertyTypeInt32", PyLong_FromLong((uint16_t)(kRpcPropertyTypeInt32)));
	PyModule_AddObject(m, "kRpcPropertyTypeInt64", PyLong_FromLong((uint16_t)(kRpcPropertyTypeInt64)));
	PyModule_AddObject(m, "kRpcPropertyTypeByte", PyLong_FromLong((uint16_t)(kRpcPropertyTypeByte)));
	PyModule_AddObject(m, "kRpcPropertyTypeBuffer", PyLong_FromLong((uint16_t)(kRpcPropertyTypeBuffer)));
	PyModule_AddObject(m, "kInvalidJobState", PyLong_FromLong((uint16_t)(kInvalidJobState)));
	PyModule_AddObject(m, "kLogJobPrinted", PyLong_FromLong((uint16_t)(kLogJobPrinted)));
	PyModule_AddObject(m, "kLogJobRendered", PyLong_FromLong((uint16_t)(kLogJobRendered)));
	PyModule_AddObject(m, "kLogJobError", PyLong_FromLong((uint16_t)(kLogJobError)));
	PyModule_AddObject(m, "kLogJobPipelineError", PyLong_FromLong((uint16_t)(kLogJobPipelineError)));
	PyModule_AddObject(m, "kLogOfflineFileFull", PyLong_FromLong((uint16_t)(kLogOfflineFileFull)));
	Py_INCREF((PyObject *)(void *)&spoolss_Time_Type);
	PyModule_AddObject(m, "Time", (PyObject *)(void *)&spoolss_Time_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_TimeCtr_Type);
	PyModule_AddObject(m, "TimeCtr", (PyObject *)(void *)&spoolss_TimeCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo0_Type);
	PyModule_AddObject(m, "PrinterInfo0", (PyObject *)(void *)&spoolss_PrinterInfo0_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PSDRVEXTRA351_Type);
	PyModule_AddObject(m, "PSDRVEXTRA351", (PyObject *)(void *)&spoolss_PSDRVEXTRA351_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PSDRVEXTRA400_Type);
	PyModule_AddObject(m, "PSDRVEXTRA400", (PyObject *)(void *)&spoolss_PSDRVEXTRA400_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PSDRVEXTRA500_Type);
	PyModule_AddObject(m, "PSDRVEXTRA500", (PyObject *)(void *)&spoolss_PSDRVEXTRA500_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PSDRVEXTRA_Type);
	PyModule_AddObject(m, "PSDRVEXTRA", (PyObject *)(void *)&spoolss_PSDRVEXTRA_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UNIDRVEXTRA3_4_Type);
	PyModule_AddObject(m, "UNIDRVEXTRA3_4", (PyObject *)(void *)&spoolss_UNIDRVEXTRA3_4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UNIDRVEXTRA500_Type);
	PyModule_AddObject(m, "UNIDRVEXTRA500", (PyObject *)(void *)&spoolss_UNIDRVEXTRA500_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UNIDRVEXTRA_Type);
	PyModule_AddObject(m, "UNIDRVEXTRA", (PyObject *)(void *)&spoolss_UNIDRVEXTRA_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JTEXP_Type);
	PyModule_AddObject(m, "JTEXP", (PyObject *)(void *)&spoolss_JTEXP_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_OEM_DMEXTRA_Type);
	PyModule_AddObject(m, "OEM_DMEXTRA", (PyObject *)(void *)&spoolss_OEM_DMEXTRA_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeviceModeExtraDataPostScript_Type);
	PyModule_AddObject(m, "DeviceModeExtraDataPostScript", (PyObject *)(void *)&spoolss_DeviceModeExtraDataPostScript_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeviceModeExtraDataUniDriver_Type);
	PyModule_AddObject(m, "DeviceModeExtraDataUniDriver", (PyObject *)(void *)&spoolss_DeviceModeExtraDataUniDriver_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeviceMode_Type);
	PyModule_AddObject(m, "DeviceMode", (PyObject *)(void *)&spoolss_DeviceMode_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo1_Type);
	PyModule_AddObject(m, "PrinterInfo1", (PyObject *)(void *)&spoolss_PrinterInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo2_Type);
	PyModule_AddObject(m, "PrinterInfo2", (PyObject *)(void *)&spoolss_PrinterInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo3_Type);
	PyModule_AddObject(m, "PrinterInfo3", (PyObject *)(void *)&spoolss_PrinterInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo4_Type);
	PyModule_AddObject(m, "PrinterInfo4", (PyObject *)(void *)&spoolss_PrinterInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo5_Type);
	PyModule_AddObject(m, "PrinterInfo5", (PyObject *)(void *)&spoolss_PrinterInfo5_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo6_Type);
	PyModule_AddObject(m, "PrinterInfo6", (PyObject *)(void *)&spoolss_PrinterInfo6_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo7_Type);
	PyModule_AddObject(m, "PrinterInfo7", (PyObject *)(void *)&spoolss_PrinterInfo7_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeviceModeInfo_Type);
	PyModule_AddObject(m, "DeviceModeInfo", (PyObject *)(void *)&spoolss_DeviceModeInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterInfo_Type);
	PyModule_AddObject(m, "PrinterInfo", (PyObject *)(void *)&spoolss_PrinterInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DevmodeContainer_Type);
	PyModule_AddObject(m, "DevmodeContainer", (PyObject *)(void *)&spoolss_DevmodeContainer_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfo1_Type);
	PyModule_AddObject(m, "JobInfo1", (PyObject *)(void *)&spoolss_JobInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfo2_Type);
	PyModule_AddObject(m, "JobInfo2", (PyObject *)(void *)&spoolss_JobInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfo3_Type);
	PyModule_AddObject(m, "JobInfo3", (PyObject *)(void *)&spoolss_JobInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfo4_Type);
	PyModule_AddObject(m, "JobInfo4", (PyObject *)(void *)&spoolss_JobInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfo_Type);
	PyModule_AddObject(m, "JobInfo", (PyObject *)(void *)&spoolss_JobInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJobInfo1_Type);
	PyModule_AddObject(m, "SetJobInfo1", (PyObject *)(void *)&spoolss_SetJobInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJobInfo2_Type);
	PyModule_AddObject(m, "SetJobInfo2", (PyObject *)(void *)&spoolss_SetJobInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJobInfo4_Type);
	PyModule_AddObject(m, "SetJobInfo4", (PyObject *)(void *)&spoolss_SetJobInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJobInfo_Type);
	PyModule_AddObject(m, "SetJobInfo", (PyObject *)(void *)&spoolss_SetJobInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_JobInfoContainer_Type);
	PyModule_AddObject(m, "JobInfoContainer", (PyObject *)(void *)&spoolss_JobInfoContainer_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo0_Type);
	PyModule_AddObject(m, "SetPrinterInfo0", (PyObject *)(void *)&spoolss_SetPrinterInfo0_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo1_Type);
	PyModule_AddObject(m, "SetPrinterInfo1", (PyObject *)(void *)&spoolss_SetPrinterInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo2_Type);
	PyModule_AddObject(m, "SetPrinterInfo2", (PyObject *)(void *)&spoolss_SetPrinterInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo3_Type);
	PyModule_AddObject(m, "SetPrinterInfo3", (PyObject *)(void *)&spoolss_SetPrinterInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo4_Type);
	PyModule_AddObject(m, "SetPrinterInfo4", (PyObject *)(void *)&spoolss_SetPrinterInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo5_Type);
	PyModule_AddObject(m, "SetPrinterInfo5", (PyObject *)(void *)&spoolss_SetPrinterInfo5_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo6_Type);
	PyModule_AddObject(m, "SetPrinterInfo6", (PyObject *)(void *)&spoolss_SetPrinterInfo6_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo7_Type);
	PyModule_AddObject(m, "SetPrinterInfo7", (PyObject *)(void *)&spoolss_SetPrinterInfo7_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo8_Type);
	PyModule_AddObject(m, "SetPrinterInfo8", (PyObject *)(void *)&spoolss_SetPrinterInfo8_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo9_Type);
	PyModule_AddObject(m, "SetPrinterInfo9", (PyObject *)(void *)&spoolss_SetPrinterInfo9_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfo_Type);
	PyModule_AddObject(m, "SetPrinterInfo", (PyObject *)(void *)&spoolss_SetPrinterInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterInfoCtr_Type);
	PyModule_AddObject(m, "SetPrinterInfoCtr", (PyObject *)(void *)&spoolss_SetPrinterInfoCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_StringArray_Type);
	PyModule_AddObject(m, "StringArray", (PyObject *)(void *)&spoolss_StringArray_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo1_Type);
	PyModule_AddObject(m, "AddDriverInfo1", (PyObject *)(void *)&spoolss_AddDriverInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo2_Type);
	PyModule_AddObject(m, "AddDriverInfo2", (PyObject *)(void *)&spoolss_AddDriverInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo3_Type);
	PyModule_AddObject(m, "AddDriverInfo3", (PyObject *)(void *)&spoolss_AddDriverInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo4_Type);
	PyModule_AddObject(m, "AddDriverInfo4", (PyObject *)(void *)&spoolss_AddDriverInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo5_Type);
	PyModule_AddObject(m, "AddDriverInfo5", (PyObject *)(void *)&spoolss_AddDriverInfo5_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo6_Type);
	PyModule_AddObject(m, "AddDriverInfo6", (PyObject *)(void *)&spoolss_AddDriverInfo6_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo8_Type);
	PyModule_AddObject(m, "AddDriverInfo8", (PyObject *)(void *)&spoolss_AddDriverInfo8_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfo_Type);
	PyModule_AddObject(m, "AddDriverInfo", (PyObject *)(void *)&spoolss_AddDriverInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddDriverInfoCtr_Type);
	PyModule_AddObject(m, "AddDriverInfoCtr", (PyObject *)(void *)&spoolss_AddDriverInfoCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo1_Type);
	PyModule_AddObject(m, "DriverInfo1", (PyObject *)(void *)&spoolss_DriverInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo2_Type);
	PyModule_AddObject(m, "DriverInfo2", (PyObject *)(void *)&spoolss_DriverInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo3_Type);
	PyModule_AddObject(m, "DriverInfo3", (PyObject *)(void *)&spoolss_DriverInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo4_Type);
	PyModule_AddObject(m, "DriverInfo4", (PyObject *)(void *)&spoolss_DriverInfo4_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo5_Type);
	PyModule_AddObject(m, "DriverInfo5", (PyObject *)(void *)&spoolss_DriverInfo5_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo6_Type);
	PyModule_AddObject(m, "DriverInfo6", (PyObject *)(void *)&spoolss_DriverInfo6_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo7_Type);
	PyModule_AddObject(m, "DriverInfo7", (PyObject *)(void *)&spoolss_DriverInfo7_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo8_Type);
	PyModule_AddObject(m, "DriverInfo8", (PyObject *)(void *)&spoolss_DriverInfo8_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverFileInfo_Type);
	PyModule_AddObject(m, "DriverFileInfo", (PyObject *)(void *)&spoolss_DriverFileInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo101_Type);
	PyModule_AddObject(m, "DriverInfo101", (PyObject *)(void *)&spoolss_DriverInfo101_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverInfo_Type);
	PyModule_AddObject(m, "DriverInfo", (PyObject *)(void *)&spoolss_DriverInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverDirectoryInfo1_Type);
	PyModule_AddObject(m, "DriverDirectoryInfo1", (PyObject *)(void *)&spoolss_DriverDirectoryInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DriverDirectoryInfo_Type);
	PyModule_AddObject(m, "DriverDirectoryInfo", (PyObject *)(void *)&spoolss_DriverDirectoryInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcessorInfo1_Type);
	PyModule_AddObject(m, "PrintProcessorInfo1", (PyObject *)(void *)&spoolss_PrintProcessorInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcessorInfo_Type);
	PyModule_AddObject(m, "PrintProcessorInfo", (PyObject *)(void *)&spoolss_PrintProcessorInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcessorDirectoryInfo1_Type);
	PyModule_AddObject(m, "PrintProcessorDirectoryInfo1", (PyObject *)(void *)&spoolss_PrintProcessorDirectoryInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcessorDirectoryInfo_Type);
	PyModule_AddObject(m, "PrintProcessorDirectoryInfo", (PyObject *)(void *)&spoolss_PrintProcessorDirectoryInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DocumentInfo1_Type);
	PyModule_AddObject(m, "DocumentInfo1", (PyObject *)(void *)&spoolss_DocumentInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DocumentInfo_Type);
	PyModule_AddObject(m, "DocumentInfo", (PyObject *)(void *)&spoolss_DocumentInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DocumentInfoCtr_Type);
	PyModule_AddObject(m, "DocumentInfoCtr", (PyObject *)(void *)&spoolss_DocumentInfoCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_OSVersion_Type);
	PyModule_AddObject(m, "OSVersion", (PyObject *)(void *)&spoolss_OSVersion_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_OSVersionEx_Type);
	PyModule_AddObject(m, "OSVersionEx", (PyObject *)(void *)&spoolss_OSVersionEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterData_Type);
	PyModule_AddObject(m, "PrinterData", (PyObject *)(void *)&spoolss_PrinterData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FormSize_Type);
	PyModule_AddObject(m, "FormSize", (PyObject *)(void *)&spoolss_FormSize_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FormArea_Type);
	PyModule_AddObject(m, "FormArea", (PyObject *)(void *)&spoolss_FormArea_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FormInfo1_Type);
	PyModule_AddObject(m, "FormInfo1", (PyObject *)(void *)&spoolss_FormInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FormInfo2_Type);
	PyModule_AddObject(m, "FormInfo2", (PyObject *)(void *)&spoolss_FormInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FormInfo_Type);
	PyModule_AddObject(m, "FormInfo", (PyObject *)(void *)&spoolss_FormInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddFormInfo1_Type);
	PyModule_AddObject(m, "AddFormInfo1", (PyObject *)(void *)&spoolss_AddFormInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddFormInfo2_Type);
	PyModule_AddObject(m, "AddFormInfo2", (PyObject *)(void *)&spoolss_AddFormInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddFormInfo_Type);
	PyModule_AddObject(m, "AddFormInfo", (PyObject *)(void *)&spoolss_AddFormInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddFormInfoCtr_Type);
	PyModule_AddObject(m, "AddFormInfoCtr", (PyObject *)(void *)&spoolss_AddFormInfoCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortInfo1_Type);
	PyModule_AddObject(m, "PortInfo1", (PyObject *)(void *)&spoolss_PortInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortInfo2_Type);
	PyModule_AddObject(m, "PortInfo2", (PyObject *)(void *)&spoolss_PortInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortInfo3_Type);
	PyModule_AddObject(m, "PortInfo3", (PyObject *)(void *)&spoolss_PortInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortInfoFF_Type);
	PyModule_AddObject(m, "PortInfoFF", (PyObject *)(void *)&spoolss_PortInfoFF_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortInfo_Type);
	PyModule_AddObject(m, "PortInfo", (PyObject *)(void *)&spoolss_PortInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_MonitorInfo1_Type);
	PyModule_AddObject(m, "MonitorInfo1", (PyObject *)(void *)&spoolss_MonitorInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_MonitorInfo2_Type);
	PyModule_AddObject(m, "MonitorInfo2", (PyObject *)(void *)&spoolss_MonitorInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_MonitorInfo_Type);
	PyModule_AddObject(m, "MonitorInfo", (PyObject *)(void *)&spoolss_MonitorInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfo1_Type);
	PyModule_AddObject(m, "SetPortInfo1", (PyObject *)(void *)&spoolss_SetPortInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfo2_Type);
	PyModule_AddObject(m, "SetPortInfo2", (PyObject *)(void *)&spoolss_SetPortInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfo3_Type);
	PyModule_AddObject(m, "SetPortInfo3", (PyObject *)(void *)&spoolss_SetPortInfo3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfoFF_Type);
	PyModule_AddObject(m, "SetPortInfoFF", (PyObject *)(void *)&spoolss_SetPortInfoFF_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfo_Type);
	PyModule_AddObject(m, "SetPortInfo", (PyObject *)(void *)&spoolss_SetPortInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPortInfoContainer_Type);
	PyModule_AddObject(m, "SetPortInfoContainer", (PyObject *)(void *)&spoolss_SetPortInfoContainer_Type);
	Py_INCREF((PyObject *)(void *)&UNIVERSAL_FONT_ID_Type);
	PyModule_AddObject(m, "UNIVERSAL_FONT_ID", (PyObject *)(void *)&UNIVERSAL_FONT_ID_Type);
	Py_INCREF((PyObject *)(void *)&UNIVERSAL_FONT_ID_ctr_Type);
	PyModule_AddObject(m, "UNIVERSAL_FONT_ID_ctr", (PyObject *)(void *)&UNIVERSAL_FONT_ID_ctr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddMonitorInfo1_Type);
	PyModule_AddObject(m, "AddMonitorInfo1", (PyObject *)(void *)&spoolss_AddMonitorInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddMonitorInfo2_Type);
	PyModule_AddObject(m, "AddMonitorInfo2", (PyObject *)(void *)&spoolss_AddMonitorInfo2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddMonitorInfo_Type);
	PyModule_AddObject(m, "AddMonitorInfo", (PyObject *)(void *)&spoolss_AddMonitorInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_MonitorContainer_Type);
	PyModule_AddObject(m, "MonitorContainer", (PyObject *)(void *)&spoolss_MonitorContainer_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcDataTypesInfo1_Type);
	PyModule_AddObject(m, "PrintProcDataTypesInfo1", (PyObject *)(void *)&spoolss_PrintProcDataTypesInfo1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintProcDataTypesInfo_Type);
	PyModule_AddObject(m, "PrintProcDataTypesInfo", (PyObject *)(void *)&spoolss_PrintProcDataTypesInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortVarContainer_Type);
	PyModule_AddObject(m, "PortVarContainer", (PyObject *)(void *)&spoolss_PortVarContainer_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_Field_Type);
	PyModule_AddObject(m, "Field", (PyObject *)(void *)&spoolss_Field_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_NotifyOptionType_Type);
	PyModule_AddObject(m, "NotifyOptionType", (PyObject *)(void *)&spoolss_NotifyOptionType_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_NotifyOption_Type);
	PyModule_AddObject(m, "NotifyOption", (PyObject *)(void *)&spoolss_NotifyOption_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_NotifyString_Type);
	PyModule_AddObject(m, "NotifyString", (PyObject *)(void *)&spoolss_NotifyString_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_NotifyData_Type);
	PyModule_AddObject(m, "NotifyData", (PyObject *)(void *)&spoolss_NotifyData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_Notify_Type);
	PyModule_AddObject(m, "Notify", (PyObject *)(void *)&spoolss_Notify_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_NotifyInfo_Type);
	PyModule_AddObject(m, "NotifyInfo", (PyObject *)(void *)&spoolss_NotifyInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ReplyPrinterInfo_Type);
	PyModule_AddObject(m, "ReplyPrinterInfo", (PyObject *)(void *)&spoolss_ReplyPrinterInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UserLevel1_Type);
	PyModule_AddObject(m, "UserLevel1", (PyObject *)(void *)&spoolss_UserLevel1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UserLevel2_Type);
	PyModule_AddObject(m, "UserLevel2", (PyObject *)(void *)&spoolss_UserLevel2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UserLevel3_Type);
	PyModule_AddObject(m, "UserLevel3", (PyObject *)(void *)&spoolss_UserLevel3_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UserLevel_Type);
	PyModule_AddObject(m, "UserLevel", (PyObject *)(void *)&spoolss_UserLevel_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_UserLevelCtr_Type);
	PyModule_AddObject(m, "UserLevelCtr", (PyObject *)(void *)&spoolss_UserLevelCtr_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrinterEnumValues_Type);
	PyModule_AddObject(m, "PrinterEnumValues", (PyObject *)(void *)&spoolss_PrinterEnumValues_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_KeyNames_Type);
	PyModule_AddObject(m, "KeyNames", (PyObject *)(void *)&spoolss_KeyNames_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortData1_Type);
	PyModule_AddObject(m, "PortData1", (PyObject *)(void *)&spoolss_PortData1_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PortData2_Type);
	PyModule_AddObject(m, "PortData2", (PyObject *)(void *)&spoolss_PortData2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_MonitorUi_Type);
	PyModule_AddObject(m, "MonitorUi", (PyObject *)(void *)&spoolss_MonitorUi_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BINARY_CONTAINER_Type);
	PyModule_AddObject(m, "RPC_BINARY_CONTAINER", (PyObject *)(void *)&RPC_BINARY_CONTAINER_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_DATA_u_Type);
	PyModule_AddObject(m, "RPC_BIDI_DATA_u", (PyObject *)(void *)&RPC_BIDI_DATA_u_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_DATA_Type);
	PyModule_AddObject(m, "RPC_BIDI_DATA", (PyObject *)(void *)&RPC_BIDI_DATA_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_REQUEST_DATA_Type);
	PyModule_AddObject(m, "RPC_BIDI_REQUEST_DATA", (PyObject *)(void *)&RPC_BIDI_REQUEST_DATA_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_REQUEST_CONTAINER_Type);
	PyModule_AddObject(m, "RPC_BIDI_REQUEST_CONTAINER", (PyObject *)(void *)&RPC_BIDI_REQUEST_CONTAINER_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_RESPONSE_DATA_Type);
	PyModule_AddObject(m, "RPC_BIDI_RESPONSE_DATA", (PyObject *)(void *)&RPC_BIDI_RESPONSE_DATA_Type);
	Py_INCREF((PyObject *)(void *)&RPC_BIDI_RESPONSE_CONTAINER_Type);
	PyModule_AddObject(m, "RPC_BIDI_RESPONSE_CONTAINER", (PyObject *)(void *)&RPC_BIDI_RESPONSE_CONTAINER_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_CorePrinterDriver_Type);
	PyModule_AddObject(m, "CorePrinterDriver", (PyObject *)(void *)&spoolss_CorePrinterDriver_Type);
	Py_INCREF((PyObject *)(void *)&propertyBlob_Type);
	PyModule_AddObject(m, "propertyBlob", (PyObject *)(void *)&propertyBlob_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintPropertyValueUnion_Type);
	PyModule_AddObject(m, "PrintPropertyValueUnion", (PyObject *)(void *)&spoolss_PrintPropertyValueUnion_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintPropertyValue_Type);
	PyModule_AddObject(m, "PrintPropertyValue", (PyObject *)(void *)&spoolss_PrintPropertyValue_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PrintNamedProperty_Type);
	PyModule_AddObject(m, "PrintNamedProperty", (PyObject *)(void *)&spoolss_PrintNamedProperty_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobDataPrinted_Type);
	PyModule_AddObject(m, "BranchOfficeJobDataPrinted", (PyObject *)(void *)&spoolss_BranchOfficeJobDataPrinted_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobDataRendered_Type);
	PyModule_AddObject(m, "BranchOfficeJobDataRendered", (PyObject *)(void *)&spoolss_BranchOfficeJobDataRendered_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobDataError_Type);
	PyModule_AddObject(m, "BranchOfficeJobDataError", (PyObject *)(void *)&spoolss_BranchOfficeJobDataError_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobDataPipelineFailed_Type);
	PyModule_AddObject(m, "BranchOfficeJobDataPipelineFailed", (PyObject *)(void *)&spoolss_BranchOfficeJobDataPipelineFailed_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeLogOfflineFileFull_Type);
	PyModule_AddObject(m, "BranchOfficeLogOfflineFileFull", (PyObject *)(void *)&spoolss_BranchOfficeLogOfflineFileFull_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobInfo_Type);
	PyModule_AddObject(m, "BranchOfficeJobInfo", (PyObject *)(void *)&spoolss_BranchOfficeJobInfo_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobData_Type);
	PyModule_AddObject(m, "BranchOfficeJobData", (PyObject *)(void *)&spoolss_BranchOfficeJobData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_BranchOfficeJobDataContainer_Type);
	PyModule_AddObject(m, "BranchOfficeJobDataContainer", (PyObject *)(void *)&spoolss_BranchOfficeJobDataContainer_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrinters_Type);
	PyModule_AddObject(m, "EnumPrinters", (PyObject *)(void *)&spoolss_EnumPrinters_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_OpenPrinter_Type);
	PyModule_AddObject(m, "OpenPrinter", (PyObject *)(void *)&spoolss_OpenPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJob_Type);
	PyModule_AddObject(m, "SetJob", (PyObject *)(void *)&spoolss_SetJob_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetJob_Type);
	PyModule_AddObject(m, "GetJob", (PyObject *)(void *)&spoolss_GetJob_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumJobs_Type);
	PyModule_AddObject(m, "EnumJobs", (PyObject *)(void *)&spoolss_EnumJobs_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPrinter_Type);
	PyModule_AddObject(m, "AddPrinter", (PyObject *)(void *)&spoolss_AddPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinter_Type);
	PyModule_AddObject(m, "DeletePrinter", (PyObject *)(void *)&spoolss_DeletePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinter_Type);
	PyModule_AddObject(m, "SetPrinter", (PyObject *)(void *)&spoolss_SetPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinter_Type);
	PyModule_AddObject(m, "GetPrinter", (PyObject *)(void *)&spoolss_GetPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPrinterDriver_Type);
	PyModule_AddObject(m, "AddPrinterDriver", (PyObject *)(void *)&spoolss_AddPrinterDriver_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrinterDrivers_Type);
	PyModule_AddObject(m, "EnumPrinterDrivers", (PyObject *)(void *)&spoolss_EnumPrinterDrivers_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterDriver_Type);
	PyModule_AddObject(m, "GetPrinterDriver", (PyObject *)(void *)&spoolss_GetPrinterDriver_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterDriverDirectory_Type);
	PyModule_AddObject(m, "GetPrinterDriverDirectory", (PyObject *)(void *)&spoolss_GetPrinterDriverDirectory_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterDriver_Type);
	PyModule_AddObject(m, "DeletePrinterDriver", (PyObject *)(void *)&spoolss_DeletePrinterDriver_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPrintProcessor_Type);
	PyModule_AddObject(m, "AddPrintProcessor", (PyObject *)(void *)&spoolss_AddPrintProcessor_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrintProcessors_Type);
	PyModule_AddObject(m, "EnumPrintProcessors", (PyObject *)(void *)&spoolss_EnumPrintProcessors_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrintProcessorDirectory_Type);
	PyModule_AddObject(m, "GetPrintProcessorDirectory", (PyObject *)(void *)&spoolss_GetPrintProcessorDirectory_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_StartDocPrinter_Type);
	PyModule_AddObject(m, "StartDocPrinter", (PyObject *)(void *)&spoolss_StartDocPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_StartPagePrinter_Type);
	PyModule_AddObject(m, "StartPagePrinter", (PyObject *)(void *)&spoolss_StartPagePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_WritePrinter_Type);
	PyModule_AddObject(m, "WritePrinter", (PyObject *)(void *)&spoolss_WritePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EndPagePrinter_Type);
	PyModule_AddObject(m, "EndPagePrinter", (PyObject *)(void *)&spoolss_EndPagePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AbortPrinter_Type);
	PyModule_AddObject(m, "AbortPrinter", (PyObject *)(void *)&spoolss_AbortPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ReadPrinter_Type);
	PyModule_AddObject(m, "ReadPrinter", (PyObject *)(void *)&spoolss_ReadPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EndDocPrinter_Type);
	PyModule_AddObject(m, "EndDocPrinter", (PyObject *)(void *)&spoolss_EndDocPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddJob_Type);
	PyModule_AddObject(m, "AddJob", (PyObject *)(void *)&spoolss_AddJob_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ScheduleJob_Type);
	PyModule_AddObject(m, "ScheduleJob", (PyObject *)(void *)&spoolss_ScheduleJob_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterData_Type);
	PyModule_AddObject(m, "GetPrinterData", (PyObject *)(void *)&spoolss_GetPrinterData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterData_Type);
	PyModule_AddObject(m, "SetPrinterData", (PyObject *)(void *)&spoolss_SetPrinterData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ClosePrinter_Type);
	PyModule_AddObject(m, "ClosePrinter", (PyObject *)(void *)&spoolss_ClosePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddForm_Type);
	PyModule_AddObject(m, "AddForm", (PyObject *)(void *)&spoolss_AddForm_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeleteForm_Type);
	PyModule_AddObject(m, "DeleteForm", (PyObject *)(void *)&spoolss_DeleteForm_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetForm_Type);
	PyModule_AddObject(m, "GetForm", (PyObject *)(void *)&spoolss_GetForm_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetForm_Type);
	PyModule_AddObject(m, "SetForm", (PyObject *)(void *)&spoolss_SetForm_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumForms_Type);
	PyModule_AddObject(m, "EnumForms", (PyObject *)(void *)&spoolss_EnumForms_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPorts_Type);
	PyModule_AddObject(m, "EnumPorts", (PyObject *)(void *)&spoolss_EnumPorts_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumMonitors_Type);
	PyModule_AddObject(m, "EnumMonitors", (PyObject *)(void *)&spoolss_EnumMonitors_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPort_Type);
	PyModule_AddObject(m, "AddPort", (PyObject *)(void *)&spoolss_AddPort_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePort_Type);
	PyModule_AddObject(m, "DeletePort", (PyObject *)(void *)&spoolss_DeletePort_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_CreatePrinterIC_Type);
	PyModule_AddObject(m, "CreatePrinterIC", (PyObject *)(void *)&spoolss_CreatePrinterIC_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_PlayGDIScriptOnPrinterIC_Type);
	PyModule_AddObject(m, "PlayGDIScriptOnPrinterIC", (PyObject *)(void *)&spoolss_PlayGDIScriptOnPrinterIC_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterIC_Type);
	PyModule_AddObject(m, "DeletePrinterIC", (PyObject *)(void *)&spoolss_DeletePrinterIC_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrintProcessor_Type);
	PyModule_AddObject(m, "DeletePrintProcessor", (PyObject *)(void *)&spoolss_DeletePrintProcessor_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrintProcessorDataTypes_Type);
	PyModule_AddObject(m, "EnumPrintProcessorDataTypes", (PyObject *)(void *)&spoolss_EnumPrintProcessorDataTypes_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ResetPrinter_Type);
	PyModule_AddObject(m, "ResetPrinter", (PyObject *)(void *)&spoolss_ResetPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterDriver2_Type);
	PyModule_AddObject(m, "GetPrinterDriver2", (PyObject *)(void *)&spoolss_GetPrinterDriver2_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_FindClosePrinterNotify_Type);
	PyModule_AddObject(m, "FindClosePrinterNotify", (PyObject *)(void *)&spoolss_FindClosePrinterNotify_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ReplyOpenPrinter_Type);
	PyModule_AddObject(m, "ReplyOpenPrinter", (PyObject *)(void *)&spoolss_ReplyOpenPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_RouterReplyPrinter_Type);
	PyModule_AddObject(m, "RouterReplyPrinter", (PyObject *)(void *)&spoolss_RouterReplyPrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_ReplyClosePrinter_Type);
	PyModule_AddObject(m, "ReplyClosePrinter", (PyObject *)(void *)&spoolss_ReplyClosePrinter_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPortEx_Type);
	PyModule_AddObject(m, "AddPortEx", (PyObject *)(void *)&spoolss_AddPortEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type);
	PyModule_AddObject(m, "RemoteFindFirstPrinterChangeNotifyEx", (PyObject *)(void *)&spoolss_RemoteFindFirstPrinterChangeNotifyEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_RouterReplyPrinterEx_Type);
	PyModule_AddObject(m, "RouterReplyPrinterEx", (PyObject *)(void *)&spoolss_RouterReplyPrinterEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_RouterRefreshPrinterChangeNotify_Type);
	PyModule_AddObject(m, "RouterRefreshPrinterChangeNotify", (PyObject *)(void *)&spoolss_RouterRefreshPrinterChangeNotify_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_OpenPrinterEx_Type);
	PyModule_AddObject(m, "OpenPrinterEx", (PyObject *)(void *)&spoolss_OpenPrinterEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPrinterEx_Type);
	PyModule_AddObject(m, "AddPrinterEx", (PyObject *)(void *)&spoolss_AddPrinterEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPort_Type);
	PyModule_AddObject(m, "SetPort", (PyObject *)(void *)&spoolss_SetPort_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrinterData_Type);
	PyModule_AddObject(m, "EnumPrinterData", (PyObject *)(void *)&spoolss_EnumPrinterData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterData_Type);
	PyModule_AddObject(m, "DeletePrinterData", (PyObject *)(void *)&spoolss_DeletePrinterData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetPrinterDataEx_Type);
	PyModule_AddObject(m, "SetPrinterDataEx", (PyObject *)(void *)&spoolss_SetPrinterDataEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterDataEx_Type);
	PyModule_AddObject(m, "GetPrinterDataEx", (PyObject *)(void *)&spoolss_GetPrinterDataEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrinterDataEx_Type);
	PyModule_AddObject(m, "EnumPrinterDataEx", (PyObject *)(void *)&spoolss_EnumPrinterDataEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPrinterKey_Type);
	PyModule_AddObject(m, "EnumPrinterKey", (PyObject *)(void *)&spoolss_EnumPrinterKey_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterDataEx_Type);
	PyModule_AddObject(m, "DeletePrinterDataEx", (PyObject *)(void *)&spoolss_DeletePrinterDataEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterKey_Type);
	PyModule_AddObject(m, "DeletePrinterKey", (PyObject *)(void *)&spoolss_DeletePrinterKey_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePrinterDriverEx_Type);
	PyModule_AddObject(m, "DeletePrinterDriverEx", (PyObject *)(void *)&spoolss_DeletePrinterDriverEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPerMachineConnection_Type);
	PyModule_AddObject(m, "AddPerMachineConnection", (PyObject *)(void *)&spoolss_AddPerMachineConnection_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeletePerMachineConnection_Type);
	PyModule_AddObject(m, "DeletePerMachineConnection", (PyObject *)(void *)&spoolss_DeletePerMachineConnection_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumPerMachineConnections_Type);
	PyModule_AddObject(m, "EnumPerMachineConnections", (PyObject *)(void *)&spoolss_EnumPerMachineConnections_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_XcvData_Type);
	PyModule_AddObject(m, "XcvData", (PyObject *)(void *)&spoolss_XcvData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_AddPrinterDriverEx_Type);
	PyModule_AddObject(m, "AddPrinterDriverEx", (PyObject *)(void *)&spoolss_AddPrinterDriverEx_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SendRecvBidiData_Type);
	PyModule_AddObject(m, "SendRecvBidiData", (PyObject *)(void *)&spoolss_SendRecvBidiData_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetCorePrinterDrivers_Type);
	PyModule_AddObject(m, "GetCorePrinterDrivers", (PyObject *)(void *)&spoolss_GetCorePrinterDrivers_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetPrinterDriverPackagePath_Type);
	PyModule_AddObject(m, "GetPrinterDriverPackagePath", (PyObject *)(void *)&spoolss_GetPrinterDriverPackagePath_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_GetJobNamedPropertyValue_Type);
	PyModule_AddObject(m, "GetJobNamedPropertyValue", (PyObject *)(void *)&spoolss_GetJobNamedPropertyValue_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_SetJobNamedProperty_Type);
	PyModule_AddObject(m, "SetJobNamedProperty", (PyObject *)(void *)&spoolss_SetJobNamedProperty_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_DeleteJobNamedProperty_Type);
	PyModule_AddObject(m, "DeleteJobNamedProperty", (PyObject *)(void *)&spoolss_DeleteJobNamedProperty_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_EnumJobNamedProperties_Type);
	PyModule_AddObject(m, "EnumJobNamedProperties", (PyObject *)(void *)&spoolss_EnumJobNamedProperties_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_LogJobInfoForBranchOffice_Type);
	PyModule_AddObject(m, "LogJobInfoForBranchOffice", (PyObject *)(void *)&spoolss_LogJobInfoForBranchOffice_Type);
	Py_INCREF((PyObject *)(void *)&spoolss_InterfaceType);
	PyModule_AddObject(m, "spoolss", (PyObject *)(void *)&spoolss_InterfaceType);
	Py_INCREF((PyObject *)(void *)&spoolss_SyntaxType);
	PyModule_AddObject(m, "spoolss_abstract_syntax", (PyObject *)(void *)&spoolss_SyntaxType);
	Py_INCREF((PyObject *)(void *)&spoolss_SyntaxType);
	PyModule_AddObject(m, "abstract_syntax", (PyObject *)(void *)&spoolss_SyntaxType);
#ifdef PY_MOD_SPOOLSS_PATCH
	PY_MOD_SPOOLSS_PATCH(m);
#endif
	out:
	Py_XDECREF(dep_samba_dcerpc_misc);
	Py_XDECREF(dep_samba_dcerpc_security);
	Py_XDECREF(dep_samba_dcerpc_winreg);
	Py_XDECREF(dep_talloc);
	Py_XDECREF(dep_samba_dcerpc_base);
	return m;

}
