import { ICollectParms , IIssueParms } from "./" ; import { IZosmfIssueParms } from "./doc/zosmf/IZosmfIssueParms" ; import { AbstractSession , ImperativeExpect , TextUtils } from "@zowe/imperative" ; import { noSession } from "@zowe/core-for-zowe-sdk" ; import { noCollectParameters , noCommandKey , noConsoleInput , noConsoleName , noZosmfInput } from "./ConsoleConstants" ; export class export class ConsoleValidator { static param { AbstractSession } session param { string } consoleName param { IZosmfIssueParms } commandParms see { IZosmfIssueParms } memberof public static validateCommonParms ( session , consoleName , commandParms ) { this . validateSession ( session ) ; this . validateConsoleName ( consoleName ) ; ImperativeExpect . toNotBeNullOrUndefined ( commandParms , noZosmfInput . message ) ; } static param { AbstractSession } session param { IIssueParms } parms see { IIssueParms } memberof public static validateIssueParms ( session , parms ) { this . validateSession ( session ) ; this . validateIssueParm ( parms ) ; } static param { AbstractSession } session param { string } theCommand memberof public static validateIssueSimpleParms ( session , theCommand ) { this . validateSession ( session ) ; ImperativeExpect . toNotBeNullOrUndefined ( theCommand , noConsoleInput . message ) ; } static param { ICollectParms } parms see { ICollectParms } memberof public static validateCollectParm ( parms ) { ImperativeExpect . toNotBeNullOrUndefined ( parms , noCollectParameters . message ) ; } static param { IIssueParms } parms see { IIssueParms } memberof public static validateIssueParm ( parms ) { ImperativeExpect . toNotBeNullOrUndefined ( parms , noConsoleInput . message ) ; } static param { AbstractSession } session param { string } consoleName param { string } commandResponseKey memberof public static validateCollectCommonParms ( session , consoleName , commandResponseKey ) { this . validateSession ( session ) ; this . validateConsoleName ( consoleName ) ; ImperativeExpect . toNotBeNullOrUndefined ( commandResponseKey , noCommandKey . message ) ; } static param { AbstractSession } session param { ICollectParms } parms see { ICollectParms } memberof public static validateCollectParms ( session , parms ) { this . validateSession ( session ) ; this . validateCollectParm ( parms ) ; } static param { AbstractSession } session memberof private static validateSession ( session ) { ImperativeExpect . toNotBeNullOrUndefined ( session , TextUtils . formatMessage ( noSession . message ) ) ; } static param { string } consoleName memberof private static validateConsoleName ( consoleName ) { ImperativeExpect . toNotBeNullOrUndefined ( consoleName , noConsoleName . message ) ; } }