import { toQueryString } from "../../utils" ; import { SdkClient } from "../common/sdk-client" ; import { UsageTransparencyModels } from "./utc-models" ; export class extends SdkClient export class UsageTransparencyClient extends SdkClient { private _baseUrl : string = "/api/usagetransparency/v3" ; param { UsageTransparencyModels . UserUsage } usageData returns memberOf public async PostUsages ( usageData ) { return await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : usageData , noResponse : true , baseUrl : `${ this . _baseUrl }/usages` , } ) ; } param { UsageTransparencyModels . Users } usages returns { Promise < UsageTransparencyModels . UsagesJob > } memberOf public async PostUsagesJobs ( usages ) { return ( await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , body : usages , baseUrl : `${ this . _baseUrl }/usagesJobs` , } ) ) as UsageTransparencyModels . UsagesJob ; } param { { date ? : Date ; tenant ? : string ; application ? : string ; unit ? : string ; page ? : number ; size ? : number ; * } } params returns { Promise < UsageTransparencyModels . UsagesJobQueryResult > } memberOf public async GetUsagesJobs ( params ? ) { return ( await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/usagesJobs?${ toQueryString ( params ) }` , } ) ) as UsageTransparencyModels . UsagesJobQueryResult ; } param { string } id param { { page ? : number ; size ? : number ; * } } params returns { Promise < UsageTransparencyModels . UsagesJobSummary > } memberOf public async GetUsagesJobsById ( id , params ? ) { return ( await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/usagesJobs/${ id }?${ toQueryString ( params ) }` , } ) ) as UsageTransparencyModels . UsagesJobSummary ; } param { string } id param { { errorClass ? : string ; page ? : number ; size ? : number ; * } } params returns { Promise < UsageTransparencyModels . UsageErrors > } memberOf public async GetUsagesJobsByIdErrors ( id , params ? ) { return ( await this . HttpAction ( { verb : "GET" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/usagesJobs/${ id }/errors?${ toQueryString ( params ) }` , } ) ) as UsageTransparencyModels . UsageErrors ; } }