import { ZosmfRestClient , nozOSMFVersion } from "@zowe/core-for-zowe-sdk" ; import { AbstractSession , Headers } from "@zowe/imperative" ; import { WorkflowConstants , noWorkflowKey } from "./WorkflowConstants" ; import { WorkflowValidator } from "./WorkflowValidator" ; import { IArchivedWorkflow } from "./doc/IArchivedWorkflow" ; export class export class ArchiveWorkflow { static deprecated param { AbstractSession } session param { string } workflowKey param { string } zOSMFVersion returns { Promise < IArchivedWorkflow > } memberof public static archiveWorfklowByKey ( session , workflowKey , zOSMFVersion = WorkflowConstants . ZOSMF_VERSION ) { return this . archiveWorkflowByKey ( session , workflowKey , zOSMFVersion ) ; } static param { AbstractSession } session param { string } workflowKey param { string } zOSMFVersion returns { Promise < IArchivedWorkflow > } memberof public static archiveWorkflowByKey ( session , workflowKey , zOSMFVersion = WorkflowConstants . ZOSMF_VERSION ) { WorkflowValidator . validateSession ( session ) ; WorkflowValidator . validateNotEmptyString ( workflowKey , noWorkflowKey . message ) ; WorkflowValidator . validateNotEmptyString ( zOSMFVersion , nozOSMFVersion . message ) ; let query = `${ WorkflowConstants . RESOURCE }/${ zOSMFVersion }/${ WorkflowConstants . WORKFLOW_RESOURCE }` ; query += `/${ workflowKey }/${ WorkflowConstants . ARCHIVE_WORKFLOW }` ; return ZosmfRestClient . postExpectJSON ( session , query , [ Headers . APPLICATION_JSON ] , null ) ; } }