import * as service from '../service/dataassetmanager';
import * as metadataService from '../service/metadata';

import { call } from 'redux-saga/effects';

export function* importElement(payload) {
  return yield call(service.importElement, payload);
}
  
export function* getLogs(payload) {
  return yield call(service.getLogs, payload);
}

export function* listElements() {
  return yield call(service.listElements);
}

export function* listElementsAndFillValue(payload) {
  return yield call(service.listElementsAndFillValue, payload)
}

export function* listSupportSourceModels() {
  return yield call(service.listSupportSourceModels)
}

export function* listUserElements() {
  return yield call(service.listUserElements);
}

export function* listCustomElements() {
  return yield call(service.listCustomElements);
}

export function* listFilterElementIds(payload) {
  return yield call(service.listFilterElementIds, payload);
}

export function* listFilterElements() {
  return yield call(service.listFilterElements);
}

export function* listFilterElementsGroupByType(payload) {
  return yield call(service.listFilterElementsGroupByType, payload);
}

export function* setupFilterElementIds(payload) {
  return yield call(service.setupFilterElementIds, payload);
}

export function* listFilterElementIdsConfig() {
  return yield call(service.listFilterElementIdsConfig);
}

export function* setupFilterElementIdsConfig(payload) {
  return yield call(service.setupFilterElementIdsConfig, payload);
}

export function* addOrUpdateDataAsset(payload) {
  return yield call(service.addOrUpdateDataAsset, payload);
}

export function* checkCodeIsExist(payload) {
  return yield call(service.checkCodeIsExist, payload);
}

export function* checkDataAssetEditable(payload) {
  return yield call(service.checkDataAssetEditable, payload);
}

export function* addDataAssetByDirIds(payload) {
  return yield call(service.addDataAssetByDirIds, payload);
}

export function* recoverDataAssetsFromRecycleBin(payload) {
  return yield call(service.recoverDataAssetsFromRecycleBin, payload)
}

export function* deleteDataAssets(payload) {
  return yield call(service.deleteDataAssets, payload);
}

export function* getDataAssetDetail(payload) {
  return yield call(service.getDataAssetDetail, payload);
}

export function* listDataAssetDetails(payload) {
  return yield call(service.listDataAssetDetails, payload);
}

export function* listDataAssetsByPage(payload) {
  return yield call(service.listDataAssetsByPage, payload);
}

export function* listDataAssetsByPersonalCustomType(payload) {
  return yield call(service.listDataAssetsByPersonalCustomType, payload);
}

export function* listRecycleBinDataAssetsByPage(payload) {
  return yield call(service.listRecycleBinDataAssetsByPage, payload);
}
export function* addOrUpdateDirectory(payload) {
  return yield call(service.addOrUpdateDirectory, payload);
}

export function* checkDirectoryDeleteAble(payload) {
  return yield call(service.checkDirectoryDeleteAble, payload)
}

export function* deleteDirectory(payload) {
  return yield call(service.deleteDirectory, payload);
}
export function* deletePersonalCustomDirectory(payload) {
  return yield call(service.deletePersonalCustomDirectory, payload);
}
export function* existDataAsset(payload) {
  return yield call(service.existDataAsset, payload);
}
export function* queryAllDirectoryAsTree(payload) {
  return yield call(service.queryAllDirectoryAsTree, payload);
}
export function* queryDirectoryTreeByMetadataId(payload) {
  return yield call(service.queryDirectoryTreeByMetadataId, payload);
}
export function* queryDirectoryTreeAndElementTemplateByMetadataId(payload) {
  return yield call(service.queryDirectoryTreeAndElementTemplateByMetadataId, payload);
} 
export function* queryResourceDirectoryAsTree() {
  return yield call(service.queryResourceDirectoryAsTree);
} 
export function* queryAssetDirectoryAsTree() {
  return yield call(service.queryAssetDirectoryAsTree);
}
export function* listAllTopics(payload) {
  return yield call(service.listAllTopics, payload);
}

export function* directoryImport(payload) {
  return yield call(service.directoryImport, payload);
}

export function* previewTreeByCustomElements(payload) {
  return yield call(service.previewTreeByCustomElements, payload);
}

export function* previewTreeByCustomElementsAndResourceType(payload) {
  return yield call(service.previewTreeByCustomElementsAndResourceType, payload);
}

export function* saveTreeByCustomElements(payload) {
  return yield call(service.saveTreeByCustomElements, payload);
}

export function* saveTreeByCustomElementsAndResourceType(payload) {
  return yield call(service.saveTreeByCustomElementsAndResourceType, payload);
}

export function* assetImport(payload) {
  return yield call(service.assetImport, payload);
}

export function* assetImportBusinessColumn(payload) {
  return yield call(service.assetImportBusinessColumn, payload);
}

export function* getDirectoryById(payload) {
  return yield call(service.getDirectoryById, payload);
}

export function* getPersonalCustomDirectoryById(payload) {
  return yield call(service.getPersonalCustomDirectoryById, payload);
}

export function* upDownDirectory(payload) {
  return yield call(service.upDownDirectory, payload);
}

export function* upDownPersonalCustomDirectory(payload) {
  return yield call(service.upDownPersonalCustomDirectory, payload);
}

export function* listDirectoryByName(payload) {
  return yield call(service.listDirectoryByName, payload);
}

export function* getDirectoryChild(payload) {
  return yield call(service.getDirectoryChild, payload);
}

export function* getPersonalCustomDirecotryChild(payload) {
  return yield call(service.getPersonalCustomDirecotryChild, payload);
}

export function* loadDataAssets(payload) {
  return yield call(service.loadDataAssets, payload);
}

export function* listBusinessColumnElements(payload) {
  return yield call(service.listBusinessColumnElements, payload)
}

export function* listDraftStates() {
  return yield call(service.listDraftStates)
}

export function* loadDataAssetsAsDraft(payload) {
  return yield call(service.loadDataAssetsAsDraft, payload);
}

export function* unloadDataAssets(payload) {
  return yield call(service.unloadDataAssets, payload);
}

export function* unloadDataAssetsFromAllDirs(payload) {
  return yield call(service.unloadDataAssetsFromAllDirs, payload);
}

export function* getDataAssetLocation(payload) {
  return yield call(service.getDataAssetLocation, payload);
}

export function* createDataAssetByMetadataIds(payload) {
  return yield call(service.createDataAssetByMetadataIds, payload);
}

export function* importLogs(payload) {
  return yield call(service.importLogs, payload);
}

export function* importBusinessColumnLogs(payload) {
  return yield call(service.importBusinessColumnLogs, payload);
}

export function* recoveryFromRecycleBin(payload) {
  return yield call(service.recoveryFromRecycleBin, payload);
}

export function* getMetadataModelTree() {
  return yield call(service.getMetadataModelTree);
}

export function* getAttributesByMetadataModel(payload) {
  return yield call(service.getAttributesByMetadataModel, payload);
}

export function* loadElementWithoutCustom() {
  return yield call(service.loadElementWithoutCustom);
}

export function* saveEleAndAttrRel(payload) {
  return yield call(service.saveEleAndAttrRel, payload);
}

export function* getRelAttrByModel(payload) {
  return yield call(service.getRelAttrByModel, payload);
}

export function* listSourceModels(payload) {
  return yield call(service.listSourceModels, payload);
}

export function* saveEleAndAttrRelWithSourceModel(payload) {
  return yield call(service.saveEleAndAttrRelWithSourceModel, payload);
}

export function* getRelAttrBySourceModel(payload) {
  return yield call(service.getRelAttrBySourceModel, payload);
}

export function* deleteRelAttrBySourceModel(payload) {
  return yield call(service.deleteRelAttrBySourceModel, payload);
}

export function* fillElementValueBeforeCreate(payload) {
  return yield call(service.fillElementValueBeforeCreate, payload);
}

export function* countResourceState(payload) {
  return yield call(service.countResourceState, payload);
}

export function* getAssetPaths(payload) {
  return yield call(service.getAssetPaths, payload);
}

export function* getResourceRelations(payload) {
  return yield call(service.getResourceRelations, payload);
}

export function* updateResourceState(payload) {
  return yield call(service.updateResourceState, payload);
}

export function* subs(payload) {
  return yield call(service.subs, payload);
}

export function* startFlow(payload) {
  return yield call(service.startFlow, payload);
}

export function* getSystems(payload) {
  return yield call(service.getSystems, payload);
}

export function* getStandardTree(payload) {
  return yield call(service.getStandardTree, payload);
}

export function* getStandardList(payload) {
  return yield call(service.getStandardList, payload);
}

export function* standardBatchMetadata(payload) {
  return yield call(service.standardBatchMetadata, payload);
}

export function* getMetadataStandardList(payload) {
  return yield call(service.getMetadataStandardList, payload);
}

export function* deleteStandardBatchMetadata(payload) {
  return yield call(service.deleteStandardBatchMetadata, payload);
}

export function* exportIndicator(payload) {
  return yield call(service.exportIndicator, payload);
}

export function* importIndicator(payload) {
  return yield call(service.importIndicator, payload);
} 

export function* importIndicatorLog(payload) {
  return yield call(service.importIndicatorLog, payload);
} 

export function* getPermission(payload) {
  return yield call(service.getPermission, payload);
}

export function* getTemplates() {
  return yield call(service.getTemplates)
}

export function* getMetadataTemplates(payload) {
  return yield call(service.getMetadataTemplates, payload)
}

export function* checkAdmin() {
  return yield call(service.checkAdmin)
}

export function* checkIsNeedSaveAsDraft(payload) {
  return yield call(service.checkIsNeedSaveAsDraft, payload)
}

export function* checkDataKeyUser() {
  return yield call(service.checkDataKeyUser)
}

export function* offline(payload) {
  return yield call(service.offline, payload)
}

export function* getDrafts(payload) {
  return yield call(service.getDrafts, payload);
}

export function* listDraftFilterElementsGroupByType(payload) {
  return yield call(service.listDraftFilterElementsGroupByType, payload);
}

export function* getDraftDetail(payload) {
  return yield call(service.getDraftDetail, payload);
}

export function* updateDraft(payload) {
  return yield call(service.updateDraft, payload);
}

export function* deleteDrafts(payload) {
  return yield call(service.deleteDrafts, payload);
}

export function* getDraftAssetPaths(payload) {
  return yield call(service.getDraftAssetPaths, payload);
}

export function* checkDraftEditable(payload) {
  return yield call(service.checkDraftEditable, payload);
}

export function* publishDrafts(payload) {
  return yield call(service.publishDrafts, payload);
}

export function* offlineAsDraft(payload) {
  return yield call(service.offlineAsDraft, payload);
}

export function* saveAsDraft(payload) {
  return yield call(service.saveAsDraft, payload);
}

export function* distributeTask(payload) {
  return yield call(service.distributeTask, payload);
}

export function* reDistributeTask(payload) {
  return yield call(service.reDistributeTask, payload);
}

export function* submitDraft(payload) {
  return yield call(service.submitDraft, payload);
}

export function* changeToPendingSubmitDraft(payload) {
  return yield call(service.changeToPendingSubmitDraft, payload); 
}

export function* addSubscribe(payload) {
  return yield call(service.addSubscribe, payload);
}

export function* deleteSubsribe(payload) {
  return yield call(service.deleteSubsribe, payload);
}

export function* subsribeDataList(payload) {
  return yield call(service.subsribeDataList, payload);
}

export function* startProcess(payload) {
  return yield call(service.startProcess, payload);
}

export function* getRelatedAssets(payload) {
  return yield call(service.getRelatedAssets, payload);
}

export function* getRelatedServices(payload) {
  return yield call(service.getRelatedServices, payload);
}

export function* fillRelatedAssetsInfo(payload) {
  return yield call(service.fillRelatedAssetsInfo, payload);
}

export function* getDraftRelatedAssets(payload) {
  return yield call(service.getDraftRelatedAssets, payload);
}

export function* getDraftRelatedServices(payload) {
  return yield call(service.getDraftRelatedServices, payload);
}

export function* importDraftLogs(payload) {
  return yield call(service.importDraftLogs, payload);
}

export function* draftAssetImport(payload) {
  return yield call(service.draftAssetImport, payload);
}

export function* fillRelationDisplayInfo(payload) {
  return yield call(service.fillRelationDisplayInfo, payload);
}

export function* getColumns(payload) {
  return yield call(service.getColumns, payload)
}

export function* getBusinessColumns(payload) {
  return yield call(service.getBusinessColumns, payload);
}

export function* saveBusinessColumns(payload) {
  return yield call(service.saveBusinessColumns, payload);
}

export function* listSupportReportTypes() {
  return yield call(service.listSupportReportTypes)
}

export function* listWorkbooksByType(payload) {
  return yield call(service.listWorkbooksByType, payload)
}

export function* getViewUrlByWorkbookId(payload) {
  return yield call(service.getViewUrlByWorkbookId, payload)
}

export function* saveWorkbookByType(payload) {
  return yield call(service.saveWorkbookByType, payload)
}

export function* deleteWorkbooks(payload) {
  return yield call(service.deleteWorkbooks, payload)
}

export function* getEvaluations(payload) {
  return yield call(service.getEvaluations, payload)
}

export function* saveEvaluation(payload) {
  return yield call(service.saveEvaluation, payload)
}

export function* runEvaluations(payload) {
  return yield call(service.runEvaluations, payload)
}

export function* deleteEvaluations(payload) {
  return yield call(service.deleteEvaluations, payload)
}

export function* listTasks(payload) {
  return yield call(service.listTasks, payload);
}

export function* saveTask(payload) {
  return yield call(service.saveTask, payload);
}

export function* auditTask(payload) {
  return yield call(service.auditTask, payload);
}

export function* uploadDataAssetExcel(payload) {
  return yield call(service.uploadDataAssetExcel, payload);
}

export function* compareDataAssetWithDescribeInfo(payload) {
  return yield call(service.compareDataAssetWithDescribeInfo, payload);
}

export function* listDataAssetHistoryTimeline(payload) {
  return yield call(service.listDataAssetHistoryTimeline, payload);
}

export function* queryCustomTypeRootDirectory() {
  return yield call(service.queryCustomTypeRootDirectory);
}

export function* getPrivilegeByRange(payload) {
  return yield call(service.getPrivilegeByRange, payload);
}

export function* getPrivilegeByRangeAndDirId(payload) {
  return yield call(service.getPrivilegeByRangeAndDirId, payload);
}

export function* submitForAudit(payload) {
  return yield call(service.submitForAudit, payload);
}

export function* listSubmitForAuditAssetsInfo(payload) {
  return yield call(service.listSubmitForAuditAssetsInfo, payload);
}

export function* uploadAttachment(payload) {
  return yield call(service.uploadAttachment, payload);
}

export function* processDetail(payload) {
  return yield call(service.processDetail, payload);
}

export function* auditProcess(payload) {
  return yield call(service.auditProcess, payload);
}

export function* saveCustomTree(payload) {
  return yield call(service.saveCustomTree, payload);
}
