forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflowStatuses.ts
73 lines (67 loc) · 2.7 KB
/
workflowStatuses.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { RequestConfig } from '../requestConfig';
export class WorkflowStatuses {
constructor(private client: Client) {}
/**
* Returns a list of all statuses associated with active workflows.
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None.
*/
async getStatuses<T = Models.StatusDetails[]>(callback: Callback<T>): Promise<void>;
/**
* Returns a list of all statuses associated with active workflows.
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None.
*/
async getStatuses<T = Models.StatusDetails[]>(callback?: never): Promise<T>;
async getStatuses<T = Models.StatusDetails[]>(callback?: Callback<T>): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/api/3/status',
method: 'GET',
};
return this.client.sendRequest(config, callback);
}
/**
* Returns a status. The status must be associated with an active workflow to be returned.
*
* If a name is used on more than one status, only the status found first is returned. Therefore, identifying the
* status by its ID may be preferable.
*
* This operation can be accessed anonymously.
*
* [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None.
*/
async getStatus<T = Models.StatusDetails>(
parameters: Parameters.GetStatus | string,
callback: Callback<T>,
): Promise<void>;
/**
* Returns a status. The status must be associated with an active workflow to be returned.
*
* If a name is used on more than one status, only the status found first is returned. Therefore, identifying the
* status by its ID may be preferable.
*
* This operation can be accessed anonymously.
*
* [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None.
*/
async getStatus<T = Models.StatusDetails>(parameters: Parameters.GetStatus | string, callback?: never): Promise<T>;
async getStatus<T = Models.StatusDetails>(
parameters: Parameters.GetStatus | string,
callback?: Callback<T>,
): Promise<void | T> {
const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName;
const config: RequestConfig = {
url: `/rest/api/3/status/${idOrName}`,
method: 'GET',
};
return this.client.sendRequest(config, callback);
}
}