def object_from_dict(cls, share_attributes): share_obj = win_network_share_binding.WindowsNetworkShareObjectType() share_obj.set_anyAttributes_({'xsi:type' : 'WinNetworkShareObj:WindowsNetworkShareObjectType'}) for key, value in share_attributes.items(): if key == 'netname' and utils.test_value(value): share_obj.set_Netname(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) elif key == 'local_path' and utils.test_value(value): share_obj.set_Local_Path(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) elif key == 'type' and utils.test_value(value): share_obj.set_Type(win_network_share_binding.SharedResourceType(valueOf_=value)) elif key == 'current_uses' and utils.test_value(value): share_obj.set_Current_Uses(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'), value)) elif key == 'max_uses' and utils.test_value(value): share_obj.set_Max_Uses(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'), value)) return share_obj
def object_from_dict(cls, win_kernel_hook_attributes): hookobject = win_kernel_hook_binding.WindowsKernelHookObjectType() hookobject.set_anyAttributes_({'xsi:type' : 'WinKernelHookObj:WindowsKernelHookObjectType'}) for key, value in win_kernel_hook_attributes.items(): if key == 'hooked_function' and utils.test_value(value): hookobject.set_Hooked_Function(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) if key == 'hooked_module_name' and utils.test_value(value): hookobject.set_Hooked_Module(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) if key == 'hooking_module_name' and utils.test_value(value): hookobject.set_Hooking_Module(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) elif key == 'description' and utils.test_value(value): hookobject.set_Hook_Description(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value)) elif key == 'address' and utils.test_value(value): hookobject.set_Hooking_Address(Base_Object_Attribute.object_from_dict(common_types_binding.UnsignedLongObjectAttributeType(datatype='UnsignedLong'), value)) elif key == 'type' and utils.test_value(value): hookobject.set_Type(win_kernel_hook_binding.KernelHookType(valueOf_=value)) elif key == 'digital_signature_hooking' and utils.test_value(value): hookobject.set_Digital_Signature_Hooking(Digital_Signature.object_from_dict(value)) elif key == 'digital_signature_hooked' and utils.test_value(value): hookobject.set_Digital_Signature_Hooked(Digital_Signature.object_from_dict(value)) return hookobject