forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathissueTypeProperties.ts
176 lines (166 loc) · 7.92 KB
/
issueTypeProperties.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
import * as Models from './models';
import * as Parameters from './parameters';
import { Callback } from '../callback';
import { Client } from '../clients';
import { RequestConfig } from '../requestConfig';
export class IssueTypeProperties {
constructor(private client: Client) {}
/**
* Returns all the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties)
* keys of the issue type.
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
*
* - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any
* issue type.
* - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any
* issue types associated with the projects the user has permission to browse.
*/
async getIssueTypePropertyKeys<T = Models.PropertyKeys>(
parameters: Parameters.GetIssueTypePropertyKeys | string,
callback: Callback<T>,
): Promise<void>;
/**
* Returns all the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties)
* keys of the issue type.
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
*
* - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any
* issue type.
* - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any
* issue types associated with the projects the user has permission to browse.
*/
async getIssueTypePropertyKeys<T = Models.PropertyKeys>(
parameters: Parameters.GetIssueTypePropertyKeys | string,
callback?: never,
): Promise<T>;
async getIssueTypePropertyKeys<T = Models.PropertyKeys>(
parameters: Parameters.GetIssueTypePropertyKeys | string,
callback?: Callback<T>,
): Promise<void | T> {
const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId;
const config: RequestConfig = {
url: `/rest/api/2/issuetype/${issueTypeId}/properties`,
method: 'GET',
};
return this.client.sendRequest(config, callback);
}
/**
* Returns the key and value of the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
*
* - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue
* type.
* - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue
* types associated with the projects the user has permission to browse.
*/
async getIssueTypeProperty<T = Models.EntityProperty>(
parameters: Parameters.GetIssueTypeProperty,
callback: Callback<T>,
): Promise<void>;
/**
* Returns the key and value of the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
*
* This operation can be accessed anonymously.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
*
* - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue
* type.
* - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue
* types associated with the projects the user has permission to browse.
*/
async getIssueTypeProperty<T = Models.EntityProperty>(
parameters: Parameters.GetIssueTypeProperty,
callback?: never,
): Promise<T>;
async getIssueTypeProperty<T = Models.EntityProperty>(
parameters: Parameters.GetIssueTypeProperty,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`,
method: 'GET',
};
return this.client.sendRequest(config, callback);
}
/**
* Creates or updates the value of the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
* Use this resource to store and update data against an issue type.
*
* The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The
* maximum length is 32768 characters.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async setIssueTypeProperty<T = unknown>(
parameters: Parameters.SetIssueTypeProperty,
callback: Callback<T>,
): Promise<void>;
/**
* Creates or updates the value of the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
* Use this resource to store and update data against an issue type.
*
* The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The
* maximum length is 32768 characters.
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async setIssueTypeProperty<T = unknown>(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise<T>;
async setIssueTypeProperty<T = unknown>(
parameters: Parameters.SetIssueTypeProperty,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`,
method: 'PUT',
data: parameters.propertyValue,
};
return this.client.sendRequest(config, callback);
}
/**
* Deletes the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async deleteIssueTypeProperty<T = void>(
parameters: Parameters.DeleteIssueTypeProperty,
callback: Callback<T>,
): Promise<void>;
/**
* Deletes the [issue type
* property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties).
*
* **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:**
* _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg).
*/
async deleteIssueTypeProperty<T = void>(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise<T>;
async deleteIssueTypeProperty<T = void>(
parameters: Parameters.DeleteIssueTypeProperty,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`,
method: 'DELETE',
};
return this.client.sendRequest(config, callback);
}
}