@resolution/jira-api-client 0.1.0 → 0.1.2

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.
Files changed (201) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.json +10 -3
  3. package/.eslintrc.js +0 -3
  4. package/config/api-typescript-generator.config.ts +0 -91
  5. package/config/compare-schemas.ts +0 -307
  6. package/src/index.ts +0 -47
  7. package/src/openapi/platform/base-jira-platform-api-client.ts +0 -2298
  8. package/src/openapi/platform/core/common-http-client.ts +0 -723
  9. package/src/openapi/platform/core/common-http-service.ts +0 -22
  10. package/src/openapi/platform/core/common-validation-schema-storage.ts +0 -105
  11. package/src/openapi/platform/models/announcement-banner.ts +0 -59
  12. package/src/openapi/platform/models/app-data-policies.ts +0 -79
  13. package/src/openapi/platform/models/app-migration.ts +0 -172
  14. package/src/openapi/platform/models/app-properties.ts +0 -32
  15. package/src/openapi/platform/models/audit-records.ts +0 -140
  16. package/src/openapi/platform/models/avatars.ts +0 -48
  17. package/src/openapi/platform/models/classification-levels.ts +0 -58
  18. package/src/openapi/platform/models/common.ts +0 -2669
  19. package/src/openapi/platform/models/dashboards.ts +0 -849
  20. package/src/openapi/platform/models/dynamic-modules.ts +0 -121
  21. package/src/openapi/platform/models/filter-sharing.ts +0 -103
  22. package/src/openapi/platform/models/filters.ts +0 -319
  23. package/src/openapi/platform/models/group-and-user-picker.ts +0 -85
  24. package/src/openapi/platform/models/groups.ts +0 -247
  25. package/src/openapi/platform/models/issue-attachments.ts +0 -290
  26. package/src/openapi/platform/models/issue-comment-properties.ts +0 -27
  27. package/src/openapi/platform/models/issue-comments.ts +0 -91
  28. package/src/openapi/platform/models/issue-custom-field-configuration-apps.ts +0 -96
  29. package/src/openapi/platform/models/issue-custom-field-contexts.ts +0 -1072
  30. package/src/openapi/platform/models/issue-custom-field-options-apps.ts +0 -273
  31. package/src/openapi/platform/models/issue-custom-field-options.ts +0 -283
  32. package/src/openapi/platform/models/issue-custom-field-values-apps.ts +0 -118
  33. package/src/openapi/platform/models/issue-field-configurations.ts +0 -435
  34. package/src/openapi/platform/models/issue-fields.ts +0 -392
  35. package/src/openapi/platform/models/issue-link-types.ts +0 -28
  36. package/src/openapi/platform/models/issue-links.ts +0 -185
  37. package/src/openapi/platform/models/issue-notification-schemes.ts +0 -370
  38. package/src/openapi/platform/models/issue-priorities.ts +0 -196
  39. package/src/openapi/platform/models/issue-properties.ts +0 -259
  40. package/src/openapi/platform/models/issue-remote-links.ts +0 -207
  41. package/src/openapi/platform/models/issue-resolutions.ts +0 -180
  42. package/src/openapi/platform/models/issue-search.ts +0 -367
  43. package/src/openapi/platform/models/issue-security-level.ts +0 -76
  44. package/src/openapi/platform/models/issue-security-schemes.ts +0 -496
  45. package/src/openapi/platform/models/issue-type-schemes.ts +0 -290
  46. package/src/openapi/platform/models/issue-type-screen-schemes.ts +0 -286
  47. package/src/openapi/platform/models/issue-types.ts +0 -66
  48. package/src/openapi/platform/models/issue-votes.ts +0 -38
  49. package/src/openapi/platform/models/issue-watchers.ts +0 -67
  50. package/src/openapi/platform/models/issue-worklogs.ts +0 -190
  51. package/src/openapi/platform/models/issues.ts +0 -1268
  52. package/src/openapi/platform/models/jira-expressions.ts +0 -578
  53. package/src/openapi/platform/models/jira-settings.ts +0 -118
  54. package/src/openapi/platform/models/jql-functions-apps.ts +0 -128
  55. package/src/openapi/platform/models/jql.ts +0 -783
  56. package/src/openapi/platform/models/labels.ts +0 -42
  57. package/src/openapi/platform/models/license-metrics.ts +0 -68
  58. package/src/openapi/platform/models/myself.ts +0 -29
  59. package/src/openapi/platform/models/permission-schemes.ts +0 -89
  60. package/src/openapi/platform/models/permissions.ts +0 -308
  61. package/src/openapi/platform/models/priority-schemes.ts +0 -527
  62. package/src/openapi/platform/models/project-avatars.ts +0 -29
  63. package/src/openapi/platform/models/project-classification-levels.ts +0 -24
  64. package/src/openapi/platform/models/project-components.ts +0 -231
  65. package/src/openapi/platform/models/project-email.ts +0 -27
  66. package/src/openapi/platform/models/project-features.ts +0 -78
  67. package/src/openapi/platform/models/project-permission-schemes.ts +0 -43
  68. package/src/openapi/platform/models/project-role-actors.ts +0 -107
  69. package/src/openapi/platform/models/project-roles.ts +0 -76
  70. package/src/openapi/platform/models/project-types.ts +0 -36
  71. package/src/openapi/platform/models/project-versions.ts +0 -216
  72. package/src/openapi/platform/models/projects.ts +0 -429
  73. package/src/openapi/platform/models/screen-schemes.ts +0 -192
  74. package/src/openapi/platform/models/screen-tab-fields.ts +0 -45
  75. package/src/openapi/platform/models/screens.ts +0 -171
  76. package/src/openapi/platform/models/server-info.ts +0 -100
  77. package/src/openapi/platform/models/service-registry.ts +0 -68
  78. package/src/openapi/platform/models/status.ts +0 -229
  79. package/src/openapi/platform/models/time-tracking.ts +0 -38
  80. package/src/openapi/platform/models/ui-modifications-apps.ts +0 -229
  81. package/src/openapi/platform/models/user-search.ts +0 -69
  82. package/src/openapi/platform/models/users.ts +0 -121
  83. package/src/openapi/platform/models/webhooks.ts +0 -307
  84. package/src/openapi/platform/models/workflow-scheme-drafts.ts +0 -58
  85. package/src/openapi/platform/models/workflow-scheme-project-associations.ts +0 -68
  86. package/src/openapi/platform/models/workflow-schemes.ts +0 -545
  87. package/src/openapi/platform/models/workflow-transition-properties.ts +0 -33
  88. package/src/openapi/platform/models/workflow-transition-rules.ts +0 -261
  89. package/src/openapi/platform/models/workflows.ts +0 -1943
  90. package/src/openapi/platform/services/announcement-banner-service.ts +0 -142
  91. package/src/openapi/platform/services/app-data-policies-service.ts +0 -136
  92. package/src/openapi/platform/services/app-migration-service.ts +0 -289
  93. package/src/openapi/platform/services/app-properties-service.ts +0 -441
  94. package/src/openapi/platform/services/application-roles-service.ts +0 -247
  95. package/src/openapi/platform/services/audit-records-service.ts +0 -164
  96. package/src/openapi/platform/services/avatars-service.ts +0 -769
  97. package/src/openapi/platform/services/classification-levels-service.ts +0 -131
  98. package/src/openapi/platform/services/dashboards-service.ts +0 -1721
  99. package/src/openapi/platform/services/dynamic-modules-service.ts +0 -127
  100. package/src/openapi/platform/services/filter-sharing-service.ts +0 -687
  101. package/src/openapi/platform/services/filters-service.ts +0 -1901
  102. package/src/openapi/platform/services/group-and-user-picker-service.ts +0 -224
  103. package/src/openapi/platform/services/groups-service.ts +0 -751
  104. package/src/openapi/platform/services/issue-attachments-service.ts +0 -900
  105. package/src/openapi/platform/services/issue-comment-properties-service.ts +0 -324
  106. package/src/openapi/platform/services/issue-comments-service.ts +0 -812
  107. package/src/openapi/platform/services/issue-custom-field-configuration-apps-service.ts +0 -277
  108. package/src/openapi/platform/services/issue-custom-field-contexts-service.ts +0 -1339
  109. package/src/openapi/platform/services/issue-custom-field-options-apps-service.ts +0 -994
  110. package/src/openapi/platform/services/issue-custom-field-options-service.ts +0 -651
  111. package/src/openapi/platform/services/issue-custom-field-values-apps-service.ts +0 -201
  112. package/src/openapi/platform/services/issue-field-configurations-service.ts +0 -1294
  113. package/src/openapi/platform/services/issue-fields-service.ts +0 -837
  114. package/src/openapi/platform/services/issue-link-types-service.ts +0 -360
  115. package/src/openapi/platform/services/issue-links-service.ts +0 -345
  116. package/src/openapi/platform/services/issue-navigator-settings-service.ts +0 -119
  117. package/src/openapi/platform/services/issue-notification-schemes-service.ts +0 -1209
  118. package/src/openapi/platform/services/issue-priorities-service.ts +0 -575
  119. package/src/openapi/platform/services/issue-properties-service.ts +0 -606
  120. package/src/openapi/platform/services/issue-remote-links-service.ts +0 -597
  121. package/src/openapi/platform/services/issue-resolutions-service.ts +0 -534
  122. package/src/openapi/platform/services/issue-search-service.ts +0 -1139
  123. package/src/openapi/platform/services/issue-security-level-service.ts +0 -250
  124. package/src/openapi/platform/services/issue-security-schemes-service.ts +0 -1240
  125. package/src/openapi/platform/services/issue-type-properties-service.ts +0 -325
  126. package/src/openapi/platform/services/issue-type-schemes-service.ts +0 -940
  127. package/src/openapi/platform/services/issue-type-screen-schemes-service.ts +0 -994
  128. package/src/openapi/platform/services/issue-types-service.ts +0 -679
  129. package/src/openapi/platform/services/issue-votes-service.ts +0 -221
  130. package/src/openapi/platform/services/issue-watchers-service.ts +0 -331
  131. package/src/openapi/platform/services/issue-worklog-properties-service.ts +0 -348
  132. package/src/openapi/platform/services/issue-worklogs-service.ts +0 -1089
  133. package/src/openapi/platform/services/issues-service.ts +0 -3346
  134. package/src/openapi/platform/services/jira-expressions-service.ts +0 -407
  135. package/src/openapi/platform/services/jira-settings-service.ts +0 -415
  136. package/src/openapi/platform/services/jql-functions-apps-service.ts +0 -219
  137. package/src/openapi/platform/services/jql-service.ts +0 -896
  138. package/src/openapi/platform/services/labels-service.ts +0 -89
  139. package/src/openapi/platform/services/license-metrics-service.ts +0 -216
  140. package/src/openapi/platform/services/myself-service.ts +0 -520
  141. package/src/openapi/platform/services/permission-schemes-service.ts +0 -926
  142. package/src/openapi/platform/services/permissions-service.ts +0 -407
  143. package/src/openapi/platform/services/priority-schemes-service.ts +0 -1001
  144. package/src/openapi/platform/services/project-avatars-service.ts +0 -341
  145. package/src/openapi/platform/services/project-categories-service.ts +0 -318
  146. package/src/openapi/platform/services/project-classification-levels-service.ts +0 -232
  147. package/src/openapi/platform/services/project-components-service.ts +0 -1332
  148. package/src/openapi/platform/services/project-email-service.ts +0 -161
  149. package/src/openapi/platform/services/project-features-service.ts +0 -207
  150. package/src/openapi/platform/services/project-key-and-name-validation-service.ts +0 -200
  151. package/src/openapi/platform/services/project-permission-schemes-service.ts +0 -384
  152. package/src/openapi/platform/services/project-properties-service.ts +0 -320
  153. package/src/openapi/platform/services/project-role-actors-service.ts +0 -627
  154. package/src/openapi/platform/services/project-roles-service.ts +0 -867
  155. package/src/openapi/platform/services/project-types-service.ts +0 -297
  156. package/src/openapi/platform/services/project-versions-service.ts +0 -1287
  157. package/src/openapi/platform/services/projects-service.ts +0 -2196
  158. package/src/openapi/platform/services/screen-schemes-service.ts +0 -334
  159. package/src/openapi/platform/services/screen-tab-fields-service.ts +0 -276
  160. package/src/openapi/platform/services/screen-tabs-service.ts +0 -421
  161. package/src/openapi/platform/services/screens-service.ts +0 -528
  162. package/src/openapi/platform/services/server-info-service.ts +0 -88
  163. package/src/openapi/platform/services/service-registry-service.ts +0 -89
  164. package/src/openapi/platform/services/status-service.ts +0 -498
  165. package/src/openapi/platform/services/tasks-service.ts +0 -159
  166. package/src/openapi/platform/services/time-tracking-service.ts +0 -386
  167. package/src/openapi/platform/services/ui-modifications-apps-service.ts +0 -403
  168. package/src/openapi/platform/services/user-properties-service.ts +0 -413
  169. package/src/openapi/platform/services/user-search-service.ts +0 -1214
  170. package/src/openapi/platform/services/users-service.ts +0 -1108
  171. package/src/openapi/platform/services/webhooks-service.ts +0 -458
  172. package/src/openapi/platform/services/workflow-scheme-drafts-service.ts +0 -1313
  173. package/src/openapi/platform/services/workflow-scheme-project-associations-service.ts +0 -189
  174. package/src/openapi/platform/services/workflow-schemes-service.ts +0 -1617
  175. package/src/openapi/platform/services/workflow-status-categories-service.ts +0 -151
  176. package/src/openapi/platform/services/workflow-statuses-service.ts +0 -176
  177. package/src/openapi/platform/services/workflow-transition-properties-service.ts +0 -388
  178. package/src/openapi/platform/services/workflow-transition-rules-service.ts +0 -485
  179. package/src/openapi/platform/services/workflows-service.ts +0 -3477
  180. package/src/openapi/platform/validation-schema-storage.ts +0 -186
  181. package/src/openapi/software/base-jira-software-api-client.ts +0 -447
  182. package/src/openapi/software/core/common-http-client.ts +0 -723
  183. package/src/openapi/software/core/common-http-service.ts +0 -22
  184. package/src/openapi/software/core/common-validation-schema-storage.ts +0 -105
  185. package/src/openapi/software/models/board.ts +0 -918
  186. package/src/openapi/software/services/backlog-service.ts +0 -160
  187. package/src/openapi/software/services/board-service.ts +0 -4189
  188. package/src/openapi/software/services/builds-service.ts +0 -571
  189. package/src/openapi/software/services/deployments-service.ts +0 -403
  190. package/src/openapi/software/services/dev-ops-components-service.ts +0 -371
  191. package/src/openapi/software/services/development-information-service.ts +0 -2357
  192. package/src/openapi/software/services/epic-service.ts +0 -854
  193. package/src/openapi/software/services/feature-flags-service.ts +0 -303
  194. package/src/openapi/software/services/issue-service.ts +0 -529
  195. package/src/openapi/software/services/operations-service.ts +0 -741
  196. package/src/openapi/software/services/remote-links-service.ts +0 -653
  197. package/src/openapi/software/services/security-information-service.ts +0 -495
  198. package/src/openapi/software/services/sprint-service.ts +0 -969
  199. package/src/openapi/software/validation-schema-storage.ts +0 -186
  200. package/tsconfig.build.json +0 -7
  201. package/tsconfig.json +0 -4
@@ -1,413 +0,0 @@
1
- // DO NOT EDIT!
2
- // This file is generated by "api-typescript-generator".
3
- // To update this file run "yarn build:openapi".
4
- import { z } from "zod";
5
-
6
- import * as commonHttpClient from "../core/common-http-client";
7
- import { CommonHttpService } from "../core/common-http-service";
8
- import {
9
- type EntityProperty,
10
- type PropertyKeys,
11
- registerCommonValidationSchemas,
12
- } from "../models/common";
13
- import { validationSchemaStorage } from "../validation-schema-storage";
14
- /**
15
- * This resource represents [user](#api-group-Users) properties and provides for
16
- * storing custom data against a user. Use it to get, create, and delete user
17
- * properties as well as get a list of property keys for a user. This resourse is
18
- * designed for integrations and apps to store per-user data and settings. This
19
- * enables data used to customized the user experience to be kept in the Jira
20
- * Cloud instance's database. User properties are a type of [entity
21
- * property](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/).
22
- *
23
- * This resource does not access the [user
24
- * properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in
25
- * Jira.
26
- */
27
- export class UserPropertiesService extends CommonHttpService {
28
- /**
29
- * Deletes a property from a user.
30
- *
31
- * Note: This operation does not access the [user
32
- * properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in
33
- * Jira.
34
- *
35
- * **[Permissions](#permissions) required:**
36
- *
37
- * * *Administer Jira* [global
38
- * permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property
39
- * from any user.
40
- * * Access to Jira, to delete a property from the calling user's record.
41
- *
42
- * @path {DELETE} /rest/api/3/user/properties/{propertyKey}
43
- * @scopes-current write:jira-work
44
- * @scopes-beta delete:user.property:jira
45
- */
46
- deleteUserProperty({
47
- propertyKey,
48
- accountId,
49
- userKey,
50
- username,
51
- }: {
52
- /** The key of the user's property. */
53
- propertyKey: string;
54
- /**
55
- * The account ID of the user, which uniquely identifies the user across all
56
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
57
- */
58
- accountId?: string;
59
- /**
60
- * This parameter is no longer available and will be removed from the
61
- * documentation soon. See the [deprecation
62
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
63
- * for details.
64
- */
65
- userKey?: string;
66
- /**
67
- * This parameter is no longer available and will be removed from the
68
- * documentation soon. See the [deprecation
69
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
70
- * for details.
71
- */
72
- username?: string;
73
- }): Promise<void> {
74
- return this.getClientInstance()
75
- .request({
76
- path: "/rest/api/3/user/properties/{propertyKey}",
77
- method: "DELETE",
78
- pathParams: {
79
- propertyKey,
80
- },
81
- query: {
82
- accountId,
83
- userKey,
84
- username,
85
- },
86
- })
87
- .then(commonHttpClient.discardResult);
88
- }
89
- /**
90
- * Returns the value of a user's property. If no property key is provided [Get
91
- * user property keys](#api-rest-api-3-user-properties-get) is called.
92
- *
93
- * Note: This operation does not access the [user
94
- * properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in
95
- * Jira.
96
- *
97
- * **[Permissions](#permissions) required:**
98
- *
99
- * * *Administer Jira* [global
100
- * permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from
101
- * any user.
102
- * * Access to Jira, to get a property from the calling user's record.
103
- *
104
- * @returns Returned if the request is successful.
105
- *
106
- * example: {
107
- * "key": "issue.support",
108
- * "value": {
109
- * "system.conversation.id": "b1bf38be-5e94-4b40-a3b8-9278735ee1e6",
110
- * "system.support.time": "1m"
111
- * }
112
- * }
113
- * @path {GET} /rest/api/3/user/properties/{propertyKey}
114
- * @scopes-current read:jira-user
115
- * @scopes-beta read:user.property:jira
116
- */
117
- getUserProperty({
118
- propertyKey,
119
- accountId,
120
- userKey,
121
- username,
122
- }: {
123
- /** The key of the user's property. */
124
- propertyKey: string;
125
- /**
126
- * The account ID of the user, which uniquely identifies the user across all
127
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
128
- */
129
- accountId?: string;
130
- /**
131
- * This parameter is no longer available and will be removed from the
132
- * documentation soon. See the [deprecation
133
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
134
- * for details.
135
- */
136
- userKey?: string;
137
- /**
138
- * This parameter is no longer available and will be removed from the
139
- * documentation soon. See the [deprecation
140
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
141
- * for details.
142
- */
143
- username?: string;
144
- }): Promise<EntityProperty> {
145
- return this.getClientInstance()
146
- .request({
147
- path: "/rest/api/3/user/properties/{propertyKey}",
148
- method: "GET",
149
- pathParams: {
150
- propertyKey,
151
- },
152
- query: {
153
- accountId,
154
- userKey,
155
- username,
156
- },
157
- })
158
- .then(
159
- this.getClientInstance().responseHandler({
160
- 200: {
161
- "application/json": "json",
162
- },
163
- }),
164
- )
165
- .then(
166
- commonHttpClient.castResponse<{
167
- status: 200;
168
- mediaType: "application/json";
169
- body: EntityProperty;
170
- }>(),
171
- )
172
- .then(
173
- validationSchemaStorage.validator(
174
- "UserPropertiesService.getUserProperty.response",
175
- ),
176
- )
177
- .then(commonHttpClient.getBody);
178
- }
179
- /**
180
- * Returns the keys of all properties for a user.
181
- *
182
- * Note: This operation does not access the [user
183
- * properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in
184
- * Jira.
185
- *
186
- * **[Permissions](#permissions) required:**
187
- *
188
- * * *Administer Jira* [global
189
- * permission](https://confluence.atlassian.com/x/x4dKLg), to access the property
190
- * keys on any user.
191
- * * Access to Jira, to access the calling user's property keys.
192
- *
193
- * @returns Returned if the request is successful.
194
- *
195
- * example: {
196
- * "keys": [
197
- * {
198
- * "key": "issue.support",
199
- * "self":
200
- * "https://your-domain.atlassian.net/rest/api/3/issue/EX-2/properties/issue.support"
201
- * }
202
- * ]
203
- * }
204
- * @path {GET} /rest/api/3/user/properties
205
- * @scopes-current read:jira-user
206
- * @scopes-beta read:user.property:jira
207
- */
208
- getUserPropertyKeys({
209
- accountId,
210
- userKey,
211
- username,
212
- }: {
213
- /**
214
- * The account ID of the user, which uniquely identifies the user across all
215
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
216
- */
217
- accountId?: string;
218
- /**
219
- * This parameter is no longer available and will be removed from the
220
- * documentation soon. See the [deprecation
221
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
222
- * for details.
223
- */
224
- userKey?: string;
225
- /**
226
- * This parameter is no longer available and will be removed from the
227
- * documentation soon. See the [deprecation
228
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
229
- * for details.
230
- */
231
- username?: string;
232
- }): Promise<PropertyKeys> {
233
- return this.getClientInstance()
234
- .request({
235
- path: "/rest/api/3/user/properties",
236
- method: "GET",
237
- query: {
238
- accountId,
239
- userKey,
240
- username,
241
- },
242
- })
243
- .then(
244
- this.getClientInstance().responseHandler({
245
- 200: {
246
- "application/json": "json",
247
- },
248
- }),
249
- )
250
- .then(
251
- commonHttpClient.castResponse<{
252
- status: 200;
253
- mediaType: "application/json";
254
- body: PropertyKeys;
255
- }>(),
256
- )
257
- .then(
258
- validationSchemaStorage.validator(
259
- "UserPropertiesService.getUserPropertyKeys.response",
260
- ),
261
- )
262
- .then(commonHttpClient.getBody);
263
- }
264
- /**
265
- * Sets the value of a user's property. Use this resource to store custom data
266
- * against a user.
267
- *
268
- * Note: This operation does not access the [user
269
- * properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in
270
- * Jira.
271
- *
272
- * **[Permissions](#permissions) required:**
273
- *
274
- * * *Administer Jira* [global
275
- * permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on
276
- * any user.
277
- * * Access to Jira, to set a property on the calling user's record.
278
- *
279
- * @returns * status: 200, mediaType: application/json
280
- *
281
- * Returned if the user property is updated.
282
- *
283
- * * status: 201, mediaType: application/json
284
- *
285
- * Returned if the user property is created.
286
- * @path {PUT} /rest/api/3/user/properties/{propertyKey}
287
- * @scopes-current write:jira-work
288
- * @scopes-beta write:user.property:jira
289
- */
290
- setUserProperty({
291
- propertyKey,
292
- accountId,
293
- userKey,
294
- username,
295
- requestBody,
296
- }: {
297
- /** The key of the user's property. The maximum length is 255 characters. */
298
- propertyKey: string;
299
- /**
300
- * The account ID of the user, which uniquely identifies the user across all
301
- * Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
302
- */
303
- accountId?: string;
304
- /**
305
- * This parameter is no longer available and will be removed from the
306
- * documentation soon. See the [deprecation
307
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
308
- * for details.
309
- */
310
- userKey?: string;
311
- /**
312
- * This parameter is no longer available and will be removed from the
313
- * documentation soon. See the [deprecation
314
- * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/)
315
- * for details.
316
- */
317
- username?: string;
318
- /**
319
- * The value of the property. The value has to be a valid, non-empty
320
- * [JSON](https://tools.ietf.org/html/rfc4627) value. The maximum length of the
321
- * property value is 32768 bytes.
322
- */
323
- requestBody: unknown;
324
- }): Promise<{
325
- created: boolean;
326
- body: unknown;
327
- }> {
328
- return this.getClientInstance()
329
- .request({
330
- path: "/rest/api/3/user/properties/{propertyKey}",
331
- method: "PUT",
332
- pathParams: {
333
- propertyKey,
334
- },
335
- query: {
336
- accountId,
337
- userKey,
338
- username,
339
- },
340
- headers: {
341
- "Content-Type": "application/json",
342
- },
343
- body: requestBody,
344
- })
345
- .then(
346
- this.getClientInstance().responseHandler({
347
- 200: {
348
- "application/json": "json",
349
- },
350
- 201: {
351
- "application/json": "json",
352
- },
353
- }),
354
- )
355
- .then(
356
- commonHttpClient.castResponse<{
357
- status: 200 | 201;
358
- mediaType: "application/json";
359
- body: unknown;
360
- }>(),
361
- )
362
- .then(
363
- validationSchemaStorage.validator(
364
- "UserPropertiesService.setUserProperty.response",
365
- ),
366
- )
367
- .then(commonHttpClient.asCreatedResponse("body"));
368
- }
369
- static initialize() {
370
- validationSchemaStorage.registerExtensible(
371
- "UserPropertiesService.getUserPropertyKeys.response",
372
- z
373
- .object({
374
- status: z.literal(200),
375
- mediaType: z.literal("application/json"),
376
- body: validationSchemaStorage.lazy("PropertyKeys"),
377
- })
378
- .describe("UserPropertiesService.getUserPropertyKeys.response"),
379
- );
380
- validationSchemaStorage.registerExtensible(
381
- "UserPropertiesService.getUserProperty.response",
382
- z
383
- .object({
384
- status: z.literal(200),
385
- mediaType: z.literal("application/json"),
386
- body: validationSchemaStorage.lazy("EntityProperty"),
387
- })
388
- .describe("UserPropertiesService.getUserProperty.response"),
389
- );
390
- validationSchemaStorage.registerExtensible(
391
- "UserPropertiesService.setUserProperty.response",
392
- z
393
- .object({
394
- status: z.number(),
395
- mediaType: z.string(),
396
- body: z.unknown(),
397
- })
398
- .superRefine(({ status: status, body: body }, ctx) => {
399
- if (status === 200 || status === 201) {
400
- z.unknown().parse(body);
401
- } else {
402
- ctx.addIssue({
403
- code: z.ZodIssueCode.custom,
404
- path: ["status"],
405
- message: `Unexpected status code: ${status}`,
406
- });
407
- }
408
- })
409
- .describe("UserPropertiesService.setUserProperty.response"),
410
- );
411
- validationSchemaStorage.registerOnce([registerCommonValidationSchemas]);
412
- }
413
- }