import { toQueryString } from "../../utils" ; import { SdkClient } from "../common/sdk-client" ; import { JobManagerModels } from "./jobmanager-models" ; export class extends SdkClient export class JobManagerClient extends SdkClient { private _baseUrl : string = "/api/jobmanager/v3" ; param { { pageNumber ? : number ; pageSize ? : number ; filter ? : string ; * } } params returns { Promise < JobManagerModels . JobList > } example memberOf public async GetJobs ( params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/jobs?${ toQueryString ( parameters ) }` , } ) ; return result as JobManagerModels . JobList ; } param { JobManagerModels . JobParameters } parameter returns { Promise < JobManagerModels . Job > } memberOf public async PostJob ( parameter ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : parameter , baseUrl : `${ this . _baseUrl }/jobs` , } ) ; return result as JobManagerModels . Job ; } param { string } id returns { Promise < JobManagerModels . Job > } memberOf public async GetJob ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/jobs/${ id }` , } ) ; return result as JobManagerModels . Job ; } param { string } id returns { Promise < JobManagerModels . Job > } memberOf public async StopJob ( id ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/jobs/${ id }/stop` , } ) ; return result as JobManagerModels . Job ; } param { { pageNumber ? : number ; pageSize ? : number ; filter ? : string ; * } } params returns { Promise < JobManagerModels . ScheduleList > } example memberOf public async GetSchedules ( params ? ) { const parameters = params || { } ; const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/schedules?${ toQueryString ( parameters ) }` , body : { } , additionalHeaders : { "Content-Type" : "application/json" } , } ) ; return result as JobManagerModels . ScheduleList ; } param { JobManagerModels . ScheduleParameters } parameters returns { Promise < JobManagerModels . ScheduleDetails > } memberOf public async PostSchedule ( parameters ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : parameters , baseUrl : `${ this . _baseUrl }/schedules` , } ) ; return result as JobManagerModels . ScheduleDetails ; } param { string } id returns { Promise < JobManagerModels . ScheduleDetails > } memberOf public async GetSchedule ( id ) { const result = await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/schedules/${ id }` , } ) ; return result as JobManagerModels . ScheduleDetails ; } param { string } id memberOf public async DeleteSchedule ( id ) { await this . HttpAction ( { verb : "DELETE" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/schedules/${ id }` , noResponse : true , } ) ; } param { string } id returns { Promise < JobManagerModels . ScheduleDetails > } memberOf public async StartSchedule ( id ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/schedules/${ id }/start` , } ) ; return result as JobManagerModels . ScheduleDetails ; } param { string } id returns { Promise < JobManagerModels . ScheduleDetails > } memberOf public async StopSchedule ( id ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/schedules/${ id }/stop` , } ) ; return result as JobManagerModels . ScheduleDetails ; } }