@resolution/jira-api-client 0.4.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +27 -4
- package/lib/index.d.ts +13 -0
- package/lib/index.js +17 -1
- package/lib/index.js.map +1 -1
- package/lib/openapi/platform/BaseJiraPlatformApiClient.d.ts +1 -1
- package/lib/openapi/platform/BaseJiraPlatformApiClient.js +1 -1
- package/lib/openapi/platform/services/DashboardsService.d.ts +7 -1
- package/lib/openapi/platform/services/DashboardsService.js +4 -1
- package/lib/openapi/platform/services/DashboardsService.js.map +1 -1
- package/lib/openapi/platform/services/IssueSearchService.d.ts +8 -1
- package/lib/openapi/platform/services/IssueSearchService.js +2 -1
- package/lib/openapi/platform/services/IssueSearchService.js.map +1 -1
- package/lib/openapi/platform/services/IssuesService.d.ts +8 -1
- package/lib/openapi/platform/services/IssuesService.js +2 -1
- package/lib/openapi/platform/services/IssuesService.js.map +1 -1
- package/lib/openapi/platform/services/PermissionsService.d.ts +7 -0
- package/lib/openapi/platform/services/PermissionsService.js +7 -0
- package/lib/openapi/platform/services/PermissionsService.js.map +1 -1
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.d.ts +46 -0
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.js +78 -0
- package/lib/openapi/serviceManagement/BaseJiraServiceManagementApiClient.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.d.ts +196 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.js +390 -0
- package/lib/openapi/serviceManagement/core/CommonHttpClient.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.d.ts +9 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.js +29 -0
- package/lib/openapi/serviceManagement/core/CommonHttpService.js.map +1 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.d.ts +35 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.js +65 -0
- package/lib/openapi/serviceManagement/core/CommonValidationSchemaStorage.js.map +1 -0
- package/lib/openapi/serviceManagement/models/assets.d.ts +54 -0
- package/lib/openapi/serviceManagement/models/assets.js +60 -0
- package/lib/openapi/serviceManagement/models/assets.js.map +1 -0
- package/lib/openapi/serviceManagement/models/common.d.ts +228 -0
- package/lib/openapi/serviceManagement/models/common.js +172 -0
- package/lib/openapi/serviceManagement/models/common.js.map +1 -0
- package/lib/openapi/serviceManagement/models/customer.d.ts +30 -0
- package/lib/openapi/serviceManagement/models/customer.js +27 -0
- package/lib/openapi/serviceManagement/models/customer.js.map +1 -0
- package/lib/openapi/serviceManagement/models/info.d.ts +18 -0
- package/lib/openapi/serviceManagement/models/info.js +24 -0
- package/lib/openapi/serviceManagement/models/info.js.map +1 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.d.ts +24 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.js +32 -0
- package/lib/openapi/serviceManagement/models/knowledgebase.js.map +1 -0
- package/lib/openapi/serviceManagement/models/organization.d.ts +76 -0
- package/lib/openapi/serviceManagement/models/organization.js +65 -0
- package/lib/openapi/serviceManagement/models/organization.js.map +1 -0
- package/lib/openapi/serviceManagement/models/request.d.ts +594 -0
- package/lib/openapi/serviceManagement/models/request.js +516 -0
- package/lib/openapi/serviceManagement/models/request.js.map +1 -0
- package/lib/openapi/serviceManagement/models/servicedesk.d.ts +525 -0
- package/lib/openapi/serviceManagement/models/servicedesk.js +442 -0
- package/lib/openapi/serviceManagement/models/servicedesk.js.map +1 -0
- package/lib/openapi/serviceManagement/services/AssetsService.d.ts +61 -0
- package/lib/openapi/serviceManagement/services/AssetsService.js +113 -0
- package/lib/openapi/serviceManagement/services/AssetsService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/CustomerService.d.ts +63 -0
- package/lib/openapi/serviceManagement/services/CustomerService.js +93 -0
- package/lib/openapi/serviceManagement/services/CustomerService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/InfoService.d.ts +34 -0
- package/lib/openapi/serviceManagement/services/InfoService.js +71 -0
- package/lib/openapi/serviceManagement/services/InfoService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.d.ts +81 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.js +106 -0
- package/lib/openapi/serviceManagement/services/KnowledgebaseService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.d.ts +589 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.js +762 -0
- package/lib/openapi/serviceManagement/services/OrganizationService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/RequestService.d.ts +2736 -0
- package/lib/openapi/serviceManagement/services/RequestService.js +3056 -0
- package/lib/openapi/serviceManagement/services/RequestService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.d.ts +166 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.js +190 -0
- package/lib/openapi/serviceManagement/services/RequesttypeService.js.map +1 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.d.ts +1268 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.js +1510 -0
- package/lib/openapi/serviceManagement/services/ServicedeskService.js.map +1 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.d.ts +3 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.js +144 -0
- package/lib/openapi/serviceManagement/validationSchemaStorage.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,762 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationService = void 0;
|
|
4
|
+
// DO NOT EDIT!
|
|
5
|
+
// This file is generated by "api-typescript-generator".
|
|
6
|
+
// To update this file run "yarn build:openapi".
|
|
7
|
+
const zod_1 = require("zod");
|
|
8
|
+
const commonHttpClient = require("../core/CommonHttpClient");
|
|
9
|
+
const CommonHttpService_1 = require("../core/CommonHttpService");
|
|
10
|
+
const common_1 = require("../models/common");
|
|
11
|
+
const organization_1 = require("../models/organization");
|
|
12
|
+
const validationSchemaStorage_1 = require("../validationSchemaStorage");
|
|
13
|
+
/** @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization */
|
|
14
|
+
class OrganizationService extends CommonHttpService_1.CommonHttpService {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
/**
|
|
18
|
+
* This method adds an organization to a service desk. If the organization ID is
|
|
19
|
+
* already associated with the service desk, no change is made and the resource
|
|
20
|
+
* returns a 204 success code.
|
|
21
|
+
*
|
|
22
|
+
* **[Permissions](#permissions) required**: Service desk's agent.
|
|
23
|
+
*
|
|
24
|
+
* @path {POST} /rest/servicedeskapi/servicedesk/{serviceDeskId}/organization
|
|
25
|
+
* @scopes-current manage:servicedesk-customer
|
|
26
|
+
* @scopes-beta read:servicedesk.organization:jira-service-management,
|
|
27
|
+
* write:servicedesk.organization:jira-service-management
|
|
28
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-post
|
|
29
|
+
*/
|
|
30
|
+
this.addOrganization = ({ serviceDeskId, organizationServiceDeskUpdateDto, }) => {
|
|
31
|
+
return this.getClientInstance()
|
|
32
|
+
.request({
|
|
33
|
+
path: "/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization",
|
|
34
|
+
method: "POST",
|
|
35
|
+
pathParams: {
|
|
36
|
+
serviceDeskId,
|
|
37
|
+
},
|
|
38
|
+
headers: {
|
|
39
|
+
"Content-Type": "application/json",
|
|
40
|
+
},
|
|
41
|
+
body: organizationServiceDeskUpdateDto,
|
|
42
|
+
})
|
|
43
|
+
.then(commonHttpClient.discardResult);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* This method adds users to an organization.
|
|
47
|
+
*
|
|
48
|
+
* **[Permissions](#permissions) required**: Service desk administrator or agent.
|
|
49
|
+
* Note: Permission to add users to an organization can be switched to users with
|
|
50
|
+
* the Jira administrator permission, using the **[Organization
|
|
51
|
+
* management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)**
|
|
52
|
+
* feature.
|
|
53
|
+
*
|
|
54
|
+
* @path {POST} /rest/servicedeskapi/organization/{organizationId}/user
|
|
55
|
+
* @scopes-current manage:servicedesk-customer
|
|
56
|
+
* @scopes-beta read:organization.user:jira-service-management,
|
|
57
|
+
* write:organization.user:jira-service-management, read:user:jira
|
|
58
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-user-post
|
|
59
|
+
*/
|
|
60
|
+
this.addUsersToOrganization = ({ organizationId, usersOrganizationUpdateDto, }) => {
|
|
61
|
+
return this.getClientInstance()
|
|
62
|
+
.request({
|
|
63
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/user",
|
|
64
|
+
method: "POST",
|
|
65
|
+
pathParams: {
|
|
66
|
+
organizationId,
|
|
67
|
+
},
|
|
68
|
+
headers: {
|
|
69
|
+
"Content-Type": "application/json",
|
|
70
|
+
},
|
|
71
|
+
body: usersOrganizationUpdateDto,
|
|
72
|
+
})
|
|
73
|
+
.then(commonHttpClient.discardResult);
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* This method creates an organization by passing the name of the organization.
|
|
77
|
+
*
|
|
78
|
+
* **[Permissions](#permissions) required**: Service desk administrator or agent.
|
|
79
|
+
* Note: Permission to create organizations can be switched to users with the Jira
|
|
80
|
+
* administrator permission, using the **[Organization
|
|
81
|
+
* management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)**
|
|
82
|
+
* feature.
|
|
83
|
+
*
|
|
84
|
+
* @returns Returns the created organization or the existing organization if name already
|
|
85
|
+
* exists.
|
|
86
|
+
*
|
|
87
|
+
* example: {
|
|
88
|
+
* "id": "1",
|
|
89
|
+
* "name": "Charlie Cakes Franchises",
|
|
90
|
+
* "_links": {
|
|
91
|
+
* "self":
|
|
92
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1"
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
95
|
+
* @path {POST} /rest/servicedeskapi/organization
|
|
96
|
+
* @scopes-current manage:servicedesk-customer
|
|
97
|
+
* @scopes-beta read:organization:jira-service-management,
|
|
98
|
+
* write:organization:jira-service-management
|
|
99
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-post
|
|
100
|
+
*/
|
|
101
|
+
this.createOrganization = ({ organizationCreateDto, }) => {
|
|
102
|
+
return this.getClientInstance()
|
|
103
|
+
.request({
|
|
104
|
+
path: "/rest/servicedeskapi/organization",
|
|
105
|
+
method: "POST",
|
|
106
|
+
headers: {
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
},
|
|
109
|
+
body: organizationCreateDto,
|
|
110
|
+
})
|
|
111
|
+
.then(this.getClientInstance().responseHandler({
|
|
112
|
+
201: {
|
|
113
|
+
"application/json": "json",
|
|
114
|
+
},
|
|
115
|
+
}))
|
|
116
|
+
.then(commonHttpClient.castResponse())
|
|
117
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.createOrganization.response"))
|
|
118
|
+
.then(commonHttpClient.getBody);
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* This method deletes an organization. Note that the organization is deleted
|
|
122
|
+
* regardless of other associations it may have. For example, associations with
|
|
123
|
+
* service desks.
|
|
124
|
+
*
|
|
125
|
+
* **[Permissions](#permissions) required**: Jira administrator.
|
|
126
|
+
*
|
|
127
|
+
* @path {DELETE} /rest/servicedeskapi/organization/{organizationId}
|
|
128
|
+
* @scopes-current manage:servicedesk-customer
|
|
129
|
+
* @scopes-beta read:organization:jira-service-management,
|
|
130
|
+
* delete:organization:jira-service-management
|
|
131
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-delete
|
|
132
|
+
*/
|
|
133
|
+
this.deleteOrganization = ({ organizationId, }) => {
|
|
134
|
+
return this.getClientInstance()
|
|
135
|
+
.request({
|
|
136
|
+
path: "/rest/servicedeskapi/organization/{organizationId}",
|
|
137
|
+
method: "DELETE",
|
|
138
|
+
pathParams: {
|
|
139
|
+
organizationId,
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
.then(commonHttpClient.discardResult);
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Removes an organization property. Organization properties are a type of entity
|
|
146
|
+
* property which are available to the API only, and not shown in Jira Service
|
|
147
|
+
* Management. [Learn
|
|
148
|
+
* more](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
|
|
149
|
+
*
|
|
150
|
+
* For operations relating to organization detail field values which are visible
|
|
151
|
+
* in Jira Service Management, see the [Customer Service Management REST
|
|
152
|
+
* API](https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-group-organization).
|
|
153
|
+
*
|
|
154
|
+
* **[Permissions](#permissions) required**: Service Desk Administrator or Agent.
|
|
155
|
+
*
|
|
156
|
+
* Note: Permission to manage organizations can be switched to users with the Jira
|
|
157
|
+
* administrator permission, using the **[Organization
|
|
158
|
+
* management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)**
|
|
159
|
+
* feature.
|
|
160
|
+
*
|
|
161
|
+
* @path {DELETE}
|
|
162
|
+
* /rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}
|
|
163
|
+
* @scopes-current manage:servicedesk-customer
|
|
164
|
+
* @scopes-beta read:organization.property:jira-service-management,
|
|
165
|
+
* delete:organization.property:jira-service-management
|
|
166
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-property-propertykey-delete
|
|
167
|
+
*/
|
|
168
|
+
this.deleteProperty = ({ organizationId, propertyKey, }) => {
|
|
169
|
+
return this.getClientInstance()
|
|
170
|
+
.request({
|
|
171
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}",
|
|
172
|
+
method: "DELETE",
|
|
173
|
+
pathParams: {
|
|
174
|
+
organizationId,
|
|
175
|
+
propertyKey,
|
|
176
|
+
},
|
|
177
|
+
})
|
|
178
|
+
.then(commonHttpClient.discardResult);
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* This method returns details of an organization. Use this method to get
|
|
182
|
+
* organization details whenever your application component is passed an
|
|
183
|
+
* organization ID but needs to display other organization details.
|
|
184
|
+
*
|
|
185
|
+
* To get organization detail field values which are visible in Jira Service
|
|
186
|
+
* Management, see the [Customer Service Management REST
|
|
187
|
+
* API](https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-group-organization).
|
|
188
|
+
*
|
|
189
|
+
* **[Permissions](#permissions) required**: Any
|
|
190
|
+
*
|
|
191
|
+
* **Response limitations**: Customers can only retrieve organization of which
|
|
192
|
+
* they are members.
|
|
193
|
+
*
|
|
194
|
+
* @returns Returns the requested organization.
|
|
195
|
+
*
|
|
196
|
+
* example: {
|
|
197
|
+
* "id": "1",
|
|
198
|
+
* "name": "Charlie Cakes Franchises",
|
|
199
|
+
* "_links": {
|
|
200
|
+
* "self":
|
|
201
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1"
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
* @path {GET} /rest/servicedeskapi/organization/{organizationId}
|
|
205
|
+
* @scopes-current manage:servicedesk-customer
|
|
206
|
+
* @scopes-beta read:organization:jira-service-management
|
|
207
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-get
|
|
208
|
+
*/
|
|
209
|
+
this.getOrganization = ({ organizationId, }) => {
|
|
210
|
+
return this.getClientInstance()
|
|
211
|
+
.request({
|
|
212
|
+
path: "/rest/servicedeskapi/organization/{organizationId}",
|
|
213
|
+
method: "GET",
|
|
214
|
+
pathParams: {
|
|
215
|
+
organizationId,
|
|
216
|
+
},
|
|
217
|
+
})
|
|
218
|
+
.then(this.getClientInstance().responseHandler({
|
|
219
|
+
200: {
|
|
220
|
+
"application/json": "json",
|
|
221
|
+
},
|
|
222
|
+
}))
|
|
223
|
+
.then(commonHttpClient.castResponse())
|
|
224
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getOrganization.response"))
|
|
225
|
+
.then(commonHttpClient.getBody);
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* This method returns a list of organizations in the Jira Service Management
|
|
229
|
+
* instance. Use this method when you want to present a list of organizations or
|
|
230
|
+
* want to locate an organization by name.
|
|
231
|
+
*
|
|
232
|
+
* **[Permissions](#permissions) required**: Any. However, to fetch organizations
|
|
233
|
+
* based on `accountId` the user must have a Service Desk agent license.
|
|
234
|
+
*
|
|
235
|
+
* **Response limitations**: If the user is a customer, only those organizations
|
|
236
|
+
* of which the customer is a member are listed.
|
|
237
|
+
*
|
|
238
|
+
* @returns Returns paginated list of organizations.
|
|
239
|
+
*
|
|
240
|
+
* example: {
|
|
241
|
+
* "_expands": [],
|
|
242
|
+
* "size": 1,
|
|
243
|
+
* "start": 1,
|
|
244
|
+
* "limit": 1,
|
|
245
|
+
* "isLastPage": false,
|
|
246
|
+
* "_links": {
|
|
247
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
248
|
+
* "context": "context",
|
|
249
|
+
* "next":
|
|
250
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization?start=2&limit=1",
|
|
251
|
+
* "prev":
|
|
252
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization?start=0&limit=1"
|
|
253
|
+
* },
|
|
254
|
+
* "values": [
|
|
255
|
+
* {
|
|
256
|
+
* "id": "1",
|
|
257
|
+
* "name": "Charlie Cakes Franchises",
|
|
258
|
+
* "_links": {
|
|
259
|
+
* "self":
|
|
260
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1"
|
|
261
|
+
* }
|
|
262
|
+
* }
|
|
263
|
+
* ]
|
|
264
|
+
* }
|
|
265
|
+
* @path {GET} /rest/servicedeskapi/organization
|
|
266
|
+
* @scopes-current manage:servicedesk-customer
|
|
267
|
+
* @scopes-beta read:organization:jira-service-management
|
|
268
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-get
|
|
269
|
+
*/
|
|
270
|
+
this.getOrganizations = ({ start, limit, accountId, } = {}) => {
|
|
271
|
+
return this.getClientInstance()
|
|
272
|
+
.request({
|
|
273
|
+
path: "/rest/servicedeskapi/organization",
|
|
274
|
+
method: "GET",
|
|
275
|
+
query: {
|
|
276
|
+
start,
|
|
277
|
+
limit,
|
|
278
|
+
accountId,
|
|
279
|
+
},
|
|
280
|
+
})
|
|
281
|
+
.then(this.getClientInstance().responseHandler({
|
|
282
|
+
200: {
|
|
283
|
+
"application/json": "json",
|
|
284
|
+
},
|
|
285
|
+
}))
|
|
286
|
+
.then(commonHttpClient.castResponse())
|
|
287
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getOrganizations.response"))
|
|
288
|
+
.then(commonHttpClient.getBody);
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Returns the keys of all organization properties. Organization properties are a
|
|
292
|
+
* type of entity property which are available to the API only, and not shown in
|
|
293
|
+
* Jira Service Management. [Learn
|
|
294
|
+
* more](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
|
|
295
|
+
*
|
|
296
|
+
* To get organization detail field values which are visible in Jira Service
|
|
297
|
+
* Management, see the [Customer Service Management REST
|
|
298
|
+
* API](https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-group-organization).
|
|
299
|
+
*
|
|
300
|
+
* **[Permissions](#permissions) required**: Any
|
|
301
|
+
*
|
|
302
|
+
* **Response limitations**: Customers can only access properties of organizations
|
|
303
|
+
* of which they are members.
|
|
304
|
+
*
|
|
305
|
+
* @returns Returned if the organization was found.
|
|
306
|
+
*
|
|
307
|
+
* example: {
|
|
308
|
+
* "entityPropertyKeyBeans": [
|
|
309
|
+
* {
|
|
310
|
+
* "key": "organization.attributes",
|
|
311
|
+
* "self": "/rest/servicedeskapi/organization/1/property/propertyKey"
|
|
312
|
+
* }
|
|
313
|
+
* ]
|
|
314
|
+
* }
|
|
315
|
+
* @path {GET} /rest/servicedeskapi/organization/{organizationId}/property
|
|
316
|
+
* @scopes-current manage:servicedesk-customer
|
|
317
|
+
* @scopes-beta read:organization.property:jira-service-management
|
|
318
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-property-get
|
|
319
|
+
*/
|
|
320
|
+
this.getPropertiesKeys = ({ organizationId, }) => {
|
|
321
|
+
return this.getClientInstance()
|
|
322
|
+
.request({
|
|
323
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/property",
|
|
324
|
+
method: "GET",
|
|
325
|
+
pathParams: {
|
|
326
|
+
organizationId,
|
|
327
|
+
},
|
|
328
|
+
})
|
|
329
|
+
.then(this.getClientInstance().responseHandler({
|
|
330
|
+
200: {
|
|
331
|
+
"application/json": "json",
|
|
332
|
+
},
|
|
333
|
+
}))
|
|
334
|
+
.then(commonHttpClient.castResponse())
|
|
335
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getPropertiesKeys.response"))
|
|
336
|
+
.then(commonHttpClient.getBody);
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* Returns the value of an organization property. Use this method to obtain the
|
|
340
|
+
* JSON content for an organization's property. Organization properties are a type
|
|
341
|
+
* of entity property which are available to the API only, and not shown in Jira
|
|
342
|
+
* Service Management. [Learn
|
|
343
|
+
* more](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
|
|
344
|
+
*
|
|
345
|
+
* To get organization detail field values which are visible in Jira Service
|
|
346
|
+
* Management, see the [Customer Service Management REST
|
|
347
|
+
* API](https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-group-organization).
|
|
348
|
+
*
|
|
349
|
+
* **[Permissions](#permissions) required**: Any
|
|
350
|
+
*
|
|
351
|
+
* **Response limitations**: Customers can only access properties of organizations
|
|
352
|
+
* of which they are members.
|
|
353
|
+
*
|
|
354
|
+
* @returns Returns the organization's property.
|
|
355
|
+
*
|
|
356
|
+
* example: {
|
|
357
|
+
* "key": "organization.attributes",
|
|
358
|
+
* "value": {
|
|
359
|
+
* "mail": "charlie@example.com",
|
|
360
|
+
* "phone": "0800-1233456789"
|
|
361
|
+
* }
|
|
362
|
+
* }
|
|
363
|
+
* @path {GET} /rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}
|
|
364
|
+
* @scopes-current manage:servicedesk-customer
|
|
365
|
+
* @scopes-beta read:organization.property:jira-service-management
|
|
366
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-property-propertykey-get
|
|
367
|
+
*/
|
|
368
|
+
this.getProperty = ({ organizationId, propertyKey, }) => {
|
|
369
|
+
return this.getClientInstance()
|
|
370
|
+
.request({
|
|
371
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}",
|
|
372
|
+
method: "GET",
|
|
373
|
+
pathParams: {
|
|
374
|
+
organizationId,
|
|
375
|
+
propertyKey,
|
|
376
|
+
},
|
|
377
|
+
})
|
|
378
|
+
.then(this.getClientInstance().responseHandler({
|
|
379
|
+
200: {
|
|
380
|
+
"application/json": "json",
|
|
381
|
+
},
|
|
382
|
+
}))
|
|
383
|
+
.then(commonHttpClient.castResponse())
|
|
384
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getProperty.response"))
|
|
385
|
+
.then(commonHttpClient.getBody);
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* This method returns a list of all organizations associated with a service desk.
|
|
389
|
+
*
|
|
390
|
+
* **[Permissions](#permissions) required**: Service desk's agent.
|
|
391
|
+
*
|
|
392
|
+
* @returns Returns the requested organizations list.
|
|
393
|
+
*
|
|
394
|
+
* example: {
|
|
395
|
+
* "_expands": [],
|
|
396
|
+
* "size": 3,
|
|
397
|
+
* "start": 3,
|
|
398
|
+
* "limit": 3,
|
|
399
|
+
* "isLastPage": false,
|
|
400
|
+
* "_links": {
|
|
401
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
402
|
+
* "context": "context",
|
|
403
|
+
* "next":
|
|
404
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/10001/organization?start=6&limit=3",
|
|
405
|
+
* "prev":
|
|
406
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/servicedesk/10001/organization?start=0&limit=3"
|
|
407
|
+
* },
|
|
408
|
+
* "values": [
|
|
409
|
+
* {
|
|
410
|
+
* "id": "1",
|
|
411
|
+
* "name": "Charlie Cakes Franchises",
|
|
412
|
+
* "_links": {
|
|
413
|
+
* "self":
|
|
414
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1"
|
|
415
|
+
* }
|
|
416
|
+
* },
|
|
417
|
+
* {
|
|
418
|
+
* "id": "2",
|
|
419
|
+
* "name": "Atlas Coffee Co",
|
|
420
|
+
* "_links": {
|
|
421
|
+
* "self":
|
|
422
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/2"
|
|
423
|
+
* }
|
|
424
|
+
* },
|
|
425
|
+
* {
|
|
426
|
+
* "id": "3",
|
|
427
|
+
* "name": "The Adjustment Bureau",
|
|
428
|
+
* "_links": {
|
|
429
|
+
* "self":
|
|
430
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/3"
|
|
431
|
+
* }
|
|
432
|
+
* }
|
|
433
|
+
* ]
|
|
434
|
+
* }
|
|
435
|
+
* @path {GET} /rest/servicedeskapi/servicedesk/{serviceDeskId}/organization
|
|
436
|
+
* @scopes-current manage:servicedesk-customer
|
|
437
|
+
* @scopes-beta read:servicedesk.organization:jira-service-management
|
|
438
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-get
|
|
439
|
+
*/
|
|
440
|
+
this.getServiceDeskOrganizations = ({ serviceDeskId, start, limit, accountId, }) => {
|
|
441
|
+
return this.getClientInstance()
|
|
442
|
+
.request({
|
|
443
|
+
path: "/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization",
|
|
444
|
+
method: "GET",
|
|
445
|
+
pathParams: {
|
|
446
|
+
serviceDeskId,
|
|
447
|
+
},
|
|
448
|
+
query: {
|
|
449
|
+
start,
|
|
450
|
+
limit,
|
|
451
|
+
accountId,
|
|
452
|
+
},
|
|
453
|
+
})
|
|
454
|
+
.then(this.getClientInstance().responseHandler({
|
|
455
|
+
200: {
|
|
456
|
+
"application/json": "json",
|
|
457
|
+
},
|
|
458
|
+
}))
|
|
459
|
+
.then(commonHttpClient.castResponse())
|
|
460
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getServiceDeskOrganizations.response"))
|
|
461
|
+
.then(commonHttpClient.getBody);
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* This method returns all the users associated with an organization. Use this
|
|
465
|
+
* method where you want to provide a list of users for an organization or
|
|
466
|
+
* determine if a user is associated with an organization.
|
|
467
|
+
*
|
|
468
|
+
* **[Permissions](#permissions) required**: Service desk administrator or agent.
|
|
469
|
+
*
|
|
470
|
+
* @returns Returns a paged list of users associated with the organization, ordered by
|
|
471
|
+
* their accountId.
|
|
472
|
+
*
|
|
473
|
+
* example: {
|
|
474
|
+
* "_expands": [],
|
|
475
|
+
* "size": 1,
|
|
476
|
+
* "start": 1,
|
|
477
|
+
* "limit": 1,
|
|
478
|
+
* "isLastPage": false,
|
|
479
|
+
* "_links": {
|
|
480
|
+
* "base": "https://your-domain.atlassian.net/rest/servicedeskapi",
|
|
481
|
+
* "context": "context",
|
|
482
|
+
* "next":
|
|
483
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1/user?start=2&limit=1",
|
|
484
|
+
* "prev":
|
|
485
|
+
* "https://your-domain.atlassian.net/rest/servicedeskapi/organization/1/user?start=0&limit=1"
|
|
486
|
+
* },
|
|
487
|
+
* "values": [
|
|
488
|
+
* {
|
|
489
|
+
* "accountId":
|
|
490
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
491
|
+
* "name": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
492
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
493
|
+
* "emailAddress": "fred@example.com",
|
|
494
|
+
* "displayName": "Fred F. User",
|
|
495
|
+
* "active": true,
|
|
496
|
+
* "timeZone": "Australia/Sydney",
|
|
497
|
+
* "_links": {
|
|
498
|
+
* "jiraRest":
|
|
499
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b",
|
|
500
|
+
* "avatarUrls": {
|
|
501
|
+
* "16x16":
|
|
502
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
503
|
+
* "24x24":
|
|
504
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
505
|
+
* "32x32":
|
|
506
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
507
|
+
* "48x48":
|
|
508
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
509
|
+
* },
|
|
510
|
+
* "self":
|
|
511
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3581db05e2a66fa80b"
|
|
512
|
+
* }
|
|
513
|
+
* },
|
|
514
|
+
* {
|
|
515
|
+
* "accountId":
|
|
516
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3a01db05e2a66fa80bd",
|
|
517
|
+
* "name":
|
|
518
|
+
* "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3a01db05e2a66fa80bd",
|
|
519
|
+
* "key": "qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3a01db05e2a66fa80bd",
|
|
520
|
+
* "emailAddress": "bob@example.com",
|
|
521
|
+
* "displayName": "Bob D. Builder",
|
|
522
|
+
* "active": true,
|
|
523
|
+
* "timeZone": "Australia/Sydney",
|
|
524
|
+
* "_links": {
|
|
525
|
+
* "jiraRest":
|
|
526
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3a01db05e2a66fa80bd",
|
|
527
|
+
* "avatarUrls": {
|
|
528
|
+
* "16x16":
|
|
529
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=16&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D16%26noRedirect%3Dtrue",
|
|
530
|
+
* "24x24":
|
|
531
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=24&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D24%26noRedirect%3Dtrue",
|
|
532
|
+
* "32x32":
|
|
533
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D32%26noRedirect%3Dtrue",
|
|
534
|
+
* "48x48":
|
|
535
|
+
* "https://avatar-cdn.atlassian.com/9bc3b5bcb0db050c6d7660b28a5b86c9?s=48&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2F9bc3b5bcb0db050c6d7660b28a5b86c9%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue"
|
|
536
|
+
* },
|
|
537
|
+
* "self":
|
|
538
|
+
* "https://your-domain.atlassian.net/rest/api/2/user?username=qm:a713c8ea-1075-4e30-9d96-891a7d181739:5ad6d3a01db05e2a66fa80bd"
|
|
539
|
+
* }
|
|
540
|
+
* }
|
|
541
|
+
* ]
|
|
542
|
+
* }
|
|
543
|
+
* @path {GET} /rest/servicedeskapi/organization/{organizationId}/user
|
|
544
|
+
* @scopes-current manage:servicedesk-customer
|
|
545
|
+
* @scopes-beta read:organization.user:jira-service-management, read:user:jira
|
|
546
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-user-get
|
|
547
|
+
*/
|
|
548
|
+
this.getUsersInOrganization = ({ organizationId, start, limit, }) => {
|
|
549
|
+
return this.getClientInstance()
|
|
550
|
+
.request({
|
|
551
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/user",
|
|
552
|
+
method: "GET",
|
|
553
|
+
pathParams: {
|
|
554
|
+
organizationId,
|
|
555
|
+
},
|
|
556
|
+
query: {
|
|
557
|
+
start,
|
|
558
|
+
limit,
|
|
559
|
+
},
|
|
560
|
+
})
|
|
561
|
+
.then(this.getClientInstance().responseHandler({
|
|
562
|
+
200: {
|
|
563
|
+
"application/json": "json",
|
|
564
|
+
},
|
|
565
|
+
}))
|
|
566
|
+
.then(commonHttpClient.castResponse())
|
|
567
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.getUsersInOrganization.response"))
|
|
568
|
+
.then(commonHttpClient.getBody);
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* This method removes an organization from a service desk. If the organization ID
|
|
572
|
+
* does not match an organization associated with the service desk, no change is
|
|
573
|
+
* made and the resource returns a 204 success code.
|
|
574
|
+
*
|
|
575
|
+
* **[Permissions](#permissions) required**: Service desk's agent.
|
|
576
|
+
*
|
|
577
|
+
* @path {DELETE} /rest/servicedeskapi/servicedesk/{serviceDeskId}/organization
|
|
578
|
+
* @scopes-current manage:servicedesk-customer
|
|
579
|
+
* @scopes-beta read:servicedesk.organization:jira-service-management,
|
|
580
|
+
* delete:servicedesk.organization:jira-service-management
|
|
581
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-delete
|
|
582
|
+
*/
|
|
583
|
+
this.removeOrganization = ({ serviceDeskId, organizationServiceDeskUpdateDto, }) => {
|
|
584
|
+
return this.getClientInstance()
|
|
585
|
+
.request({
|
|
586
|
+
path: "/rest/servicedeskapi/servicedesk/{serviceDeskId}/organization",
|
|
587
|
+
method: "DELETE",
|
|
588
|
+
pathParams: {
|
|
589
|
+
serviceDeskId,
|
|
590
|
+
},
|
|
591
|
+
headers: {
|
|
592
|
+
"Content-Type": "application/json",
|
|
593
|
+
},
|
|
594
|
+
body: organizationServiceDeskUpdateDto,
|
|
595
|
+
})
|
|
596
|
+
.then(commonHttpClient.discardResult);
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* This method removes users from an organization.
|
|
600
|
+
*
|
|
601
|
+
* **[Permissions](#permissions) required**: Service desk administrator or agent.
|
|
602
|
+
* Note: Permission to delete users from an organization can be switched to users
|
|
603
|
+
* with the Jira administrator permission, using the **[Organization
|
|
604
|
+
* management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)**
|
|
605
|
+
* feature.
|
|
606
|
+
*
|
|
607
|
+
* @path {DELETE} /rest/servicedeskapi/organization/{organizationId}/user
|
|
608
|
+
* @scopes-current manage:servicedesk-customer
|
|
609
|
+
* @scopes-beta read:organization.user:jira-service-management,
|
|
610
|
+
* delete:organization.user:jira-service-management, read:user:jira
|
|
611
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-user-delete
|
|
612
|
+
*/
|
|
613
|
+
this.removeUsersFromOrganization = ({ organizationId, usersOrganizationUpdateDto, }) => {
|
|
614
|
+
return this.getClientInstance()
|
|
615
|
+
.request({
|
|
616
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/user",
|
|
617
|
+
method: "DELETE",
|
|
618
|
+
pathParams: {
|
|
619
|
+
organizationId,
|
|
620
|
+
},
|
|
621
|
+
headers: {
|
|
622
|
+
"Content-Type": "application/json",
|
|
623
|
+
},
|
|
624
|
+
body: usersOrganizationUpdateDto,
|
|
625
|
+
})
|
|
626
|
+
.then(commonHttpClient.discardResult);
|
|
627
|
+
};
|
|
628
|
+
/**
|
|
629
|
+
* Sets the value of an organization property. Use this resource to store custom
|
|
630
|
+
* data against an organization. Organization properties are a type of entity
|
|
631
|
+
* property which are available to the API only, and not shown in Jira Service
|
|
632
|
+
* Management. [Learn
|
|
633
|
+
* more](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
|
|
634
|
+
*
|
|
635
|
+
* To store organization detail field values which are visible in Jira Service
|
|
636
|
+
* Management, see the [Customer Service Management REST
|
|
637
|
+
* API](https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-group-organization).
|
|
638
|
+
*
|
|
639
|
+
* **[Permissions](#permissions) required**: Service Desk Administrator or Agent.
|
|
640
|
+
*
|
|
641
|
+
* Note: Permission to manage organizations can be switched to users with the Jira
|
|
642
|
+
* administrator permission, using the **[Organization
|
|
643
|
+
* management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)**
|
|
644
|
+
* feature.
|
|
645
|
+
*
|
|
646
|
+
* @returns * status: 200, mediaType: application/json
|
|
647
|
+
*
|
|
648
|
+
* Returned if the organization property was updated.
|
|
649
|
+
*
|
|
650
|
+
* * status: 201, mediaType: application/json
|
|
651
|
+
*
|
|
652
|
+
* Returned if the organization property was created.
|
|
653
|
+
* @path {PUT} /rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}
|
|
654
|
+
* @scopes-current manage:servicedesk-customer
|
|
655
|
+
* @scopes-beta read:organization.property:jira-service-management,
|
|
656
|
+
* write:organization.property:jira-service-management
|
|
657
|
+
* @see https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization#api-rest-servicedeskapi-organization-organizationid-property-propertykey-put
|
|
658
|
+
*/
|
|
659
|
+
this.setProperty = ({ organizationId, propertyKey, requestBody, }) => {
|
|
660
|
+
return this.getClientInstance()
|
|
661
|
+
.request({
|
|
662
|
+
path: "/rest/servicedeskapi/organization/{organizationId}/property/{propertyKey}",
|
|
663
|
+
method: "PUT",
|
|
664
|
+
pathParams: {
|
|
665
|
+
organizationId,
|
|
666
|
+
propertyKey,
|
|
667
|
+
},
|
|
668
|
+
headers: {
|
|
669
|
+
"Content-Type": "application/json",
|
|
670
|
+
},
|
|
671
|
+
body: requestBody,
|
|
672
|
+
})
|
|
673
|
+
.then(this.getClientInstance().responseHandler({
|
|
674
|
+
200: {
|
|
675
|
+
"application/json": "json",
|
|
676
|
+
},
|
|
677
|
+
201: {
|
|
678
|
+
"application/json": "json",
|
|
679
|
+
},
|
|
680
|
+
}))
|
|
681
|
+
.then(commonHttpClient.castResponse())
|
|
682
|
+
.then(validationSchemaStorage_1.validationSchemaStorage.validator("OrganizationService.setProperty.response"))
|
|
683
|
+
.then(commonHttpClient.asCreatedResponse("body"));
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
static initialize() {
|
|
687
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getOrganizations.response", zod_1.z
|
|
688
|
+
.object({
|
|
689
|
+
status: zod_1.z.literal(200),
|
|
690
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
691
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoOrganizationDto"),
|
|
692
|
+
})
|
|
693
|
+
.describe("OrganizationService.getOrganizations.response"));
|
|
694
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.createOrganization.response", zod_1.z
|
|
695
|
+
.object({
|
|
696
|
+
status: zod_1.z.literal(201),
|
|
697
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
698
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("OrganizationDto"),
|
|
699
|
+
})
|
|
700
|
+
.describe("OrganizationService.createOrganization.response"));
|
|
701
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getOrganization.response", zod_1.z
|
|
702
|
+
.object({
|
|
703
|
+
status: zod_1.z.literal(200),
|
|
704
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
705
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("OrganizationDto"),
|
|
706
|
+
})
|
|
707
|
+
.describe("OrganizationService.getOrganization.response"));
|
|
708
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getPropertiesKeys.response", zod_1.z
|
|
709
|
+
.object({
|
|
710
|
+
status: zod_1.z.literal(200),
|
|
711
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
712
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PropertyKeys"),
|
|
713
|
+
})
|
|
714
|
+
.describe("OrganizationService.getPropertiesKeys.response"));
|
|
715
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getProperty.response", zod_1.z
|
|
716
|
+
.object({
|
|
717
|
+
status: zod_1.z.literal(200),
|
|
718
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
719
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("EntityProperty"),
|
|
720
|
+
})
|
|
721
|
+
.describe("OrganizationService.getProperty.response"));
|
|
722
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.setProperty.response", zod_1.z
|
|
723
|
+
.object({
|
|
724
|
+
status: zod_1.z.number(),
|
|
725
|
+
mediaType: zod_1.z.string(),
|
|
726
|
+
body: zod_1.z.unknown(),
|
|
727
|
+
})
|
|
728
|
+
.superRefine(({ status: status, body: body }, ctx) => {
|
|
729
|
+
if (status === 200 || status === 201) {
|
|
730
|
+
zod_1.z.unknown().parse(body);
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
ctx.addIssue({
|
|
734
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
735
|
+
path: ["status"],
|
|
736
|
+
message: `Unexpected status code: ${status}`,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
})
|
|
740
|
+
.describe("OrganizationService.setProperty.response"));
|
|
741
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getUsersInOrganization.response", zod_1.z
|
|
742
|
+
.object({
|
|
743
|
+
status: zod_1.z.literal(200),
|
|
744
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
745
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoUserDto"),
|
|
746
|
+
})
|
|
747
|
+
.describe("OrganizationService.getUsersInOrganization.response"));
|
|
748
|
+
validationSchemaStorage_1.validationSchemaStorage.registerExtensible("OrganizationService.getServiceDeskOrganizations.response", zod_1.z
|
|
749
|
+
.object({
|
|
750
|
+
status: zod_1.z.literal(200),
|
|
751
|
+
mediaType: zod_1.z.literal("application/json"),
|
|
752
|
+
body: validationSchemaStorage_1.validationSchemaStorage.lazy("PagedDtoOrganizationDto"),
|
|
753
|
+
})
|
|
754
|
+
.describe("OrganizationService.getServiceDeskOrganizations.response"));
|
|
755
|
+
validationSchemaStorage_1.validationSchemaStorage.registerOnce([
|
|
756
|
+
organization_1.registerOrganizationValidationSchemas,
|
|
757
|
+
common_1.registerCommonValidationSchemas,
|
|
758
|
+
]);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
exports.OrganizationService = OrganizationService;
|
|
762
|
+
//# sourceMappingURL=OrganizationService.js.map
|