import * as Models from './models'; import { Callback } from '../callback'; import { Client } from '../clients'; import { RequestConfig } from '../requestConfig'; export class LicenseMetrics { constructor(private client: Client) {} /** * Returns licensing information about the Jira instance. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getLicense(callback: Callback): Promise; /** * Returns licensing information about the Jira instance. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getLicense(callback?: never): Promise; async getLicense(callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/instance/license', method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with * a 7-day lifecycle and could be stale at the time of call. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getApproximateLicenseCount(callback: Callback): Promise; /** * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with * a 7-day lifecycle and could be stale at the time of call. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getApproximateLicenseCount(callback?: never): Promise; async getApproximateLicenseCount(callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/license/approximateLicenseCount', method: 'GET', }; return this.client.sendRequest(config, callback); } /** * Returns the total approximate number of user accounts for a single Jira license. Note that this information is * cached with a 7-day lifecycle and could be stale at the time of call. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getApproximateApplicationLicenseCount( applicationKey: string, callback: Callback, ): Promise; /** * Returns the total approximate number of user accounts for a single Jira license. Note that this information is * cached with a 7-day lifecycle and could be stale at the time of call. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getApproximateApplicationLicenseCount( applicationKey: string, callback?: never, ): Promise; async getApproximateApplicationLicenseCount( applicationKey: string, callback?: Callback, ): Promise { const config: RequestConfig = { url: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, method: 'GET', }; return this.client.sendRequest(config, callback); } }