forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsight.ts
45 lines (42 loc) · 1.61 KB
/
insight.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { RequestConfig } from '../requestConfig';
export class Insight {
constructor(private client: Client) {}
/**
* Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST
* APIs](https://developer.atlassian.com/cloud/insight/rest).
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any
*/
async getInsightWorkspaces<T = Models.PagedInsightWorkspace>(
parameters: Parameters.GetInsightWorkspaces | undefined,
callback: Callback<T>,
): Promise<void>;
/**
* Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST
* APIs](https://developer.atlassian.com/cloud/insight/rest).
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any
*/
async getInsightWorkspaces<T = Models.PagedInsightWorkspace>(
parameters?: Parameters.GetInsightWorkspaces,
callback?: never,
): Promise<T>;
async getInsightWorkspaces<T = Models.PagedInsightWorkspace>(
parameters?: Parameters.GetInsightWorkspaces,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/servicedeskapi/insight/workspace',
method: 'GET',
params: {
start: parameters?.start,
limit: parameters?.limit,
},
};
return this.client.sendRequest(config, callback);
}
}