import { AbstractSession , Headers } from "@zowe/imperative" ; import { ZosmfRestClient , nozOSMFVersion } from "@zowe/core-for-zowe-sdk" ; import { noInstanceId , ProvisioningConstants } from "./ProvisioningConstants" ; import { ProvisioningValidator } from "./ProvisioningValidator" ; export class export class DeleteInstance { param { AbstractSession } session param { string } zOSMFVersion param { string } instanceId returns { Promise < { } > } memberof public static deleteDeprovisionedInstance ( session , zOSMFVersion , instanceId ) { ProvisioningValidator . validateSession ( session ) ; ProvisioningValidator . validateNotEmptyString ( zOSMFVersion , nozOSMFVersion . message ) ; ProvisioningValidator . validateNotEmptyString ( instanceId , noInstanceId . message ) ; let resourcesQuery = `${ ProvisioningConstants . RESOURCE }/${ zOSMFVersion }/` ; resourcesQuery += `${ ProvisioningConstants . INSTANCES_RESOURCE }/${ instanceId }` ; return ZosmfRestClient . deleteExpectString ( session , resourcesQuery , [ Headers . APPLICATION_JSON ] ) ; } }