import { AbstractSession } from "@zowe/imperative" ; import { ZosmfRestClient , nozOSMFVersion } from "@zowe/core-for-zowe-sdk" ; import { ProvisioningValidator } from "./ProvisioningValidator" ; import { noTemplateName , ProvisioningConstants } from "./ProvisioningConstants" ; import { IPublishedTemplateInfo } from "./doc/zosmf/IPublishedTemplateInfo" ; export class export class ListTemplateInfo { param { AbstractSession } session param { string } zOSMFVersion param { string } templateName returns { Promise < IPublishedTemplateInfo > } see { IPublishedTemplateInfo } memberof public static async listTemplateCommon ( session , zOSMFVersion , templateName ) { ProvisioningValidator . validateSession ( session ) ; ProvisioningValidator . validateNotEmptyString ( zOSMFVersion , nozOSMFVersion . message ) ; ProvisioningValidator . validateNotEmptyString ( templateName , noTemplateName . message ) ; const listTemplateInfoResources = this . getResourcesQuery ( zOSMFVersion , templateName ) ; return ZosmfRestClient . getExpectJSON < IPublishedTemplateInfo > ( session , listTemplateInfoResources ) ; } param { string } zOSMFVersion param { string } templateName returns { string } memberof public static getResourcesQuery ( zOSMFVersion , templateName ) { let resourcesQuery = `${ ProvisioningConstants . RESOURCE }/${ zOSMFVersion }/` ; resourcesQuery += `${ ProvisioningConstants . TEMPLATES_RESOURCES }/${ templateName }` ; return resourcesQuery ; } }