import { AbstractSession } from "@zowe/imperative" ; import { ZosmfRestClient , nozOSMFVersion } from "@zowe/core-for-zowe-sdk" ; import { WorkflowConstants , noWorkflowKey } from "./WorkflowConstants" ; import { WorkflowValidator } from "./WorkflowValidator" ; /**
 * Class to handle deletion of zOSMF workflow instance
 */ export class DeleteWorkflow { param { AbstractSession } session param { string } workflowKey param { string } zOSMFVersion returns { string } public static async deleteWorkflow ( session , workflowKey , zOSMFVersion = WorkflowConstants . ZOSMF_VERSION ) { WorkflowValidator . validateSession ( session ) ; WorkflowValidator . validateNotEmptyString ( zOSMFVersion , nozOSMFVersion . message ) ; WorkflowValidator . validateNotEmptyString ( workflowKey , noWorkflowKey . message ) ; let resourcesQuery = `${ WorkflowConstants . RESOURCE }/${ zOSMFVersion }/` ; resourcesQuery += `${ WorkflowConstants . WORKFLOW_RESOURCE }/${ workflowKey }` ; return ZosmfRestClient . deleteExpectString ( session , resourcesQuery , [ ] ) ; } }