import { AbstractSession , Headers } from "@zowe/imperative" ; import { ZosmfRestClient } from "@zowe/core-for-zowe-sdk" ; import { TsoValidator } from "./TsoValidator" ; import { noPingInput , TsoConstants } from "./TsoConstants" ; import { IZosmfPingResponse } from "./doc/zosmf/IZosmfPingResponse" ; import { TsoResponseService } from "./TsoResponseService" ; import { IPingResponse } from "./doc/IPingResponse" ; export class PingTso { static param { AbstractSession } session param { string } servletKey param { IZosmfPingResponse } res return { IPingResponse } see { IPingResponse } memberof public static async ping ( session , servletKey ) { TsoValidator . validatePingParms ( session , servletKey , noPingInput . message ) ; const res = await ZosmfRestClient . putExpectJSON < IZosmfPingResponse > ( session , PingTso . getResource ( servletKey ) , [ Headers . APPLICATION_JSON ] , null ) ; TsoValidator . validateErrorMessageFromZosmf ( res ) ; const result = TsoResponseService . populatePing ( res ) ; return result ; } static param { string } servletKey return { string } memberof public static getResource ( servletKey ) { TsoValidator . validateNotEmptyString ( servletKey , noPingInput . message ) ; return TsoConstants . RES_PING + "/" + servletKey ; } }