@devrev/typescript-sdk 1.0.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 (44) hide show
  1. package/.eslintignore +2 -0
  2. package/.github/workflows/npm-publish.yml +27 -0
  3. package/.prettierignore +4 -0
  4. package/.prettierrc +15 -0
  5. package/.vscode/extensions.json +8 -0
  6. package/.vscode/launch.json +17 -0
  7. package/.vscode/settings.json +31 -0
  8. package/README.md +69 -0
  9. package/USER_README.md +16 -0
  10. package/nodemon.json +5 -0
  11. package/package.json +61 -0
  12. package/src/auto-generated/beta/beta-devrev-sdk.ts +1826 -0
  13. package/src/auto-generated/internal/private-internal-devrev-sdk.ts +54739 -0
  14. package/src/auto-generated/public-devrev-sdk.ts +4009 -0
  15. package/src/beta-data-contracts.json +3271 -0
  16. package/src/client_setup.ts +64 -0
  17. package/src/private-internal-data-contracts.json +98025 -0
  18. package/src/public-data-contracts.json +6922 -0
  19. package/src/workflow/workflow.test.ts +26 -0
  20. package/src/workflow/workflow.ts +54 -0
  21. package/templates/README.md +17 -0
  22. package/templates/base/README.md +8 -0
  23. package/templates/base/data-contract-jsdoc.ejs +37 -0
  24. package/templates/base/data-contracts.ejs +28 -0
  25. package/templates/base/enum-data-contract.ejs +12 -0
  26. package/templates/base/http-client.ejs +3 -0
  27. package/templates/base/http-clients/axios-http-client.ejs +138 -0
  28. package/templates/base/http-clients/fetch-http-client.ejs +224 -0
  29. package/templates/base/interface-data-contract.ejs +10 -0
  30. package/templates/base/object-field-jsdoc.ejs +28 -0
  31. package/templates/base/route-docs.ejs +30 -0
  32. package/templates/base/route-name.ejs +43 -0
  33. package/templates/base/route-type.ejs +22 -0
  34. package/templates/base/type-data-contract.ejs +15 -0
  35. package/templates/default/README.md +7 -0
  36. package/templates/default/api.ejs +64 -0
  37. package/templates/default/procedure-call.ejs +100 -0
  38. package/templates/default/route-types.ejs +26 -0
  39. package/templates/modular/README.md +7 -0
  40. package/templates/modular/api.ejs +28 -0
  41. package/templates/modular/procedure-call.ejs +100 -0
  42. package/templates/modular/route-types.ejs +18 -0
  43. package/tsconfig.eslint.json +4 -0
  44. package/tsconfig.json +25 -0
@@ -0,0 +1,4009 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /*
4
+ * ---------------------------------------------------------------
5
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
6
+ * ## ##
7
+ * ## AUTHOR: acacode ##
8
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
+ * ---------------------------------------------------------------
10
+ */
11
+
12
+ /** artifact-summary */
13
+ export type ArtifactSummary = AtomBaseSummary;
14
+
15
+ /**
16
+ * artifacts-locate-response
17
+ * The response to getting an artifact's download URL.
18
+ */
19
+ export interface ArtifactsLocateResponse {
20
+ /**
21
+ * The expiration timestamp of the URL.
22
+ * @format date-time
23
+ */
24
+ expires_at?: string;
25
+ /** The artifact's download URL. */
26
+ url: string;
27
+ }
28
+
29
+ /**
30
+ * artifacts-prepare-request
31
+ * The request to prepare a URL to upload a file.
32
+ */
33
+ export interface ArtifactsPrepareRequest {
34
+ /** The name of the file that's being uploaded. */
35
+ file_name: string;
36
+ }
37
+
38
+ /**
39
+ * artifacts-prepare-response
40
+ * The response to preparing a URL to upload a file.
41
+ */
42
+ export interface ArtifactsPrepareResponse {
43
+ /** The POST policy form data. */
44
+ form_data: ArtifactsPrepareResponseFormData[];
45
+ /**
46
+ * The generated artifact's ID.
47
+ * @example "don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"
48
+ */
49
+ id: string;
50
+ /** The URL that the file's data should be uploaded to. */
51
+ url: string;
52
+ }
53
+
54
+ /** artifacts-prepare-response-form-data */
55
+ export interface ArtifactsPrepareResponseFormData {
56
+ /** Key of the form field. */
57
+ key: string;
58
+ /** Value corresponding to the key. */
59
+ value: string;
60
+ }
61
+
62
+ /** atom-base */
63
+ export interface AtomBase {
64
+ created_by?: UserSummary;
65
+ /**
66
+ * Timestamp when the object was created.
67
+ * @format date-time
68
+ */
69
+ created_date?: string;
70
+ /** Human-readable object ID unique to the Dev organization. */
71
+ display_id?: string;
72
+ /** Globally unique object ID. */
73
+ id: string;
74
+ modified_by?: UserSummary;
75
+ /**
76
+ * Timestamp when the object was last modified.
77
+ * @format date-time
78
+ */
79
+ modified_date?: string;
80
+ }
81
+
82
+ /** atom-base-summary */
83
+ export interface AtomBaseSummary {
84
+ /** Human-readable object ID unique to the Dev organization. */
85
+ display_id?: string;
86
+ /** Globally unique object ID. */
87
+ id: string;
88
+ }
89
+
90
+ /**
91
+ * auth-connection
92
+ * Connection object that specifies the configuration for an
93
+ * authentication connection that is set up for a Dev organization.
94
+ */
95
+ export type AuthConnection = (
96
+ | AuthConnectionOptionsAzureAd
97
+ | AuthConnectionOptionsGoogleApps
98
+ | AuthConnectionOptionsOidc
99
+ | AuthConnectionOptionsSaml
100
+ | AuthConnectionOptionsSocial
101
+ ) & {
102
+ /**
103
+ * Display name of the authentication connection. This name will be
104
+ * visible to all the users when they sign in to this Dev
105
+ * organization. For example, if the display_name is 'abclogin', then
106
+ * it would appear on the login button as 'Log in to abclogin'.
107
+ */
108
+ display_name?: string;
109
+ /**
110
+ * Whether the authentication connection is enabled or disabled. If
111
+ * set to false, the authentication connection will not show up on the
112
+ * login screen as a login option.
113
+ */
114
+ enabled?: boolean;
115
+ /** ID of the authentication connection. */
116
+ id: string;
117
+ /**
118
+ * Defines the type for the authentication connection. The configuration
119
+ * for each authentication connection will depend on the type value.
120
+ */
121
+ type: AuthConnectionType;
122
+ };
123
+
124
+ /**
125
+ * auth-connection-options-azure-ad
126
+ * Object encapsulating the configuration parameters for an Azure AD
127
+ * authentication connection.
128
+ */
129
+ export interface AuthConnectionOptionsAzureAd {
130
+ /** Client ID for the Azure authentication connection. */
131
+ client_id?: string;
132
+ /** Client secret for the Azure authentication connection. */
133
+ client_secret?: string;
134
+ /** Domain URL of the Azure authentication connection. */
135
+ domain?: string;
136
+ }
137
+
138
+ /**
139
+ * auth-connection-options-google-apps
140
+ * Object encapsulating the configuration parameters for a Google Apps
141
+ * authentication connection.
142
+ */
143
+ export interface AuthConnectionOptionsGoogleApps {
144
+ /** Client ID for the Google Apps authentication connection. */
145
+ client_id?: string;
146
+ /** Client secret for the Google Apps authentication connection. */
147
+ client_secret?: string;
148
+ /** Tenant domain URL of the Google Apps authentication connection. */
149
+ tenant_domain?: string;
150
+ }
151
+
152
+ /**
153
+ * auth-connection-options-oidc
154
+ * Object encapsulating the configuration parameters for an OIDC
155
+ * authentication connection.
156
+ */
157
+ export interface AuthConnectionOptionsOidc {
158
+ /** Client ID for the OIDC authentication connection. */
159
+ client_id?: string;
160
+ /** Client secret for the OIDC authentication connection. */
161
+ client_secret?: string;
162
+ /** Issuer URL of the OIDC authentication connection. */
163
+ issuer?: string;
164
+ }
165
+
166
+ /**
167
+ * auth-connection-options-saml
168
+ * Object encapsulating the configuration parameters for a SAML
169
+ * authentication connection.
170
+ */
171
+ export interface AuthConnectionOptionsSaml {
172
+ /** Sign In endpoint for the SAML authentication connection. */
173
+ sign_in_endpoint?: string;
174
+ /** Signing certificate for the SAML authentication connection. */
175
+ signing_cert?: string;
176
+ }
177
+
178
+ /** auth-connection-options-social */
179
+ export type AuthConnectionOptionsSocial = object;
180
+
181
+ export enum AuthConnectionToggle {
182
+ Disable = 'disable',
183
+ Enable = 'enable',
184
+ }
185
+
186
+ /**
187
+ * Defines the type for the authentication connection. The configuration
188
+ * for each authentication connection will depend on the type value.
189
+ */
190
+ export enum AuthConnectionType {
191
+ GoogleApps = 'google_apps',
192
+ Oidc = 'oidc',
193
+ Samlp = 'samlp',
194
+ Social = 'social',
195
+ Waad = 'waad',
196
+ }
197
+
198
+ /** auth-token */
199
+ export type AuthToken = AtomBase & {
200
+ /**
201
+ * An identifier that represents the application that requested the
202
+ * token. Only applicable for application access tokens.
203
+ */
204
+ client_id?: string;
205
+ /**
206
+ * The time at which the token expires.
207
+ * @format date-time
208
+ */
209
+ expires_at?: string;
210
+ /**
211
+ * The time at which the token was issued.
212
+ * @format date-time
213
+ */
214
+ issued_at?: string;
215
+ /** The type of the requested token. */
216
+ requested_token_type?: AuthTokenRequestedTokenType;
217
+ /** The scopes associated with the issued token. */
218
+ scopes?: string[];
219
+ /** The status of the token. */
220
+ status?: AuthTokenStatus;
221
+ /** The subject of the token. */
222
+ subject?: string;
223
+ /** A hint that identifies the token. */
224
+ token_hint?: string;
225
+ };
226
+
227
+ /** Specifies the process of obtaining a token. */
228
+ export enum AuthTokenGrantType {
229
+ UrnDevrevParamsOauthGrantTypeTokenIssue = 'urn:devrev:params:oauth:grant-type:token-issue',
230
+ UrnIetfParamsOauthGrantTypeTokenExchange = 'urn:ietf:params:oauth:grant-type:token-exchange',
231
+ }
232
+
233
+ /** The type of the requested token. */
234
+ export enum AuthTokenRequestedTokenType {
235
+ UrnDevrevParamsOauthTokenTypeAat = 'urn:devrev:params:oauth:token-type:aat',
236
+ UrnDevrevParamsOauthTokenTypeAatPublic = 'urn:devrev:params:oauth:token-type:aat:public',
237
+ UrnDevrevParamsOauthTokenTypeDev = 'urn:devrev:params:oauth:token-type:dev',
238
+ UrnDevrevParamsOauthTokenTypePat = 'urn:devrev:params:oauth:token-type:pat',
239
+ UrnDevrevParamsOauthTokenTypeRev = 'urn:devrev:params:oauth:token-type:rev',
240
+ UrnDevrevParamsOauthTokenTypeSession = 'urn:devrev:params:oauth:token-type:session',
241
+ UrnDevrevParamsOauthTokenTypeSessionDev0 = 'urn:devrev:params:oauth:token-type:session:dev0',
242
+ UrnDevrevParamsOauthTokenTypeSys = 'urn:devrev:params:oauth:token-type:sys',
243
+ UrnIetfParamsOauthTokenTypeJwt = 'urn:ietf:params:oauth:token-type:jwt',
244
+ }
245
+
246
+ /** The status of the token. */
247
+ export enum AuthTokenStatus {
248
+ Active = 'active',
249
+ Expired = 'expired',
250
+ Revoked = 'revoked',
251
+ }
252
+
253
+ /** The type of the subject token. */
254
+ export enum AuthTokenSubjectTokenType {
255
+ UrnDevrevParamsOauthTokenTypeJwtAuth0 = 'urn:devrev:params:oauth:token-type:jwt:auth0',
256
+ UrnDevrevParamsOauthTokenTypeJwtDev = 'urn:devrev:params:oauth:token-type:jwt:dev',
257
+ UrnDevrevParamsOauthTokenTypeRevinfo = 'urn:devrev:params:oauth:token-type:revinfo',
258
+ UrnDevrevParamsOauthTokenTypeSysu = 'urn:devrev:params:oauth:token-type:sysu',
259
+ UrnDevrevParamsOauthTokenTypeUserinfo = 'urn:devrev:params:oauth:token-type:userinfo',
260
+ UrnDevrevParamsOauthTokenTypeUserinfoProfile = 'urn:devrev:params:oauth:token-type:userinfo:profile',
261
+ UrnIetfParamsOauthTokenTypeJwt = 'urn:ietf:params:oauth:token-type:jwt',
262
+ }
263
+
264
+ /** The type of the issued token. Bearer is the only supported token type. */
265
+ export enum AuthTokenTokenType {
266
+ Bearer = 'bearer',
267
+ }
268
+
269
+ /**
270
+ * auth-tokens-create-request
271
+ * A request to create a new token corresponding to the requested token
272
+ * type.
273
+ */
274
+ export interface AuthTokensCreateRequest {
275
+ /** The expected audience values with respect to the token. */
276
+ aud?: string[];
277
+ /**
278
+ * An identifier that represents the application which is requesting
279
+ * the token. If no client_id is present in the request to generate an
280
+ * application access token (AAT), DevRev will generate a client_id.
281
+ * This client_id is only associated with an AAT.
282
+ */
283
+ client_id?: string;
284
+ /**
285
+ * The expected validity lifetime of the token in number of days.
286
+ * @format int64
287
+ */
288
+ expires_in?: number;
289
+ /** Specifies the process of obtaining a token. */
290
+ grant_type?: AuthTokenGrantType;
291
+ /** The type of the requested token. */
292
+ requested_token_type?: AuthTokenRequestedTokenType;
293
+ /**
294
+ * Carries info corresponding to the Rev user to be provisioned and/or
295
+ * issue a Rev session token.
296
+ */
297
+ rev_info?: AuthTokensRevInfo;
298
+ /**
299
+ * The requested set of scopes associated with the issued token. A
300
+ * space-delimited list of values in which the order of values does
301
+ * not matter.
302
+ */
303
+ scope?: string;
304
+ /**
305
+ * Represents the entity that requests the token. Not required when
306
+ * requesting an application access token (AAT).
307
+ */
308
+ subject_token?: string;
309
+ /** The type of the subject token. */
310
+ subject_token_type?: AuthTokenSubjectTokenType;
311
+ /** A hint that identifies the token. */
312
+ token_hint?: string;
313
+ }
314
+
315
+ /**
316
+ * auth-tokens-create-response
317
+ * Response for the request to create a new token corresponding to the
318
+ * requested token type.
319
+ */
320
+ export interface AuthTokensCreateResponse {
321
+ /**
322
+ * The issued JSON Web Token (JWT) corresponding to the requested
323
+ * token type.
324
+ */
325
+ access_token: string;
326
+ /**
327
+ * An identifier that represents the application which is requesting
328
+ * the token. Only present in a response corresponding to an
329
+ * application access token (AAT).
330
+ */
331
+ client_id?: string;
332
+ /**
333
+ * The validity lifetime of the token specified in seconds since Unix
334
+ * epoch.
335
+ * @format int64
336
+ */
337
+ expires_in: number;
338
+ /** A token to refresh the issued token. */
339
+ refresh_token?: string;
340
+ /**
341
+ * The scopes associated with the issued token. A space-delimited list
342
+ * of values in which the order of values does not matter.
343
+ */
344
+ scope?: string;
345
+ /** The type of the issued token. Bearer is the only supported token type. */
346
+ token_type: AuthTokenTokenType;
347
+ }
348
+
349
+ /**
350
+ * auth-tokens-delete-request
351
+ * The request to revoke the token.
352
+ */
353
+ export interface AuthTokensDeleteRequest {
354
+ /**
355
+ * The unique identifier for the token under a given Dev organization.
356
+ * If no token ID is provided, then the token ID will be set from the
357
+ * JTI claim of the token in the authorization header.
358
+ */
359
+ token_id?: string;
360
+ }
361
+
362
+ /**
363
+ * auth-tokens-get-response
364
+ * The response to get the token metadata.
365
+ */
366
+ export interface AuthTokensGetResponse {
367
+ token: AuthToken;
368
+ }
369
+
370
+ /**
371
+ * auth-tokens-list-response
372
+ * The response to list the token metadata.
373
+ */
374
+ export interface AuthTokensListResponse {
375
+ /** The list of token metadata. */
376
+ tokens: AuthToken[];
377
+ }
378
+
379
+ /**
380
+ * auth-tokens-org-traits
381
+ * Carries Rev org info.
382
+ */
383
+ export interface AuthTokensOrgTraits {
384
+ /** The display name of the Rev org. */
385
+ display_name?: string;
386
+ /** The domain of the Rev org. */
387
+ domain?: string;
388
+ }
389
+
390
+ /**
391
+ * auth-tokens-rev-info
392
+ * Carries info corresponding to the Rev user to be provisioned and/or
393
+ * issue a Rev session token.
394
+ */
395
+ export interface AuthTokensRevInfo {
396
+ /** An identifier which uniquely identifies a Rev org. */
397
+ org_ref?: string;
398
+ /** Carries Rev org info. */
399
+ org_traits?: AuthTokensOrgTraits;
400
+ /** The unique ID of the Rev user. */
401
+ rev_user_id?: string;
402
+ /** An identifier which uniquely identifies a Rev user. */
403
+ user_ref: string;
404
+ /** Carries Rev user info. */
405
+ user_traits?: AuthTokensUserTraits;
406
+ }
407
+
408
+ /**
409
+ * auth-tokens-self-delete-request
410
+ * The request to delete all the tokens created by the authenticated user,
411
+ * that match with the provided token type.
412
+ */
413
+ export interface AuthTokensSelfDeleteRequest {
414
+ /** The type of the requested token. */
415
+ requested_token_type?: AuthTokenRequestedTokenType;
416
+ }
417
+
418
+ /**
419
+ * auth-tokens-update-request
420
+ * A request to update the token metadata.
421
+ */
422
+ export interface AuthTokensUpdateRequest {
423
+ /** A hint that identifies the token. */
424
+ token_hint: string;
425
+ /** The unique identifier of the token under a given Dev organization. */
426
+ token_id: string;
427
+ }
428
+
429
+ /**
430
+ * auth-tokens-update-response
431
+ * Response for the request to update the token metadata.
432
+ */
433
+ export interface AuthTokensUpdateResponse {
434
+ token: AuthToken;
435
+ }
436
+
437
+ /**
438
+ * auth-tokens-user-traits
439
+ * Carries Rev user info.
440
+ */
441
+ export interface AuthTokensUserTraits {
442
+ /** The display name of the Rev user. */
443
+ display_name?: string;
444
+ /** The email address of the Rev user. */
445
+ email?: string;
446
+ /** The full name of the Rev user. */
447
+ full_name?: string;
448
+ }
449
+
450
+ /** capability */
451
+ export type Capability = PartBase;
452
+
453
+ /** capability-summary */
454
+ export type CapabilitySummary = PartBaseSummary;
455
+
456
+ /**
457
+ * dev-org-auth-connections-create-request
458
+ * Request to create a new enterprise authentication connection.
459
+ */
460
+ export type DevOrgAuthConnectionsCreateRequest = (
461
+ | AuthConnectionOptionsAzureAd
462
+ | AuthConnectionOptionsGoogleApps
463
+ | AuthConnectionOptionsOidc
464
+ | AuthConnectionOptionsSaml
465
+ ) & {
466
+ /**
467
+ * Display name of the authentication connection. This name will be
468
+ * visible to all the users when they sign in to this Dev
469
+ * organization. For example, if the display_name is 'abclogin', then
470
+ * it would appear on the login button as 'Log in to abclogin'.
471
+ */
472
+ display_name?: string;
473
+ /**
474
+ * Defines the type for the authentication connection. Different types of
475
+ * authentication connections have different configuration parameters.
476
+ */
477
+ type: DevOrgAuthConnectionsCreateRequestType;
478
+ };
479
+
480
+ /**
481
+ * Defines the type for the authentication connection. Different types of
482
+ * authentication connections have different configuration parameters.
483
+ */
484
+ export enum DevOrgAuthConnectionsCreateRequestType {
485
+ GoogleApps = 'google_apps',
486
+ Oidc = 'oidc',
487
+ Samlp = 'samlp',
488
+ Waad = 'waad',
489
+ }
490
+
491
+ /**
492
+ * dev-org-auth-connections-create-response
493
+ * Response for the request to create a new enterprise authentication
494
+ * connection.
495
+ */
496
+ export interface DevOrgAuthConnectionsCreateResponse {
497
+ /**
498
+ * Connection object that specifies the configuration for an
499
+ * authentication connection that is set up for a Dev organization.
500
+ */
501
+ auth_connection: AuthConnection;
502
+ }
503
+
504
+ /**
505
+ * dev-org-auth-connections-delete-request
506
+ * Request to delete an enterprise authentication connection for a Dev
507
+ * organization. A default connection and a connection which is currently
508
+ * enabled cannot be deleted.
509
+ */
510
+ export interface DevOrgAuthConnectionsDeleteRequest {
511
+ /** ID of the authentication connection to be deleted. */
512
+ id: string;
513
+ }
514
+
515
+ /**
516
+ * dev-org-auth-connections-get-response
517
+ * Response object encapsulating the configuration details of an
518
+ * authentication connection.
519
+ */
520
+ export interface DevOrgAuthConnectionsGetResponse {
521
+ /**
522
+ * Connection object that specifies the configuration for an
523
+ * authentication connection that is set up for a Dev organization.
524
+ */
525
+ auth_connection: AuthConnection;
526
+ }
527
+
528
+ /**
529
+ * dev-org-auth-connections-list-response
530
+ * Response object for the request to list all the social and enterprise
531
+ * authentication connections configured for a Dev organization.
532
+ */
533
+ export interface DevOrgAuthConnectionsListResponse {
534
+ /**
535
+ * List of all the authentication connections currently configured for
536
+ * a Dev organization.
537
+ */
538
+ auth_connections: AuthConnection[];
539
+ }
540
+
541
+ /**
542
+ * dev-org-auth-connections-toggle-request
543
+ * Request to enable or disable an authentication connection for a Dev
544
+ * organization.
545
+ */
546
+ export interface DevOrgAuthConnectionsToggleRequest {
547
+ /** ID of the authentication connection to be toggled. */
548
+ id: string;
549
+ toggle?: AuthConnectionToggle;
550
+ }
551
+
552
+ /**
553
+ * dev-org-auth-connections-update-request
554
+ * Request to update an enterprise authentication connection for a Dev
555
+ * organization.
556
+ */
557
+ export type DevOrgAuthConnectionsUpdateRequest = (
558
+ | AuthConnectionOptionsAzureAd
559
+ | AuthConnectionOptionsGoogleApps
560
+ | AuthConnectionOptionsOidc
561
+ | AuthConnectionOptionsSaml
562
+ ) & {
563
+ /**
564
+ * New display name of the authentication connection. This name will
565
+ * be visible to all the users when they sign in to this Dev
566
+ * organization. For example, if the display_name is 'abclogin', then
567
+ * it would appear on the login button as 'Log in to abclogin'.
568
+ */
569
+ display_name?: string;
570
+ /** ID of the authentication connection which is to be updated. */
571
+ id: string;
572
+ /**
573
+ * Specifies the type for the authentication connection. Different types
574
+ * of authentication connections have different configuration parameters
575
+ * that can be updated.
576
+ */
577
+ type: DevOrgAuthConnectionsUpdateRequestType;
578
+ };
579
+
580
+ /**
581
+ * Specifies the type for the authentication connection. Different types
582
+ * of authentication connections have different configuration parameters
583
+ * that can be updated.
584
+ */
585
+ export enum DevOrgAuthConnectionsUpdateRequestType {
586
+ GoogleApps = 'google_apps',
587
+ None = 'none',
588
+ Oidc = 'oidc',
589
+ Samlp = 'samlp',
590
+ Waad = 'waad',
591
+ }
592
+
593
+ /**
594
+ * dev-org-auth-connections-update-response
595
+ * Response for the request to update an enterprise authentication
596
+ * connection.
597
+ */
598
+ export interface DevOrgAuthConnectionsUpdateResponse {
599
+ /**
600
+ * Connection object that specifies the configuration for an
601
+ * authentication connection that is set up for a Dev organization.
602
+ */
603
+ auth_connection: AuthConnection;
604
+ }
605
+
606
+ /** dev-user */
607
+ export type DevUser = UserBase & {
608
+ /** IDs of the Dev User outside the DevRev SOR. */
609
+ external_identities?: ExternalIdentity[];
610
+ };
611
+
612
+ /** dev-user-summary */
613
+ export type DevUserSummary = UserBaseSummary;
614
+
615
+ /**
616
+ * dev-users-list-response
617
+ * The response to listing the Dev users.
618
+ */
619
+ export interface DevUsersListResponse {
620
+ /** The list of Dev users. */
621
+ dev_users: DevUser[];
622
+ /**
623
+ * The cursor used to iterate subsequent results in accordance to the
624
+ * sort order. If not set, then no later elements exist.
625
+ */
626
+ next_cursor?: string;
627
+ /**
628
+ * The cursor used to iterate preceding results in accordance to the
629
+ * sort order. If not set, then no prior elements exist.
630
+ */
631
+ prev_cursor?: string;
632
+ }
633
+
634
+ /**
635
+ * dev-users-self-response
636
+ * The response to getting the information for the authenticated user.
637
+ */
638
+ export interface DevUsersSelfResponse {
639
+ dev_user: DevUser;
640
+ }
641
+
642
+ /** empty */
643
+ export type Empty = object;
644
+
645
+ /** enhancement */
646
+ export type Enhancement = PartBase & {
647
+ /**
648
+ * Timestamp when the enhancement is expected to be closed.
649
+ * @format date-time
650
+ */
651
+ target_close_date?: string;
652
+ };
653
+
654
+ /** enhancement-summary */
655
+ export type EnhancementSummary = PartBaseSummary;
656
+
657
+ /** error-bad-request */
658
+ export type ErrorBadRequest = ErrorBase &
659
+ (
660
+ | ErrorBadRequestBadRequest
661
+ | ErrorBadRequestInvalidEnumValue
662
+ | ErrorBadRequestMissingRequiredField
663
+ | ErrorBadRequestParseError
664
+ | ErrorBadRequestValueNotPermitted
665
+ ) & {
666
+ type: ErrorBadRequestType;
667
+ };
668
+
669
+ /** error-bad-request-bad-request */
670
+ export type ErrorBadRequestBadRequest = object;
671
+
672
+ /** error-bad-request-invalid-enum-value */
673
+ export interface ErrorBadRequestInvalidEnumValue {
674
+ /** The allowed values for the field. */
675
+ allowed_values: string[];
676
+ /** The field whose enum value is invalid. */
677
+ field_name: string;
678
+ /** The value that was received. */
679
+ value: string;
680
+ }
681
+
682
+ /** error-bad-request-missing-required-field */
683
+ export interface ErrorBadRequestMissingRequiredField {
684
+ /** The missing field's name. */
685
+ field_name: string;
686
+ }
687
+
688
+ /** error-bad-request-parse-error */
689
+ export type ErrorBadRequestParseError = object;
690
+
691
+ export enum ErrorBadRequestType {
692
+ BadRequest = 'bad_request',
693
+ InvalidEnumValue = 'invalid_enum_value',
694
+ MissingRequiredField = 'missing_required_field',
695
+ ParseError = 'parse_error',
696
+ ValueNotPermitted = 'value_not_permitted',
697
+ }
698
+
699
+ /** error-bad-request-value-not-permitted */
700
+ export interface ErrorBadRequestValueNotPermitted {
701
+ /** The field whose value is not permitted. */
702
+ field_name: string;
703
+ /** The reason the value isn't permitted. */
704
+ reason?: string;
705
+ }
706
+
707
+ /** error-base */
708
+ export interface ErrorBase {
709
+ /** The message associated with the error. */
710
+ message?: string;
711
+ }
712
+
713
+ /** error-forbidden */
714
+ export type ErrorForbidden = ErrorBase &
715
+ ErrorForbiddenForbidden & {
716
+ type: ErrorForbiddenType;
717
+ };
718
+
719
+ /** error-forbidden-forbidden */
720
+ export type ErrorForbiddenForbidden = object;
721
+
722
+ export enum ErrorForbiddenType {
723
+ Forbidden = 'forbidden',
724
+ }
725
+
726
+ /** error-internal-server-error */
727
+ export type ErrorInternalServerError = ErrorBase &
728
+ ErrorInternalServerErrorInternalError & {
729
+ /**
730
+ * A unique ID that's generated for the error that can be used for
731
+ * inquiry.
732
+ */
733
+ reference_id?: string;
734
+ type: ErrorInternalServerErrorType;
735
+ };
736
+
737
+ /** error-internal-server-error-internal-error */
738
+ export type ErrorInternalServerErrorInternalError = object;
739
+
740
+ export enum ErrorInternalServerErrorType {
741
+ InternalError = 'internal_error',
742
+ }
743
+
744
+ /** error-not-found */
745
+ export type ErrorNotFound = ErrorBase &
746
+ ErrorNotFoundNotFound & {
747
+ type: ErrorNotFoundType;
748
+ };
749
+
750
+ /** error-not-found-not-found */
751
+ export type ErrorNotFoundNotFound = object;
752
+
753
+ export enum ErrorNotFoundType {
754
+ NotFound = 'not_found',
755
+ }
756
+
757
+ /** error-service-unavailable */
758
+ export type ErrorServiceUnavailable = ErrorBase &
759
+ ErrorServiceUnavailableServiceUnavailable & {
760
+ type: ErrorServiceUnavailableType;
761
+ };
762
+
763
+ /** error-service-unavailable-service-unavailable */
764
+ export type ErrorServiceUnavailableServiceUnavailable = object;
765
+
766
+ export enum ErrorServiceUnavailableType {
767
+ ServiceUnavailable = 'service_unavailable',
768
+ }
769
+
770
+ /** error-too-many-requests */
771
+ export type ErrorTooManyRequests = ErrorBase &
772
+ ErrorTooManyRequestsTooManyRequests & {
773
+ /**
774
+ * The number of seconds after which the client should retry.
775
+ * @format int64
776
+ */
777
+ retry_after?: number;
778
+ type: ErrorTooManyRequestsType;
779
+ };
780
+
781
+ /** error-too-many-requests-too-many-requests */
782
+ export type ErrorTooManyRequestsTooManyRequests = object;
783
+
784
+ export enum ErrorTooManyRequestsType {
785
+ TooManyRequests = 'too_many_requests',
786
+ }
787
+
788
+ /** error-unauthorized */
789
+ export type ErrorUnauthorized = ErrorBase &
790
+ ErrorUnauthorizedUnauthenticated & {
791
+ type: ErrorUnauthorizedType;
792
+ };
793
+
794
+ export enum ErrorUnauthorizedType {
795
+ Unauthenticated = 'unauthenticated',
796
+ }
797
+
798
+ /** error-unauthorized-unauthenticated */
799
+ export type ErrorUnauthorizedUnauthenticated = object;
800
+
801
+ /** event-part-created */
802
+ export interface EventPartCreated {
803
+ part: Part;
804
+ }
805
+
806
+ /** event-part-deleted */
807
+ export interface EventPartDeleted {
808
+ /**
809
+ * The ID of the part that was deleted.
810
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
811
+ */
812
+ id: string;
813
+ }
814
+
815
+ /** event-part-updated */
816
+ export interface EventPartUpdated {
817
+ part: Part;
818
+ }
819
+
820
+ /** event-rev-org-created */
821
+ export interface EventRevOrgCreated {
822
+ rev_org: RevOrg;
823
+ }
824
+
825
+ /** event-rev-org-deleted */
826
+ export interface EventRevOrgDeleted {
827
+ /**
828
+ * The ID of the Rev organization that was deleted.
829
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
830
+ */
831
+ id: string;
832
+ }
833
+
834
+ /** event-rev-org-updated */
835
+ export interface EventRevOrgUpdated {
836
+ rev_org: RevOrg;
837
+ }
838
+
839
+ /** event-tag-created */
840
+ export interface EventTagCreated {
841
+ tag: Tag;
842
+ }
843
+
844
+ /** event-tag-deleted */
845
+ export interface EventTagDeleted {
846
+ /**
847
+ * The ID of the tag that was deleted.
848
+ * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
849
+ */
850
+ id: string;
851
+ }
852
+
853
+ /** event-tag-updated */
854
+ export interface EventTagUpdated {
855
+ tag: Tag;
856
+ }
857
+
858
+ /** event-timeline-entry-created */
859
+ export interface EventTimelineEntryCreated {
860
+ entry: TimelineEntry;
861
+ }
862
+
863
+ /** event-timeline-entry-deleted */
864
+ export interface EventTimelineEntryDeleted {
865
+ /** The ID of the timeline entry that was deleted. */
866
+ id: string;
867
+ }
868
+
869
+ /** event-timeline-entry-updated */
870
+ export interface EventTimelineEntryUpdated {
871
+ entry: TimelineEntry;
872
+ }
873
+
874
+ /** event-webhook-created */
875
+ export interface EventWebhookCreated {
876
+ webhook: Webhook;
877
+ }
878
+
879
+ /** event-webhook-deleted */
880
+ export interface EventWebhookDeleted {
881
+ /**
882
+ * The ID of the webhook that was deleted.
883
+ * @example "don:<partition>:integration:devo/<dev-org-id>:webhook/<webhook-id>"
884
+ */
885
+ id: string;
886
+ }
887
+
888
+ /** event-webhook-updated */
889
+ export interface EventWebhookUpdated {
890
+ webhook: Webhook;
891
+ }
892
+
893
+ /** event-work-created */
894
+ export interface EventWorkCreated {
895
+ work: Work;
896
+ }
897
+
898
+ /** event-work-deleted */
899
+ export interface EventWorkDeleted {
900
+ /**
901
+ * The ID of the work that was deleted.
902
+ * @example "don:<partition>:core:devo/<dev-org-id>:<work-type>/<work-id>"
903
+ */
904
+ id: string;
905
+ }
906
+
907
+ /** event-work-updated */
908
+ export interface EventWorkUpdated {
909
+ work: Work;
910
+ }
911
+
912
+ /**
913
+ * external-identity
914
+ * External identity of a user.
915
+ */
916
+ export type ExternalIdentity = object;
917
+
918
+ /** feature */
919
+ export type Feature = PartBase;
920
+
921
+ /** feature-summary */
922
+ export type FeatureSummary = PartBaseSummary;
923
+
924
+ /** group-summary */
925
+ export type GroupSummary = AtomBaseSummary;
926
+
927
+ /** issue */
928
+ export type Issue = WorkBase & {
929
+ /** Priority of the work based upon impact and criticality. */
930
+ priority?: IssuePriority;
931
+ };
932
+
933
+ /** Priority of the work based upon impact and criticality. */
934
+ export enum IssuePriority {
935
+ P0 = 'p0',
936
+ P1 = 'p1',
937
+ P2 = 'p2',
938
+ P3 = 'p3',
939
+ }
940
+
941
+ /**
942
+ * The iteration mode to use. If "after", then entries after the provided
943
+ * cursor will be returned, or if no cursor is provided, then from the
944
+ * beginning. If "before", then entries before the provided cursor will be
945
+ * returned, or if no cursor is provided, then from the end. Entries will
946
+ * always be returned in the specified sort-by order.
947
+ */
948
+ export enum ListMode {
949
+ After = 'after',
950
+ Before = 'before',
951
+ }
952
+
953
+ /** org-base */
954
+ export type OrgBase = AtomBase & {
955
+ /** Name of the Organization. */
956
+ display_name?: string;
957
+ };
958
+
959
+ /** org-base-summary */
960
+ export type OrgBaseSummary = AtomBaseSummary & {
961
+ /** Name of the Organization. */
962
+ display_name?: string;
963
+ };
964
+
965
+ /** The environment of the Org. Defaults to 'production' if not specified. */
966
+ export enum OrgEnvironment {
967
+ Production = 'production',
968
+ Staging = 'staging',
969
+ Test = 'test',
970
+ }
971
+
972
+ /** org-summary */
973
+ export type OrgSummary = RevOrgSummary & {
974
+ type: OrgType;
975
+ };
976
+
977
+ export enum OrgType {
978
+ RevOrg = 'rev_org',
979
+ }
980
+
981
+ /** part */
982
+ export type Part = (Capability | Enhancement | Feature | Product) & {
983
+ type: PartType;
984
+ };
985
+
986
+ /** part-base */
987
+ export type PartBase = AtomBase & {
988
+ /** The attached artifacts. */
989
+ artifacts?: ArtifactSummary[];
990
+ /** Description of the part. */
991
+ description?: string;
992
+ /** Name of the part. */
993
+ name: string;
994
+ /** The users that own the part. */
995
+ owned_by: UserSummary[];
996
+ /** Tags associated with the object. */
997
+ tags?: TagWithValue[];
998
+ };
999
+
1000
+ /** part-base-summary */
1001
+ export type PartBaseSummary = AtomBaseSummary & {
1002
+ /** Name of the part. */
1003
+ name: string;
1004
+ };
1005
+
1006
+ /** part-summary */
1007
+ export type PartSummary = (
1008
+ | CapabilitySummary
1009
+ | EnhancementSummary
1010
+ | FeatureSummary
1011
+ | ProductSummary
1012
+ ) & {
1013
+ type: PartType;
1014
+ };
1015
+
1016
+ export enum PartType {
1017
+ Capability = 'capability',
1018
+ Enhancement = 'enhancement',
1019
+ Feature = 'feature',
1020
+ Product = 'product',
1021
+ }
1022
+
1023
+ /** parts-create-request */
1024
+ export type PartsCreateRequest = (
1025
+ | PartsCreateRequestCapability
1026
+ | PartsCreateRequestEnhancement
1027
+ | PartsCreateRequestFeature
1028
+ | PartsCreateRequestProduct
1029
+ ) & {
1030
+ /** Description of the part. */
1031
+ description?: string;
1032
+ /** Name of the part. */
1033
+ name: string;
1034
+ /**
1035
+ * The users that own the part.
1036
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1037
+ */
1038
+ owned_by: string[];
1039
+ type: PartType;
1040
+ };
1041
+
1042
+ /** parts-create-request-capability */
1043
+ export interface PartsCreateRequestCapability {
1044
+ /**
1045
+ * ID of the parent product for the capability.
1046
+ * @maxItems 1
1047
+ * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
1048
+ */
1049
+ parent_part: string[];
1050
+ }
1051
+
1052
+ /** parts-create-request-enhancement */
1053
+ export interface PartsCreateRequestEnhancement {
1054
+ /**
1055
+ * ID of the parent part on which the enhancement is to be created.
1056
+ * @maxItems 1
1057
+ * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
1058
+ */
1059
+ parent_part: string[];
1060
+ /**
1061
+ * Target close date by which enhancement is expected to be closed.
1062
+ * @format date-time
1063
+ */
1064
+ target_close_date?: string;
1065
+ }
1066
+
1067
+ /** parts-create-request-feature */
1068
+ export interface PartsCreateRequestFeature {
1069
+ /**
1070
+ * ID of the parent capability/feature for the feature.
1071
+ * @maxItems 1
1072
+ * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
1073
+ */
1074
+ parent_part: string[];
1075
+ }
1076
+
1077
+ /** parts-create-request-product */
1078
+ export type PartsCreateRequestProduct = object;
1079
+
1080
+ /** parts-create-response */
1081
+ export interface PartsCreateResponse {
1082
+ part: Part;
1083
+ }
1084
+
1085
+ /** parts-delete-request */
1086
+ export interface PartsDeleteRequest {
1087
+ /**
1088
+ * The ID of the part to delete.
1089
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
1090
+ */
1091
+ id: string;
1092
+ }
1093
+
1094
+ /** parts-delete-response */
1095
+ export type PartsDeleteResponse = object;
1096
+
1097
+ /** parts-get-response */
1098
+ export interface PartsGetResponse {
1099
+ part: Part;
1100
+ }
1101
+
1102
+ /** parts-list-response */
1103
+ export interface PartsListResponse {
1104
+ /**
1105
+ * The cursor used to iterate subsequent results in accordance to the
1106
+ * sort order. If not set, then no later elements exist.
1107
+ */
1108
+ next_cursor?: string;
1109
+ /** The list of parts. */
1110
+ parts: Part[];
1111
+ /**
1112
+ * The cursor used to iterate preceding results in accordance to the
1113
+ * sort order. If not set, then no prior elements exist.
1114
+ */
1115
+ prev_cursor?: string;
1116
+ }
1117
+
1118
+ /** parts-update-request */
1119
+ export type PartsUpdateRequest = (
1120
+ | PartsUpdateRequestCapability
1121
+ | PartsUpdateRequestEnhancement
1122
+ | PartsUpdateRequestFeature
1123
+ | PartsUpdateRequestProduct
1124
+ ) & {
1125
+ /** The updated description of the part. */
1126
+ description?: string;
1127
+ /**
1128
+ * The ID of the part to update.
1129
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
1130
+ */
1131
+ id: string;
1132
+ /** The updated name of the part. */
1133
+ name?: string;
1134
+ owned_by?: PartsUpdateRequestOwnedBy;
1135
+ type: PartType;
1136
+ };
1137
+
1138
+ /** parts-update-request-capability */
1139
+ export type PartsUpdateRequestCapability = object;
1140
+
1141
+ /** parts-update-request-enhancement */
1142
+ export interface PartsUpdateRequestEnhancement {
1143
+ /**
1144
+ * Updates the target close date of the enhancement.
1145
+ * @format date-time
1146
+ */
1147
+ target_close_date?: string;
1148
+ }
1149
+
1150
+ /** parts-update-request-feature */
1151
+ export type PartsUpdateRequestFeature = object;
1152
+
1153
+ /** parts-update-request-owned-by */
1154
+ export interface PartsUpdateRequestOwnedBy {
1155
+ /**
1156
+ * Sets the owner IDs to the provided user IDs. This must not be
1157
+ * empty.
1158
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1159
+ */
1160
+ set?: string[];
1161
+ }
1162
+
1163
+ /** parts-update-request-product */
1164
+ export type PartsUpdateRequestProduct = object;
1165
+
1166
+ /** parts-update-response */
1167
+ export interface PartsUpdateResponse {
1168
+ part: Part;
1169
+ }
1170
+
1171
+ /** product */
1172
+ export type Product = PartBase;
1173
+
1174
+ /** product-summary */
1175
+ export type ProductSummary = PartBaseSummary;
1176
+
1177
+ /** rev-org */
1178
+ export type RevOrg = OrgBase & {
1179
+ /** Description of the Rev organization. */
1180
+ description?: string;
1181
+ /** Company's domain name. Example - 'devrev.ai'. */
1182
+ domain?: string;
1183
+ /**
1184
+ * External ref is a unique identifier for the Rev (customer)
1185
+ * organization from your primary customer system of records. If none
1186
+ * is specified, a system-generated identifier will be assigned to the
1187
+ * organization.
1188
+ */
1189
+ external_ref?: string;
1190
+ };
1191
+
1192
+ /** rev-org-summary */
1193
+ export type RevOrgSummary = OrgBaseSummary;
1194
+
1195
+ /**
1196
+ * rev-orgs-create-request
1197
+ * Request object to create a new Rev organization in the Dev
1198
+ * organization.
1199
+ */
1200
+ export interface RevOrgsCreateRequest {
1201
+ /** Description of the Rev organization. */
1202
+ description?: string;
1203
+ /** Name of the Rev organization. */
1204
+ display_name: string;
1205
+ /** Company's domain name. Example - 'devrev.ai'. */
1206
+ domain?: string;
1207
+ /** The environment of the Org. Defaults to 'production' if not specified. */
1208
+ environment?: OrgEnvironment;
1209
+ /**
1210
+ * External ref is a custom unique identifier which is a reference to
1211
+ * an unique id for this organization's data in some system of
1212
+ * records.
1213
+ */
1214
+ external_ref?: string;
1215
+ /** The tier of the RevOrg. */
1216
+ tier?: string;
1217
+ }
1218
+
1219
+ /**
1220
+ * rev-orgs-create-response
1221
+ * Response object for request to create a new Rev organization.
1222
+ */
1223
+ export interface RevOrgsCreateResponse {
1224
+ rev_org: RevOrg;
1225
+ }
1226
+
1227
+ /**
1228
+ * rev-orgs-delete-request
1229
+ * Request object to delete a Rev organization.
1230
+ */
1231
+ export interface RevOrgsDeleteRequest {
1232
+ /**
1233
+ * The ID of Rev organization to delete.
1234
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
1235
+ */
1236
+ id: string;
1237
+ }
1238
+
1239
+ /**
1240
+ * rev-orgs-delete-response
1241
+ * The response to deleting a Rev organization.
1242
+ */
1243
+ export type RevOrgsDeleteResponse = object;
1244
+
1245
+ /**
1246
+ * rev-orgs-get-response
1247
+ * The response to getting a Rev organization's information.
1248
+ */
1249
+ export interface RevOrgsGetResponse {
1250
+ rev_org: RevOrg;
1251
+ }
1252
+
1253
+ /**
1254
+ * rev-orgs-list-response
1255
+ * The response to getting a list of Rev organizations' information.
1256
+ */
1257
+ export interface RevOrgsListResponse {
1258
+ /**
1259
+ * The cursor used to iterate subsequent results in accordance to the
1260
+ * sort order. If not set, then no later elements exist.
1261
+ */
1262
+ next_cursor?: string;
1263
+ /**
1264
+ * The cursor used to iterate preceding results in accordance to the
1265
+ * sort order. If not set, then no prior elements exist.
1266
+ */
1267
+ prev_cursor?: string;
1268
+ /** List with all of the Rev organizations' information. */
1269
+ rev_orgs: RevOrg[];
1270
+ }
1271
+
1272
+ /**
1273
+ * rev-orgs-update-request
1274
+ * Request object to update information of the Rev organization.
1275
+ */
1276
+ export interface RevOrgsUpdateRequest {
1277
+ /** Description of the Rev organization. */
1278
+ description?: string;
1279
+ /** Customer chosen name for the Rev organization. */
1280
+ display_name?: string;
1281
+ /** Company's domain name. Example - 'devrev.ai'. */
1282
+ domain?: string;
1283
+ /** The environment of the Org. Defaults to 'production' if not specified. */
1284
+ environment?: OrgEnvironment;
1285
+ /**
1286
+ * External ref is a custom unique identifier which is a reference to
1287
+ * an unique id for this organization's data in some system of
1288
+ * records.
1289
+ */
1290
+ external_ref?: string;
1291
+ /**
1292
+ * The ID of Rev organization to update.
1293
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
1294
+ */
1295
+ id: string;
1296
+ /** The tier of the RevOrg. */
1297
+ tier?: string;
1298
+ }
1299
+
1300
+ /**
1301
+ * rev-orgs-update-response
1302
+ * Response object to updating Rev organization's information.
1303
+ */
1304
+ export interface RevOrgsUpdateResponse {
1305
+ rev_org: RevOrg;
1306
+ }
1307
+
1308
+ /** rev-user-summary */
1309
+ export type RevUserSummary = UserBaseSummary & {
1310
+ /**
1311
+ * External ref is a mutable unique identifier for a user within the
1312
+ * Rev organization from your primary customer record. If none is
1313
+ * available, a good alternative is the email address/phone number
1314
+ * which could uniquely identify the user. If none is specified, a
1315
+ * system-generated identifier will be assigned to the user.
1316
+ */
1317
+ external_ref?: string;
1318
+ rev_org?: OrgSummary;
1319
+ };
1320
+
1321
+ /** set-tag-with-value */
1322
+ export interface SetTagWithValue {
1323
+ /**
1324
+ * The ID of the tag.
1325
+ * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
1326
+ */
1327
+ id: string;
1328
+ /**
1329
+ * The value for the object's association with the tag. If specified,
1330
+ * the value must be one that's specified in the tag's allowed values.
1331
+ */
1332
+ value?: string;
1333
+ }
1334
+
1335
+ /**
1336
+ * stage
1337
+ * Describes the current stage of a work item.
1338
+ */
1339
+ export interface Stage {
1340
+ /** Current stage name of the work item. */
1341
+ name: string;
1342
+ }
1343
+
1344
+ /**
1345
+ * stage-init
1346
+ * Sets an object's initial stage.
1347
+ */
1348
+ export interface StageInit {
1349
+ /** The name of the stage. */
1350
+ name?: string;
1351
+ }
1352
+
1353
+ /**
1354
+ * stage-update
1355
+ * Updates an object's stage.
1356
+ */
1357
+ export interface StageUpdate {
1358
+ /** The updated name of the stage, otherwise unchanged if not set. */
1359
+ name?: string;
1360
+ }
1361
+
1362
+ /** sys-user-summary */
1363
+ export type SysUserSummary = UserBaseSummary;
1364
+
1365
+ /** tag */
1366
+ export type Tag = AtomBase & {
1367
+ /**
1368
+ * The allowed values for the tag, where a value is provided when a
1369
+ * tag is associated with an object. If empty, then no value should be
1370
+ * provided when the association is made.
1371
+ */
1372
+ allowed_values?: string[];
1373
+ /**
1374
+ * An informative description for the tag that should provide context
1375
+ * on the tag's purpose and usage.
1376
+ */
1377
+ description?: string;
1378
+ /**
1379
+ * The name of the tag, which denotes the logical concept by which all
1380
+ * tagged objects will be associated. The name is guaranteed to be
1381
+ * unique.
1382
+ */
1383
+ name: string;
1384
+ };
1385
+
1386
+ /** tag-summary */
1387
+ export type TagSummary = AtomBaseSummary & {
1388
+ /**
1389
+ * The name of the tag, which denotes the logical concept by which all
1390
+ * tagged objects will be associated. The name is guaranteed to be
1391
+ * unique.
1392
+ */
1393
+ name: string;
1394
+ };
1395
+
1396
+ /** tag-with-value */
1397
+ export interface TagWithValue {
1398
+ tag: TagSummary;
1399
+ /** The value for the object's association with the tag. */
1400
+ value?: string;
1401
+ }
1402
+
1403
+ /**
1404
+ * tags-create-request
1405
+ * The request to create a new tag.
1406
+ */
1407
+ export interface TagsCreateRequest {
1408
+ /**
1409
+ * The allowed values for the tag, or empty if no values are
1410
+ * permitted.
1411
+ */
1412
+ allowed_values?: string[];
1413
+ /** The description for the tag. */
1414
+ description?: string;
1415
+ /** The name for the tag, which must be unique across all tags. */
1416
+ name: string;
1417
+ }
1418
+
1419
+ /**
1420
+ * tags-create-response
1421
+ * The response to creating a new tag.
1422
+ */
1423
+ export interface TagsCreateResponse {
1424
+ tag: Tag;
1425
+ }
1426
+
1427
+ /**
1428
+ * tags-delete-request
1429
+ * The request to delete a tag.
1430
+ */
1431
+ export interface TagsDeleteRequest {
1432
+ /**
1433
+ * The ID of the tag to delete.
1434
+ * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
1435
+ */
1436
+ id: string;
1437
+ }
1438
+
1439
+ /**
1440
+ * tags-delete-response
1441
+ * The response for deleting a tag.
1442
+ */
1443
+ export type TagsDeleteResponse = object;
1444
+
1445
+ /**
1446
+ * tags-get-response
1447
+ * The response to getting a tag's information.
1448
+ */
1449
+ export interface TagsGetResponse {
1450
+ tag: Tag;
1451
+ }
1452
+
1453
+ /**
1454
+ * tags-list-response
1455
+ * The response to listing the tags.
1456
+ */
1457
+ export interface TagsListResponse {
1458
+ /**
1459
+ * The cursor used to iterate subsequent results in accordance to the
1460
+ * sort order. If not set, then no later elements exist.
1461
+ */
1462
+ next_cursor?: string;
1463
+ /**
1464
+ * The cursor used to iterate preceding results in accordance to the
1465
+ * sort order. If not set, then no prior elements exist.
1466
+ */
1467
+ prev_cursor?: string;
1468
+ /** The list of tags. */
1469
+ tags: Tag[];
1470
+ }
1471
+
1472
+ /**
1473
+ * tags-update-allowed-values
1474
+ * Specifies an update to a tag's allowed values.
1475
+ */
1476
+ export interface TagsUpdateAllowedValues {
1477
+ /** Sets the allowed values for the tag. */
1478
+ set?: string[];
1479
+ }
1480
+
1481
+ /**
1482
+ * tags-update-request
1483
+ * The request to update a tag.
1484
+ */
1485
+ export interface TagsUpdateRequest {
1486
+ /** Specifies an update to a tag's allowed values. */
1487
+ allowed_values?: TagsUpdateAllowedValues;
1488
+ /** The updated description of the tag. */
1489
+ description?: string;
1490
+ /**
1491
+ * The ID of the tag to update.
1492
+ * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
1493
+ */
1494
+ id: string;
1495
+ /**
1496
+ * The updated name of the tag. The name must be unique across all
1497
+ * tags.
1498
+ */
1499
+ name?: string;
1500
+ }
1501
+
1502
+ /**
1503
+ * tags-update-response
1504
+ * The response for updating a tag.
1505
+ */
1506
+ export interface TagsUpdateResponse {
1507
+ tag: Tag;
1508
+ }
1509
+
1510
+ /** ticket */
1511
+ export type Ticket = WorkBase & {
1512
+ group?: GroupSummary;
1513
+ rev_org?: OrgSummary;
1514
+ /** Severity of the ticket. */
1515
+ severity?: TicketSeverity;
1516
+ };
1517
+
1518
+ /** Severity of the ticket. */
1519
+ export enum TicketSeverity {
1520
+ Blocker = 'blocker',
1521
+ High = 'high',
1522
+ Low = 'low',
1523
+ Medium = 'medium',
1524
+ }
1525
+
1526
+ /** timeline-comment */
1527
+ export type TimelineComment = TimelineEntryBase & {
1528
+ /** The artifacts for the comment. */
1529
+ artifacts?: ArtifactSummary[];
1530
+ /**
1531
+ * The comment's body. If the comment has been deleted, then no body
1532
+ * will appear in the response.
1533
+ */
1534
+ body?: string;
1535
+ /** The type of the body to use for the comment. */
1536
+ body_type?: TimelineCommentBodyType;
1537
+ /** The SnapKit Body of the comment. */
1538
+ snap_kit_body?: object;
1539
+ };
1540
+
1541
+ /** The type of the body to use for the comment. */
1542
+ export enum TimelineCommentBodyType {
1543
+ SnapKit = 'snap_kit',
1544
+ Text = 'text',
1545
+ }
1546
+
1547
+ /**
1548
+ * timeline-entries-create-request
1549
+ * The request to create a timeline entry for an object.
1550
+ */
1551
+ export type TimelineEntriesCreateRequest =
1552
+ TimelineEntriesCreateRequestTimelineComment & {
1553
+ /**
1554
+ * The ID of the object to create the timeline entry for.
1555
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
1556
+ */
1557
+ object: string;
1558
+ type: TimelineEntriesCreateRequestType;
1559
+ /**
1560
+ * The visibility of the entry. If 'private', then the entry is only
1561
+ * visible to the creator, otherwise if not set, then the entry has
1562
+ * default visibility.
1563
+ */
1564
+ visibility?: TimelineEntryVisibility;
1565
+ };
1566
+
1567
+ /** timeline-entries-create-request-timeline-comment */
1568
+ export interface TimelineEntriesCreateRequestTimelineComment {
1569
+ /**
1570
+ * The IDs of the artifacts attached to the comment.
1571
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
1572
+ */
1573
+ artifacts?: string[];
1574
+ /** The comment's body. */
1575
+ body?: string;
1576
+ /** The type of the body to use for the comment. */
1577
+ body_type?: TimelineCommentBodyType;
1578
+ /** The SnapKit body of the comment. */
1579
+ snap_kit_body?: object;
1580
+ }
1581
+
1582
+ export enum TimelineEntriesCreateRequestType {
1583
+ TimelineComment = 'timeline_comment',
1584
+ }
1585
+
1586
+ /**
1587
+ * timeline-entries-create-response
1588
+ * The response to creating a timeline entry for an object.
1589
+ */
1590
+ export interface TimelineEntriesCreateResponse {
1591
+ timeline_entry: TimelineEntry;
1592
+ }
1593
+
1594
+ /**
1595
+ * timeline-entries-get-response
1596
+ * The request to getting a timeline entry.
1597
+ */
1598
+ export interface TimelineEntriesGetResponse {
1599
+ timeline_entry: TimelineEntry;
1600
+ }
1601
+
1602
+ /**
1603
+ * timeline-entries-list-response
1604
+ * The response to listing timeline entries for an object.
1605
+ */
1606
+ export interface TimelineEntriesListResponse {
1607
+ /**
1608
+ * The cursor used to iterate subsequent results in accordance to the
1609
+ * sort order. If not set, then no later elements exist.
1610
+ */
1611
+ next_cursor?: string;
1612
+ /**
1613
+ * The cursor used to iterate preceding results in accordance to the
1614
+ * sort order. If not set, then no prior elements exist.
1615
+ */
1616
+ prev_cursor?: string;
1617
+ /** The timeline entries for the object. */
1618
+ timeline_entries: TimelineEntry[];
1619
+ }
1620
+
1621
+ /**
1622
+ * timeline-entries-update-request
1623
+ * The request to update a timeline entry.
1624
+ */
1625
+ export type TimelineEntriesUpdateRequest =
1626
+ TimelineEntriesUpdateRequestTimelineComment & {
1627
+ /** The ID of the timeline entry to update. */
1628
+ id: string;
1629
+ type: TimelineEntriesUpdateRequestType;
1630
+ };
1631
+
1632
+ /** timeline-entries-update-request-timeline-comment */
1633
+ export interface TimelineEntriesUpdateRequestTimelineComment {
1634
+ artifacts?: TimelineEntriesUpdateRequestTimelineCommentArtifacts;
1635
+ /** The updated comment's body. */
1636
+ body?: string;
1637
+ /** The type of the body to use for the comment. */
1638
+ body_type?: TimelineCommentBodyType;
1639
+ /** The SnapKit body of the comment. */
1640
+ snap_kit_body?: object;
1641
+ }
1642
+
1643
+ /** timeline-entries-update-request-timeline-comment-artifacts */
1644
+ export interface TimelineEntriesUpdateRequestTimelineCommentArtifacts {
1645
+ /**
1646
+ * Adds the provided artifacts to the comment. An artifact cannot be
1647
+ * added more than once, i.e. nothing is done if the artifact is
1648
+ * already attached. Mutually exclusive with `set`.
1649
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
1650
+ */
1651
+ add?: string[];
1652
+ /**
1653
+ * Removes the provided artifacts from the comment. If an artifact is
1654
+ * not present, then it's ignored. Mututally exclusive with `set`.
1655
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
1656
+ */
1657
+ remove?: string[];
1658
+ /**
1659
+ * Sets the field to the provided artifacts.
1660
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
1661
+ */
1662
+ set?: string[];
1663
+ }
1664
+
1665
+ export enum TimelineEntriesUpdateRequestType {
1666
+ TimelineComment = 'timeline_comment',
1667
+ }
1668
+
1669
+ /**
1670
+ * timeline-entries-update-response
1671
+ * The response to updating a timeline entry.
1672
+ */
1673
+ export interface TimelineEntriesUpdateResponse {
1674
+ timeline_entry: TimelineEntry;
1675
+ }
1676
+
1677
+ /** timeline-entry */
1678
+ export type TimelineEntry = TimelineComment & {
1679
+ type: TimelineEntryType;
1680
+ };
1681
+
1682
+ /** timeline-entry-base */
1683
+ export type TimelineEntryBase = AtomBase;
1684
+
1685
+ export enum TimelineEntryType {
1686
+ TimelineComment = 'timeline_comment',
1687
+ }
1688
+
1689
+ /**
1690
+ * The visibility of the entry. If 'private', then the entry is only
1691
+ * visible to the creator, otherwise if not set, then the entry has
1692
+ * default visibility.
1693
+ */
1694
+ export enum TimelineEntryVisibility {
1695
+ Private = 'private',
1696
+ }
1697
+
1698
+ /** user-base */
1699
+ export type UserBase = AtomBase & {
1700
+ /** The user's display name. The name is non-unique and mutable. */
1701
+ display_name?: string;
1702
+ display_picture?: ArtifactSummary;
1703
+ /** Email address of the user. */
1704
+ email?: string;
1705
+ /** Full name of the user. */
1706
+ full_name?: string;
1707
+ /** Phone numbers of the user. */
1708
+ phone_numbers?: string[];
1709
+ /** State of the user. */
1710
+ state?: UserState;
1711
+ };
1712
+
1713
+ /** user-base-summary */
1714
+ export type UserBaseSummary = AtomBaseSummary & {
1715
+ /** The user's display name. The name is non-unique and mutable. */
1716
+ display_name?: string;
1717
+ display_picture?: ArtifactSummary;
1718
+ /** Email address of the user. */
1719
+ email?: string;
1720
+ /** Full name of the user. */
1721
+ full_name?: string;
1722
+ /** State of the user. */
1723
+ state?: UserState;
1724
+ };
1725
+
1726
+ /** State of the user. */
1727
+ export enum UserState {
1728
+ Active = 'active',
1729
+ Deactivated = 'deactivated',
1730
+ Locked = 'locked',
1731
+ Shadow = 'shadow',
1732
+ Unassigned = 'unassigned',
1733
+ }
1734
+
1735
+ /** user-summary */
1736
+ export type UserSummary = (DevUserSummary | RevUserSummary | SysUserSummary) & {
1737
+ type: UserType;
1738
+ };
1739
+
1740
+ export enum UserType {
1741
+ DevUser = 'dev_user',
1742
+ RevUser = 'rev_user',
1743
+ SysUser = 'sys_user',
1744
+ }
1745
+
1746
+ /** webhook */
1747
+ export type Webhook = AtomBase & {
1748
+ /** The event types that the webhook will receive. */
1749
+ event_types?: WebhookEventType[];
1750
+ /**
1751
+ * The secret to use for verifying webhook events.
1752
+ * @format byte
1753
+ */
1754
+ secret: string;
1755
+ /** The status of the webhook. */
1756
+ status: WebhookStatus;
1757
+ /** The URL of the webhook endpoint. */
1758
+ url: string;
1759
+ };
1760
+
1761
+ /** webhook-event-request */
1762
+ export interface WebhookEventRequest {
1763
+ /** The event's ID. */
1764
+ id: string;
1765
+ part_created?: EventPartCreated;
1766
+ part_deleted?: EventPartDeleted;
1767
+ part_updated?: EventPartUpdated;
1768
+ rev_org_created?: EventRevOrgCreated;
1769
+ rev_org_deleted?: EventRevOrgDeleted;
1770
+ rev_org_updated?: EventRevOrgUpdated;
1771
+ tag_created?: EventTagCreated;
1772
+ tag_deleted?: EventTagDeleted;
1773
+ tag_updated?: EventTagUpdated;
1774
+ timeline_entry_created?: EventTimelineEntryCreated;
1775
+ timeline_entry_deleted?: EventTimelineEntryDeleted;
1776
+ timeline_entry_updated?: EventTimelineEntryUpdated;
1777
+ /**
1778
+ * Timestamp of the webhook's invocation for the event. Note this
1779
+ * should be used to protect against replay attacks, where the event
1780
+ * should only be processed if the timestamp isn't stale by several
1781
+ * seconds.
1782
+ * @format date-time
1783
+ */
1784
+ timestamp?: string;
1785
+ /** The event types that the webhook will receive. */
1786
+ type?: WebhookEventType;
1787
+ verify?: WebhookEventVerify;
1788
+ webhook_created?: EventWebhookCreated;
1789
+ webhook_deleted?: EventWebhookDeleted;
1790
+ /**
1791
+ * ID of the webhook for the event.
1792
+ * @example "don:<partition>:integration:devo/<dev-org-id>:webhook/<webhook-id>"
1793
+ */
1794
+ webhook_id: string;
1795
+ webhook_updated?: EventWebhookUpdated;
1796
+ work_created?: EventWorkCreated;
1797
+ work_deleted?: EventWorkDeleted;
1798
+ work_updated?: EventWorkUpdated;
1799
+ }
1800
+
1801
+ /** webhook-event-response */
1802
+ export interface WebhookEventResponse {
1803
+ /**
1804
+ * The challenge from the "verify" request, otherwise this should not
1805
+ * be set for other request types.
1806
+ * @format byte
1807
+ */
1808
+ challenge?: string;
1809
+ }
1810
+
1811
+ /** The event types that the webhook will receive. */
1812
+ export enum WebhookEventType {
1813
+ PartCreated = 'part_created',
1814
+ PartDeleted = 'part_deleted',
1815
+ PartUpdated = 'part_updated',
1816
+ RevOrgCreated = 'rev_org_created',
1817
+ RevOrgDeleted = 'rev_org_deleted',
1818
+ RevOrgUpdated = 'rev_org_updated',
1819
+ TagCreated = 'tag_created',
1820
+ TagDeleted = 'tag_deleted',
1821
+ TagUpdated = 'tag_updated',
1822
+ TimelineEntryCreated = 'timeline_entry_created',
1823
+ TimelineEntryDeleted = 'timeline_entry_deleted',
1824
+ TimelineEntryUpdated = 'timeline_entry_updated',
1825
+ Verify = 'verify',
1826
+ WebhookCreated = 'webhook_created',
1827
+ WebhookDeleted = 'webhook_deleted',
1828
+ WebhookUpdated = 'webhook_updated',
1829
+ WorkCreated = 'work_created',
1830
+ WorkDeleted = 'work_deleted',
1831
+ WorkUpdated = 'work_updated',
1832
+ }
1833
+
1834
+ /** webhook-event-verify */
1835
+ export interface WebhookEventVerify {
1836
+ /**
1837
+ * The challenge that must be echoed in the response.
1838
+ * @format byte
1839
+ */
1840
+ challenge: string;
1841
+ }
1842
+
1843
+ /** The status of the webhook. */
1844
+ export enum WebhookStatus {
1845
+ Active = 'active',
1846
+ Inactive = 'inactive',
1847
+ Unverified = 'unverified',
1848
+ }
1849
+
1850
+ /**
1851
+ * webhooks-create-request
1852
+ * The request to create a new webhook.
1853
+ */
1854
+ export interface WebhooksCreateRequest {
1855
+ /** The event types that the webhook endpoint will receive. */
1856
+ event_types?: WebhookEventType[];
1857
+ /**
1858
+ * The secret to use when verifying webhook events. If provided, the
1859
+ * secret must be between 8 and 32 bytes (inclusive). If not set, a
1860
+ * secret will be automatically generated and provided in the
1861
+ * response.
1862
+ * @format byte
1863
+ */
1864
+ secret?: string;
1865
+ /** The URL of the webhook endpoint. */
1866
+ url: string;
1867
+ }
1868
+
1869
+ /**
1870
+ * webhooks-create-response
1871
+ * The response to creating a new webhook.
1872
+ */
1873
+ export interface WebhooksCreateResponse {
1874
+ webhook: Webhook;
1875
+ }
1876
+
1877
+ /**
1878
+ * webhooks-delete-request
1879
+ * The request to delete a webhook.
1880
+ */
1881
+ export interface WebhooksDeleteRequest {
1882
+ /**
1883
+ * ID for the webhook.
1884
+ * @example "don:<partition>:integration:devo/<dev-org-id>:webhook/<webhook-id>"
1885
+ */
1886
+ id: string;
1887
+ }
1888
+
1889
+ /**
1890
+ * webhooks-delete-response
1891
+ * The response to deleting the webhook.
1892
+ */
1893
+ export type WebhooksDeleteResponse = object;
1894
+
1895
+ /**
1896
+ * webhooks-get-response
1897
+ * The response to getting the information for the webhook.
1898
+ */
1899
+ export interface WebhooksGetResponse {
1900
+ webhook: Webhook;
1901
+ }
1902
+
1903
+ /**
1904
+ * webhooks-list-response
1905
+ * The response to listing the webhooks.
1906
+ */
1907
+ export interface WebhooksListResponse {
1908
+ /** The list of webhooks. */
1909
+ webhooks: Webhook[];
1910
+ }
1911
+
1912
+ /** The action to update the webhook's status. */
1913
+ export enum WebhooksUpdateAction {
1914
+ Activate = 'activate',
1915
+ Deactivate = 'deactivate',
1916
+ }
1917
+
1918
+ /**
1919
+ * webhooks-update-request
1920
+ * The request to update a webhook.
1921
+ */
1922
+ export interface WebhooksUpdateRequest {
1923
+ /** The action to update the webhook's status. */
1924
+ action?: WebhooksUpdateAction;
1925
+ event_types?: WebhooksUpdateRequestEventTypes;
1926
+ /**
1927
+ * ID for the webhook.
1928
+ * @example "don:<partition>:integration:devo/<dev-org-id>:webhook/<webhook-id>"
1929
+ */
1930
+ id: string;
1931
+ /**
1932
+ * If provided, updates the secret that's used when verifying webhook
1933
+ * events, which must be between 8 and 32 bytes (inclusive). Otherwise
1934
+ * if empty, then a new secret is generated. If the webhook is active,
1935
+ * then its status will transition to the 'unverified' state and it
1936
+ * won't receive any object events until successfully verified.
1937
+ * @format byte
1938
+ */
1939
+ secret?: string;
1940
+ /**
1941
+ * The webhook's updated URL. If the webhook is active, then the
1942
+ * webhook's status will transition to the 'unverified' state and it
1943
+ * won't receive any object events until successfully verified.
1944
+ */
1945
+ url?: string;
1946
+ }
1947
+
1948
+ /** webhooks-update-request-event-types */
1949
+ export interface WebhooksUpdateRequestEventTypes {
1950
+ /**
1951
+ * The event types to add. If a provided event type is already set for
1952
+ * the webhook, then nothing is done. Note this is mutually exclusive
1953
+ * with 'set'.
1954
+ */
1955
+ add?: WebhookEventType[];
1956
+ /**
1957
+ * The event types to remove. If a provided event type isn't set for
1958
+ * the webhook, then nothing is done. Note this is mutually exclusive
1959
+ * with 'set'.
1960
+ */
1961
+ remove?: WebhookEventType[];
1962
+ /**
1963
+ * The updated event types, which will replace the webhook's current
1964
+ * event types. Note this is mutually exclusive with 'add' and
1965
+ * 'remove'.
1966
+ */
1967
+ set?: WebhookEventType[];
1968
+ }
1969
+
1970
+ /**
1971
+ * webhooks-update-response
1972
+ * The response to updating the webhook.
1973
+ */
1974
+ export interface WebhooksUpdateResponse {
1975
+ webhook: Webhook;
1976
+ }
1977
+
1978
+ /** work */
1979
+ export type Work = (Issue | Ticket) & {
1980
+ type: WorkType;
1981
+ };
1982
+
1983
+ /** work-base */
1984
+ export type WorkBase = AtomBase & {
1985
+ applies_to_part?: PartSummary;
1986
+ /** The artifacts attached to the work item. */
1987
+ artifacts?: ArtifactSummary[];
1988
+ /** Body of the work object. */
1989
+ body?: string;
1990
+ /** The users that own the work. */
1991
+ owned_by: UserSummary[];
1992
+ /** Users that reported the work. */
1993
+ reported_by?: UserSummary[];
1994
+ /** Describes the current stage of a work item. */
1995
+ stage?: Stage;
1996
+ /** Tags associated with the object. */
1997
+ tags?: TagWithValue[];
1998
+ /**
1999
+ * Timestamp when the work is expected to be complete.
2000
+ * @format date-time
2001
+ */
2002
+ target_close_date?: string;
2003
+ /** Title of the work object. */
2004
+ title: string;
2005
+ };
2006
+
2007
+ export enum WorkType {
2008
+ Issue = 'issue',
2009
+ Ticket = 'ticket',
2010
+ }
2011
+
2012
+ /** works-create-request */
2013
+ export type WorksCreateRequest = (
2014
+ | WorksCreateRequestIssue
2015
+ | WorksCreateRequestTicket
2016
+ ) & {
2017
+ /**
2018
+ * The [part](https://devrev.ai/docs/product/parts) that the work
2019
+ * applies to. Specifying a part is required when creating tickets and
2020
+ * issues.
2021
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
2022
+ */
2023
+ applies_to_part: string;
2024
+ /**
2025
+ * The IDs of the artifacts to associate with the work item.
2026
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
2027
+ */
2028
+ artifacts?: string[];
2029
+ /** Body of the work object. */
2030
+ body?: string;
2031
+ /**
2032
+ * The users that own the work.
2033
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
2034
+ */
2035
+ owned_by: string[];
2036
+ /**
2037
+ * The users that reported the work.
2038
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
2039
+ */
2040
+ reported_by?: string[];
2041
+ /** Sets an object's initial stage. */
2042
+ stage?: StageInit;
2043
+ /** Tags associated with the work item. */
2044
+ tags?: SetTagWithValue[];
2045
+ /**
2046
+ * Timestamp for when the work is expected to be complete.
2047
+ * @format date-time
2048
+ */
2049
+ target_close_date?: string;
2050
+ /** Title of the work object. */
2051
+ title: string;
2052
+ type: WorkType;
2053
+ };
2054
+
2055
+ /** works-create-request-issue */
2056
+ export interface WorksCreateRequestIssue {
2057
+ /** Priority of the work based upon impact and criticality. */
2058
+ priority?: IssuePriority;
2059
+ /** The sprint that the issue belongs to. */
2060
+ sprint?: string;
2061
+ }
2062
+
2063
+ /** works-create-request-ticket */
2064
+ export interface WorksCreateRequestTicket {
2065
+ /** The group that the ticket is associated with. */
2066
+ group?: string;
2067
+ /**
2068
+ * The Rev organization that the ticket is associated with.
2069
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
2070
+ */
2071
+ rev_org?: string;
2072
+ /** Severity of the ticket. */
2073
+ severity?: TicketSeverity;
2074
+ }
2075
+
2076
+ /** works-create-response */
2077
+ export interface WorksCreateResponse {
2078
+ work: Work;
2079
+ }
2080
+
2081
+ /** works-delete-request */
2082
+ export interface WorksDeleteRequest {
2083
+ /**
2084
+ * The work's ID.
2085
+ * @example "don:<partition>:core:devo/<dev-org-id>:<work-type>/<work-id>"
2086
+ */
2087
+ id: string;
2088
+ }
2089
+
2090
+ /** works-delete-response */
2091
+ export type WorksDeleteResponse = object;
2092
+
2093
+ /** works-export-response */
2094
+ export interface WorksExportResponse {
2095
+ /** The resulting collection of work items. */
2096
+ works: Work[];
2097
+ }
2098
+
2099
+ /** works-get-response */
2100
+ export interface WorksGetResponse {
2101
+ work: Work;
2102
+ }
2103
+
2104
+ /** works-list-response */
2105
+ export interface WorksListResponse {
2106
+ /**
2107
+ * The cursor used to iterate subsequent results in accordance to the
2108
+ * sort order. If not set, then no later elements exist.
2109
+ */
2110
+ next_cursor?: string;
2111
+ /**
2112
+ * The cursor used to iterate preceding results in accordance to the
2113
+ * sort order. If not set, then no prior elements exist.
2114
+ */
2115
+ prev_cursor?: string;
2116
+ /** The list of works. */
2117
+ works: Work[];
2118
+ }
2119
+
2120
+ /** works-update-request */
2121
+ export type WorksUpdateRequest = (
2122
+ | WorksUpdateRequestIssue
2123
+ | WorksUpdateRequestTicket
2124
+ ) & {
2125
+ /**
2126
+ * Updates the part that the work applies to.
2127
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
2128
+ */
2129
+ applies_to_part?: string;
2130
+ artifacts?: WorksUpdateRequestArtifactIds;
2131
+ /** Updated body of the work object, or unchanged if not provided. */
2132
+ body?: string;
2133
+ /**
2134
+ * The work's ID.
2135
+ * @example "don:<partition>:core:devo/<dev-org-id>:<work-type>/<work-id>"
2136
+ */
2137
+ id: string;
2138
+ owned_by?: WorksUpdateRequestOwnedBy;
2139
+ reported_by?: WorksUpdateRequestReportedBy;
2140
+ /** Updates an object's stage. */
2141
+ stage?: StageUpdate;
2142
+ tags?: WorksUpdateRequestTags;
2143
+ /**
2144
+ * Updates the timestamp for when the work is expected to be complete.
2145
+ * @format date-time
2146
+ */
2147
+ target_close_date?: string;
2148
+ /** Updated title of the work object, or unchanged if not provided. */
2149
+ title?: string;
2150
+ type: WorkType;
2151
+ };
2152
+
2153
+ /** works-update-request-artifact-ids */
2154
+ export interface WorksUpdateRequestArtifactIds {
2155
+ /**
2156
+ * Sets the IDs to the provided artifact IDs.
2157
+ * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
2158
+ */
2159
+ set?: string[];
2160
+ }
2161
+
2162
+ /** works-update-request-issue */
2163
+ export interface WorksUpdateRequestIssue {
2164
+ /** Priority of the work based upon impact and criticality. */
2165
+ priority?: IssuePriority;
2166
+ /** Updates the sprint that the issue belongs to. */
2167
+ sprint?: string | null;
2168
+ }
2169
+
2170
+ /** works-update-request-owned-by */
2171
+ export interface WorksUpdateRequestOwnedBy {
2172
+ /**
2173
+ * Sets the owner IDs to the provided user IDs. This must not be
2174
+ * empty.
2175
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
2176
+ */
2177
+ set?: string[];
2178
+ }
2179
+
2180
+ /** works-update-request-reported-by */
2181
+ export interface WorksUpdateRequestReportedBy {
2182
+ /**
2183
+ * Sets the users that reported the work to the provided user IDs.
2184
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
2185
+ */
2186
+ set?: string[];
2187
+ }
2188
+
2189
+ /** works-update-request-tags */
2190
+ export interface WorksUpdateRequestTags {
2191
+ /** Sets the provided tags on the work item. */
2192
+ set?: SetTagWithValue[];
2193
+ }
2194
+
2195
+ /** works-update-request-ticket */
2196
+ export interface WorksUpdateRequestTicket {
2197
+ /** The group that the ticket is associated with. */
2198
+ group?: string;
2199
+ /**
2200
+ * Updates the Rev organization that the ticket is associated with.
2201
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
2202
+ */
2203
+ rev_org?: string | null;
2204
+ /** Severity of the ticket. */
2205
+ severity?: TicketSeverity;
2206
+ }
2207
+
2208
+ /** works-update-response */
2209
+ export interface WorksUpdateResponse {
2210
+ work: Work;
2211
+ }
2212
+
2213
+ import axios, {
2214
+ AxiosInstance,
2215
+ AxiosRequestConfig,
2216
+ AxiosResponse,
2217
+ HeadersDefaults,
2218
+ ResponseType,
2219
+ } from 'axios';
2220
+
2221
+ export type QueryParamsType = Record<string | number, any>;
2222
+
2223
+ export interface FullRequestParams
2224
+ extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
2225
+ /** set parameter to `true` for call `securityWorker` for this request */
2226
+ secure?: boolean;
2227
+ /** request path */
2228
+ path: string;
2229
+ /** content type of request body */
2230
+ type?: ContentType;
2231
+ /** query params */
2232
+ query?: QueryParamsType;
2233
+ /** format of response (i.e. response.json() -> format: "json") */
2234
+ format?: ResponseType;
2235
+ /** request body */
2236
+ body?: unknown;
2237
+ }
2238
+
2239
+ export type RequestParams = Omit<
2240
+ FullRequestParams,
2241
+ 'body' | 'method' | 'query' | 'path'
2242
+ >;
2243
+
2244
+ export interface ApiConfig<SecurityDataType = unknown>
2245
+ extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
2246
+ securityWorker?: (
2247
+ securityData: SecurityDataType | null
2248
+ ) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
2249
+ secure?: boolean;
2250
+ format?: ResponseType;
2251
+ }
2252
+
2253
+ export enum ContentType {
2254
+ Json = 'application/json',
2255
+ FormData = 'multipart/form-data',
2256
+ UrlEncoded = 'application/x-www-form-urlencoded',
2257
+ Text = 'text/plain',
2258
+ }
2259
+
2260
+ export class HttpClient<SecurityDataType = unknown> {
2261
+ public instance: AxiosInstance;
2262
+ private securityData: SecurityDataType | null = null;
2263
+ private securityWorker?: ApiConfig<SecurityDataType>['securityWorker'];
2264
+ private secure?: boolean;
2265
+ private format?: ResponseType;
2266
+
2267
+ constructor({
2268
+ securityWorker,
2269
+ secure,
2270
+ format,
2271
+ ...axiosConfig
2272
+ }: ApiConfig<SecurityDataType> = {}) {
2273
+ this.instance = axios.create({
2274
+ ...axiosConfig,
2275
+ baseURL: axiosConfig.baseURL || '{protocol}://{hostname}',
2276
+ });
2277
+ this.secure = secure;
2278
+ this.format = format;
2279
+ this.securityWorker = securityWorker;
2280
+ }
2281
+
2282
+ public setSecurityData = (data: SecurityDataType | null) => {
2283
+ this.securityData = data;
2284
+ };
2285
+
2286
+ protected mergeRequestParams(
2287
+ params1: AxiosRequestConfig,
2288
+ params2?: AxiosRequestConfig
2289
+ ): AxiosRequestConfig {
2290
+ const method = params1.method || (params2 && params2.method);
2291
+
2292
+ return {
2293
+ ...this.instance.defaults,
2294
+ ...params1,
2295
+ ...(params2 || {}),
2296
+ headers: {
2297
+ ...((method &&
2298
+ this.instance.defaults.headers[
2299
+ method.toLowerCase() as keyof HeadersDefaults
2300
+ ]) ||
2301
+ {}),
2302
+ ...(params1.headers || {}),
2303
+ ...((params2 && params2.headers) || {}),
2304
+ },
2305
+ };
2306
+ }
2307
+
2308
+ protected stringifyFormItem(formItem: unknown) {
2309
+ if (typeof formItem === 'object' && formItem !== null) {
2310
+ return JSON.stringify(formItem);
2311
+ } else {
2312
+ return `${formItem}`;
2313
+ }
2314
+ }
2315
+
2316
+ protected createFormData(input: Record<string, unknown>): FormData {
2317
+ return Object.keys(input || {}).reduce((formData, key) => {
2318
+ const property = input[key];
2319
+ const propertyContent: any[] =
2320
+ property instanceof Array ? property : [property];
2321
+
2322
+ for (const formItem of propertyContent) {
2323
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
2324
+ formData.append(
2325
+ key,
2326
+ isFileType ? formItem : this.stringifyFormItem(formItem)
2327
+ );
2328
+ }
2329
+
2330
+ return formData;
2331
+ }, new FormData());
2332
+ }
2333
+
2334
+ public request = async <T = any, _E = any>({
2335
+ secure,
2336
+ path,
2337
+ type,
2338
+ query,
2339
+ format,
2340
+ body,
2341
+ ...params
2342
+ }: FullRequestParams): Promise<AxiosResponse<T>> => {
2343
+ const secureParams =
2344
+ ((typeof secure === 'boolean' ? secure : this.secure) &&
2345
+ this.securityWorker &&
2346
+ (await this.securityWorker(this.securityData))) ||
2347
+ {};
2348
+ const requestParams = this.mergeRequestParams(params, secureParams);
2349
+ const responseFormat = format || this.format || undefined;
2350
+
2351
+ if (
2352
+ type === ContentType.FormData &&
2353
+ body &&
2354
+ body !== null &&
2355
+ typeof body === 'object'
2356
+ ) {
2357
+ body = this.createFormData(body as Record<string, unknown>);
2358
+ }
2359
+
2360
+ if (
2361
+ type === ContentType.Text &&
2362
+ body &&
2363
+ body !== null &&
2364
+ typeof body !== 'string'
2365
+ ) {
2366
+ body = JSON.stringify(body);
2367
+ }
2368
+
2369
+ return this.instance.request({
2370
+ ...requestParams,
2371
+ headers: {
2372
+ ...(requestParams.headers || {}),
2373
+ ...(type && type !== ContentType.FormData
2374
+ ? { 'Content-Type': type }
2375
+ : {}),
2376
+ },
2377
+ params: query,
2378
+ responseType: responseFormat,
2379
+ data: body,
2380
+ url: path,
2381
+ });
2382
+ };
2383
+ }
2384
+
2385
+ /**
2386
+ * @title DevRev REST API
2387
+ * @version 2022-10-20
2388
+ * @baseUrl {protocol}://{hostname}
2389
+ *
2390
+ * DevRev's REST API.
2391
+ */
2392
+ export class Api<
2393
+ SecurityDataType extends unknown
2394
+ > extends HttpClient<SecurityDataType> {
2395
+ /**
2396
+ * @description Gets the download URL for the artifact.
2397
+ *
2398
+ * @tags artifacts
2399
+ * @name ArtifactsLocate
2400
+ * @request GET:/artifacts.locate
2401
+ * @secure
2402
+ */
2403
+ artifactsLocate = (
2404
+ query: {
2405
+ /**
2406
+ * The ID of the artifact to get the URL for.
2407
+ * @example "don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"
2408
+ */
2409
+ id: string;
2410
+ },
2411
+ params: RequestParams = {}
2412
+ ) =>
2413
+ this.request<
2414
+ ArtifactsLocateResponse,
2415
+ | ErrorBadRequest
2416
+ | ErrorUnauthorized
2417
+ | ErrorForbidden
2418
+ | ErrorNotFound
2419
+ | ErrorTooManyRequests
2420
+ | ErrorInternalServerError
2421
+ | ErrorServiceUnavailable
2422
+ >({
2423
+ path: `/artifacts.locate`,
2424
+ method: 'GET',
2425
+ query: query,
2426
+ secure: true,
2427
+ format: 'json',
2428
+ ...params,
2429
+ });
2430
+
2431
+ /**
2432
+ * @description Creates an artifact and generates an upload URL for its data.
2433
+ *
2434
+ * @tags artifacts
2435
+ * @name ArtifactsPrepare
2436
+ * @request POST:/artifacts.prepare
2437
+ * @secure
2438
+ */
2439
+ artifactsPrepare = (
2440
+ data: ArtifactsPrepareRequest,
2441
+ params: RequestParams = {}
2442
+ ) =>
2443
+ this.request<
2444
+ ArtifactsPrepareResponse,
2445
+ | ErrorBadRequest
2446
+ | ErrorUnauthorized
2447
+ | ErrorForbidden
2448
+ | ErrorTooManyRequests
2449
+ | ErrorInternalServerError
2450
+ | ErrorServiceUnavailable
2451
+ >({
2452
+ path: `/artifacts.prepare`,
2453
+ method: 'POST',
2454
+ body: data,
2455
+ secure: true,
2456
+ type: ContentType.Json,
2457
+ format: 'json',
2458
+ ...params,
2459
+ });
2460
+
2461
+ /**
2462
+ * @description Creates a JWT corresponding to the requested token type for the authenticated user.
2463
+ *
2464
+ * @tags auth-tokens
2465
+ * @name AuthTokensCreate
2466
+ * @request POST:/auth-tokens.create
2467
+ * @secure
2468
+ */
2469
+ authTokensCreate = (
2470
+ data: AuthTokensCreateRequest,
2471
+ params: RequestParams = {}
2472
+ ) =>
2473
+ this.request<
2474
+ AuthTokensCreateResponse,
2475
+ | ErrorBadRequest
2476
+ | ErrorUnauthorized
2477
+ | ErrorForbidden
2478
+ | ErrorTooManyRequests
2479
+ | ErrorInternalServerError
2480
+ | ErrorServiceUnavailable
2481
+ >({
2482
+ path: `/auth-tokens.create`,
2483
+ method: 'POST',
2484
+ body: data,
2485
+ secure: true,
2486
+ type: ContentType.Json,
2487
+ format: 'json',
2488
+ ...params,
2489
+ });
2490
+
2491
+ /**
2492
+ * @description Revokes the token that matches the given token ID issued under the given Dev organization.
2493
+ *
2494
+ * @tags auth-tokens
2495
+ * @name AuthTokensDelete
2496
+ * @request POST:/auth-tokens.delete
2497
+ * @secure
2498
+ */
2499
+ authTokensDelete = (
2500
+ data: AuthTokensDeleteRequest,
2501
+ params: RequestParams = {}
2502
+ ) =>
2503
+ this.request<
2504
+ void,
2505
+ | ErrorBadRequest
2506
+ | ErrorUnauthorized
2507
+ | ErrorForbidden
2508
+ | ErrorNotFound
2509
+ | ErrorTooManyRequests
2510
+ | ErrorInternalServerError
2511
+ | ErrorServiceUnavailable
2512
+ >({
2513
+ path: `/auth-tokens.delete`,
2514
+ method: 'POST',
2515
+ body: data,
2516
+ secure: true,
2517
+ type: ContentType.Json,
2518
+ ...params,
2519
+ });
2520
+
2521
+ /**
2522
+ * @description Gets the token metadata corresponding to the given token ID under the given Dev organization.
2523
+ *
2524
+ * @tags auth-tokens
2525
+ * @name AuthTokensGet
2526
+ * @request GET:/auth-tokens.get
2527
+ * @secure
2528
+ */
2529
+ authTokensGet = (
2530
+ query: {
2531
+ /** The unique identifier of the token under a given Dev organization. */
2532
+ token_id: string;
2533
+ },
2534
+ params: RequestParams = {}
2535
+ ) =>
2536
+ this.request<
2537
+ AuthTokensGetResponse,
2538
+ | ErrorBadRequest
2539
+ | ErrorUnauthorized
2540
+ | ErrorForbidden
2541
+ | ErrorNotFound
2542
+ | ErrorTooManyRequests
2543
+ | ErrorInternalServerError
2544
+ | ErrorServiceUnavailable
2545
+ >({
2546
+ path: `/auth-tokens.get`,
2547
+ method: 'GET',
2548
+ query: query,
2549
+ secure: true,
2550
+ format: 'json',
2551
+ ...params,
2552
+ });
2553
+
2554
+ /**
2555
+ * @description Gets the token metadata for all the tokens corresponding to the given token type issued for a given subject.
2556
+ *
2557
+ * @tags auth-tokens
2558
+ * @name AuthTokensList
2559
+ * @request GET:/auth-tokens.list
2560
+ * @secure
2561
+ */
2562
+ authTokensList = (
2563
+ query?: {
2564
+ /**
2565
+ * An identifier that represents the application, which requested the
2566
+ * token. Only relevant for application access tokens.
2567
+ */
2568
+ client_id?: string;
2569
+ /**
2570
+ * The type of the requested token. If no value is specified, the
2571
+ * response will include tokens of all the types.
2572
+ */
2573
+ requested_token_type?: AuthTokenRequestedTokenType;
2574
+ /**
2575
+ * The subject associated with the token. In the absence of this
2576
+ * parameter, the ID of the authenticated entity is treated as the
2577
+ * subject.
2578
+ */
2579
+ subject?: string;
2580
+ },
2581
+ params: RequestParams = {}
2582
+ ) =>
2583
+ this.request<
2584
+ AuthTokensListResponse,
2585
+ | ErrorBadRequest
2586
+ | ErrorUnauthorized
2587
+ | ErrorForbidden
2588
+ | ErrorNotFound
2589
+ | ErrorTooManyRequests
2590
+ | ErrorInternalServerError
2591
+ | ErrorServiceUnavailable
2592
+ >({
2593
+ path: `/auth-tokens.list`,
2594
+ method: 'GET',
2595
+ query: query,
2596
+ secure: true,
2597
+ format: 'json',
2598
+ ...params,
2599
+ });
2600
+
2601
+ /**
2602
+ * @description Revokes all the tokens that matches the given token type created by the authenticated user.
2603
+ *
2604
+ * @tags auth-tokens
2605
+ * @name AuthTokensSelfDelete
2606
+ * @request POST:/auth-tokens.self.delete
2607
+ * @secure
2608
+ */
2609
+ authTokensSelfDelete = (
2610
+ data: AuthTokensSelfDeleteRequest,
2611
+ params: RequestParams = {}
2612
+ ) =>
2613
+ this.request<
2614
+ void,
2615
+ | ErrorBadRequest
2616
+ | ErrorUnauthorized
2617
+ | ErrorForbidden
2618
+ | ErrorNotFound
2619
+ | ErrorTooManyRequests
2620
+ | ErrorInternalServerError
2621
+ | ErrorServiceUnavailable
2622
+ >({
2623
+ path: `/auth-tokens.self.delete`,
2624
+ method: 'POST',
2625
+ body: data,
2626
+ secure: true,
2627
+ type: ContentType.Json,
2628
+ ...params,
2629
+ });
2630
+
2631
+ /**
2632
+ * @description Updates token metadata of a token issued under a given Dev organization.
2633
+ *
2634
+ * @tags auth-tokens
2635
+ * @name AuthTokensUpdate
2636
+ * @request POST:/auth-tokens.update
2637
+ * @secure
2638
+ */
2639
+ authTokensUpdate = (
2640
+ data: AuthTokensUpdateRequest,
2641
+ params: RequestParams = {}
2642
+ ) =>
2643
+ this.request<
2644
+ AuthTokensUpdateResponse,
2645
+ | ErrorBadRequest
2646
+ | ErrorUnauthorized
2647
+ | ErrorForbidden
2648
+ | ErrorNotFound
2649
+ | ErrorTooManyRequests
2650
+ | ErrorInternalServerError
2651
+ | ErrorServiceUnavailable
2652
+ >({
2653
+ path: `/auth-tokens.update`,
2654
+ method: 'POST',
2655
+ body: data,
2656
+ secure: true,
2657
+ type: ContentType.Json,
2658
+ format: 'json',
2659
+ ...params,
2660
+ });
2661
+
2662
+ /**
2663
+ * @description Creates a new enterprise authentication connection for a Dev organization. This authentication connection will not be enabled by default for the organization and the user will need to explicitly enable this. Keep in mind that at a time, only one authentication connection can be enabled for a Dev organization. At present, only 5 enterprise connections can be created by an organization.
2664
+ *
2665
+ * @tags auth-connection, dev-orgs
2666
+ * @name DevOrgAuthConnectionsCreate
2667
+ * @request POST:/dev-orgs.auth-connections.create
2668
+ * @secure
2669
+ */
2670
+ devOrgAuthConnectionsCreate = (
2671
+ data: DevOrgAuthConnectionsCreateRequest,
2672
+ params: RequestParams = {}
2673
+ ) =>
2674
+ this.request<
2675
+ DevOrgAuthConnectionsCreateResponse,
2676
+ | ErrorBadRequest
2677
+ | ErrorUnauthorized
2678
+ | ErrorForbidden
2679
+ | ErrorTooManyRequests
2680
+ | ErrorInternalServerError
2681
+ | ErrorServiceUnavailable
2682
+ >({
2683
+ path: `/dev-orgs.auth-connections.create`,
2684
+ method: 'POST',
2685
+ body: data,
2686
+ secure: true,
2687
+ type: ContentType.Json,
2688
+ format: 'json',
2689
+ ...params,
2690
+ });
2691
+
2692
+ /**
2693
+ * @description Deletes an authentication connection. Only enterprise connections which are explicitly set up for a Dev organization can be deleted. Default connections can not be deleted using this method.
2694
+ *
2695
+ * @tags auth-connection, dev-orgs
2696
+ * @name DevOrgAuthConnectionsDelete
2697
+ * @request POST:/dev-orgs.auth-connections.delete
2698
+ * @secure
2699
+ */
2700
+ devOrgAuthConnectionsDelete = (
2701
+ data: DevOrgAuthConnectionsDeleteRequest,
2702
+ params: RequestParams = {}
2703
+ ) =>
2704
+ this.request<
2705
+ void,
2706
+ | ErrorBadRequest
2707
+ | ErrorUnauthorized
2708
+ | ErrorForbidden
2709
+ | ErrorNotFound
2710
+ | ErrorTooManyRequests
2711
+ | ErrorInternalServerError
2712
+ | ErrorServiceUnavailable
2713
+ >({
2714
+ path: `/dev-orgs.auth-connections.delete`,
2715
+ method: 'POST',
2716
+ body: data,
2717
+ secure: true,
2718
+ type: ContentType.Json,
2719
+ ...params,
2720
+ });
2721
+
2722
+ /**
2723
+ * @description Retrieves the details for an authentication connection.
2724
+ *
2725
+ * @tags auth-connection, dev-orgs
2726
+ * @name DevOrgAuthConnectionsGet
2727
+ * @request GET:/dev-orgs.auth-connections.get
2728
+ * @secure
2729
+ */
2730
+ devOrgAuthConnectionsGet = (
2731
+ query: {
2732
+ /** ID of the authentication connection. */
2733
+ id: string;
2734
+ },
2735
+ params: RequestParams = {}
2736
+ ) =>
2737
+ this.request<
2738
+ DevOrgAuthConnectionsGetResponse,
2739
+ | ErrorBadRequest
2740
+ | ErrorUnauthorized
2741
+ | ErrorForbidden
2742
+ | ErrorNotFound
2743
+ | ErrorTooManyRequests
2744
+ | ErrorInternalServerError
2745
+ | ErrorServiceUnavailable
2746
+ >({
2747
+ path: `/dev-orgs.auth-connections.get`,
2748
+ method: 'GET',
2749
+ query: query,
2750
+ secure: true,
2751
+ format: 'json',
2752
+ ...params,
2753
+ });
2754
+
2755
+ /**
2756
+ * @description Lists all the authentication connections available for a Dev organization. This list will include both social and enterprise connections which are either available by default or are explicitly created by the user.
2757
+ *
2758
+ * @tags auth-connection, dev-orgs
2759
+ * @name DevOrgAuthConnectionsList
2760
+ * @request GET:/dev-orgs.auth-connections.list
2761
+ * @secure
2762
+ */
2763
+ devOrgAuthConnectionsList = (params: RequestParams = {}) =>
2764
+ this.request<
2765
+ DevOrgAuthConnectionsListResponse,
2766
+ | ErrorBadRequest
2767
+ | ErrorUnauthorized
2768
+ | ErrorForbidden
2769
+ | ErrorTooManyRequests
2770
+ | ErrorInternalServerError
2771
+ | ErrorServiceUnavailable
2772
+ >({
2773
+ path: `/dev-orgs.auth-connections.list`,
2774
+ method: 'GET',
2775
+ secure: true,
2776
+ format: 'json',
2777
+ ...params,
2778
+ });
2779
+
2780
+ /**
2781
+ * @description Enable or disable an authentication connection for a Dev organization. Currently, only 1 authentication connection can be enabled at a time. When a new authentication connection is enabled, the connection which is currently enabled for the Dev organization is automatically disabled.
2782
+ *
2783
+ * @tags auth-connection, dev-orgs
2784
+ * @name DevOrgAuthConnectionsToggle
2785
+ * @request POST:/dev-orgs.auth-connections.toggle
2786
+ * @secure
2787
+ */
2788
+ devOrgAuthConnectionsToggle = (
2789
+ data: DevOrgAuthConnectionsToggleRequest,
2790
+ params: RequestParams = {}
2791
+ ) =>
2792
+ this.request<
2793
+ void,
2794
+ | ErrorBadRequest
2795
+ | ErrorUnauthorized
2796
+ | ErrorForbidden
2797
+ | ErrorNotFound
2798
+ | ErrorTooManyRequests
2799
+ | ErrorInternalServerError
2800
+ | ErrorServiceUnavailable
2801
+ >({
2802
+ path: `/dev-orgs.auth-connections.toggle`,
2803
+ method: 'POST',
2804
+ body: data,
2805
+ secure: true,
2806
+ type: ContentType.Json,
2807
+ ...params,
2808
+ });
2809
+
2810
+ /**
2811
+ * @description Updates an authentication connection.
2812
+ *
2813
+ * @tags auth-connection, dev-orgs
2814
+ * @name DevOrgAuthConnectionsUpdate
2815
+ * @request POST:/dev-orgs.auth-connections.update
2816
+ * @secure
2817
+ */
2818
+ devOrgAuthConnectionsUpdate = (
2819
+ data: DevOrgAuthConnectionsUpdateRequest,
2820
+ params: RequestParams = {}
2821
+ ) =>
2822
+ this.request<
2823
+ DevOrgAuthConnectionsUpdateResponse,
2824
+ | ErrorBadRequest
2825
+ | ErrorUnauthorized
2826
+ | ErrorForbidden
2827
+ | ErrorNotFound
2828
+ | ErrorTooManyRequests
2829
+ | ErrorInternalServerError
2830
+ | ErrorServiceUnavailable
2831
+ >({
2832
+ path: `/dev-orgs.auth-connections.update`,
2833
+ method: 'POST',
2834
+ body: data,
2835
+ secure: true,
2836
+ type: ContentType.Json,
2837
+ format: 'json',
2838
+ ...params,
2839
+ });
2840
+
2841
+ /**
2842
+ * @description Lists users within your organization.
2843
+ *
2844
+ * @tags dev-users
2845
+ * @name DevUsersList
2846
+ * @request GET:/dev-users.list
2847
+ * @secure
2848
+ */
2849
+ devUsersList = (
2850
+ query?: {
2851
+ /**
2852
+ * The cursor to resume iteration from. If not provided, then iteration
2853
+ * starts from the beginning.
2854
+ */
2855
+ cursor?: string;
2856
+ /** Filters Dev users based on email addresses. */
2857
+ email?: string[];
2858
+ /**
2859
+ * The maximum number of Dev users to return. The default is '50'.
2860
+ * @format int32
2861
+ */
2862
+ limit?: number;
2863
+ /**
2864
+ * The iteration mode to use, otherwise if not set, then "after" is
2865
+ * used.
2866
+ */
2867
+ mode?: ListMode;
2868
+ /** Fields to sort the Dev users by and the direction to sort them. */
2869
+ sort_by?: string[];
2870
+ /** Filters Dev users based on state. */
2871
+ state?: UserState[];
2872
+ },
2873
+ params: RequestParams = {}
2874
+ ) =>
2875
+ this.request<
2876
+ DevUsersListResponse,
2877
+ | ErrorBadRequest
2878
+ | ErrorUnauthorized
2879
+ | ErrorForbidden
2880
+ | ErrorTooManyRequests
2881
+ | ErrorInternalServerError
2882
+ | ErrorServiceUnavailable
2883
+ >({
2884
+ path: `/dev-users.list`,
2885
+ method: 'GET',
2886
+ query: query,
2887
+ secure: true,
2888
+ format: 'json',
2889
+ ...params,
2890
+ });
2891
+
2892
+ /**
2893
+ * @description Gets the authenticated user's information.
2894
+ *
2895
+ * @tags dev-users
2896
+ * @name DevUsersSelf
2897
+ * @request GET:/dev-users.self
2898
+ * @secure
2899
+ */
2900
+ devUsersSelf = (params: RequestParams = {}) =>
2901
+ this.request<
2902
+ DevUsersSelfResponse,
2903
+ | ErrorBadRequest
2904
+ | ErrorUnauthorized
2905
+ | ErrorForbidden
2906
+ | ErrorTooManyRequests
2907
+ | ErrorInternalServerError
2908
+ | ErrorServiceUnavailable
2909
+ >({
2910
+ path: `/dev-users.self`,
2911
+ method: 'GET',
2912
+ secure: true,
2913
+ format: 'json',
2914
+ ...params,
2915
+ });
2916
+
2917
+ /**
2918
+ * @description Creates new [part](https://devrev.ai/docs/product/parts).
2919
+ *
2920
+ * @tags parts
2921
+ * @name PartsCreate
2922
+ * @request POST:/parts.create
2923
+ * @secure
2924
+ */
2925
+ partsCreate = (data: PartsCreateRequest, params: RequestParams = {}) =>
2926
+ this.request<
2927
+ PartsCreateResponse,
2928
+ | ErrorBadRequest
2929
+ | ErrorUnauthorized
2930
+ | ErrorForbidden
2931
+ | ErrorTooManyRequests
2932
+ | ErrorInternalServerError
2933
+ | ErrorServiceUnavailable
2934
+ >({
2935
+ path: `/parts.create`,
2936
+ method: 'POST',
2937
+ body: data,
2938
+ secure: true,
2939
+ type: ContentType.Json,
2940
+ format: 'json',
2941
+ ...params,
2942
+ });
2943
+
2944
+ /**
2945
+ * @description Deletes a [part](https://devrev.ai/docs/product/parts).
2946
+ *
2947
+ * @tags parts
2948
+ * @name PartsDelete
2949
+ * @request POST:/parts.delete
2950
+ * @secure
2951
+ */
2952
+ partsDelete = (data: PartsDeleteRequest, params: RequestParams = {}) =>
2953
+ this.request<
2954
+ PartsDeleteResponse,
2955
+ | ErrorBadRequest
2956
+ | ErrorUnauthorized
2957
+ | ErrorForbidden
2958
+ | ErrorNotFound
2959
+ | ErrorTooManyRequests
2960
+ | ErrorInternalServerError
2961
+ | ErrorServiceUnavailable
2962
+ >({
2963
+ path: `/parts.delete`,
2964
+ method: 'POST',
2965
+ body: data,
2966
+ secure: true,
2967
+ type: ContentType.Json,
2968
+ format: 'json',
2969
+ ...params,
2970
+ });
2971
+
2972
+ /**
2973
+ * @description Gets a [part's](https://devrev.ai/docs/product/parts) information.
2974
+ *
2975
+ * @tags parts
2976
+ * @name PartsGet
2977
+ * @request GET:/parts.get
2978
+ * @secure
2979
+ */
2980
+ partsGet = (
2981
+ query: {
2982
+ /**
2983
+ * The ID of the part to retrieve.
2984
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
2985
+ */
2986
+ id: string;
2987
+ },
2988
+ params: RequestParams = {}
2989
+ ) =>
2990
+ this.request<
2991
+ PartsGetResponse,
2992
+ | ErrorBadRequest
2993
+ | ErrorUnauthorized
2994
+ | ErrorForbidden
2995
+ | ErrorNotFound
2996
+ | ErrorTooManyRequests
2997
+ | ErrorInternalServerError
2998
+ | ErrorServiceUnavailable
2999
+ >({
3000
+ path: `/parts.get`,
3001
+ method: 'GET',
3002
+ query: query,
3003
+ secure: true,
3004
+ format: 'json',
3005
+ ...params,
3006
+ });
3007
+
3008
+ /**
3009
+ * @description Lists a collection of [parts](https://devrev.ai/docs/product/parts).
3010
+ *
3011
+ * @tags parts
3012
+ * @name PartsList
3013
+ * @request GET:/parts.list
3014
+ * @secure
3015
+ */
3016
+ partsList = (
3017
+ query?: {
3018
+ /**
3019
+ * Filters for parts created by any of these users.
3020
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3021
+ */
3022
+ created_by?: string[];
3023
+ /**
3024
+ * The cursor to resume iteration from. If not provided, then iteration
3025
+ * starts from the beginning.
3026
+ */
3027
+ cursor?: string;
3028
+ /**
3029
+ * The maximum number of parts to return. The default is '50'.
3030
+ * @format int32
3031
+ */
3032
+ limit?: number;
3033
+ /**
3034
+ * The iteration mode to use, otherwise if not set, then "after" is
3035
+ * used.
3036
+ */
3037
+ mode?: ListMode;
3038
+ /** Filters for parts of the provided name(s). */
3039
+ name?: string[];
3040
+ /**
3041
+ * Filters for parts owned by any of these users.
3042
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3043
+ */
3044
+ owned_by?: string[];
3045
+ /** Filters for parts of the provided type(s). */
3046
+ type?: PartType[];
3047
+ },
3048
+ params: RequestParams = {}
3049
+ ) =>
3050
+ this.request<
3051
+ PartsListResponse,
3052
+ | ErrorBadRequest
3053
+ | ErrorUnauthorized
3054
+ | ErrorForbidden
3055
+ | ErrorTooManyRequests
3056
+ | ErrorInternalServerError
3057
+ | ErrorServiceUnavailable
3058
+ >({
3059
+ path: `/parts.list`,
3060
+ method: 'GET',
3061
+ query: query,
3062
+ secure: true,
3063
+ format: 'json',
3064
+ ...params,
3065
+ });
3066
+
3067
+ /**
3068
+ * @description Updates a [part's](https://devrev.ai/docs/product/parts) information.
3069
+ *
3070
+ * @tags parts
3071
+ * @name PartsUpdate
3072
+ * @request POST:/parts.update
3073
+ * @secure
3074
+ */
3075
+ partsUpdate = (data: PartsUpdateRequest, params: RequestParams = {}) =>
3076
+ this.request<
3077
+ PartsUpdateResponse,
3078
+ | ErrorBadRequest
3079
+ | ErrorUnauthorized
3080
+ | ErrorForbidden
3081
+ | ErrorNotFound
3082
+ | ErrorTooManyRequests
3083
+ | ErrorInternalServerError
3084
+ | ErrorServiceUnavailable
3085
+ >({
3086
+ path: `/parts.update`,
3087
+ method: 'POST',
3088
+ body: data,
3089
+ secure: true,
3090
+ type: ContentType.Json,
3091
+ format: 'json',
3092
+ ...params,
3093
+ });
3094
+
3095
+ /**
3096
+ * @description Creates a Rev organization in the authenticated user's Dev organization.
3097
+ *
3098
+ * @tags rev-orgs
3099
+ * @name RevOrgsCreate
3100
+ * @request POST:/rev-orgs.create
3101
+ * @secure
3102
+ */
3103
+ revOrgsCreate = (data: RevOrgsCreateRequest, params: RequestParams = {}) =>
3104
+ this.request<
3105
+ RevOrgsCreateResponse,
3106
+ | ErrorBadRequest
3107
+ | ErrorUnauthorized
3108
+ | ErrorForbidden
3109
+ | ErrorTooManyRequests
3110
+ | ErrorInternalServerError
3111
+ | ErrorServiceUnavailable
3112
+ >({
3113
+ path: `/rev-orgs.create`,
3114
+ method: 'POST',
3115
+ body: data,
3116
+ secure: true,
3117
+ type: ContentType.Json,
3118
+ format: 'json',
3119
+ ...params,
3120
+ });
3121
+
3122
+ /**
3123
+ * @description Deletes the Rev organization.
3124
+ *
3125
+ * @tags rev-orgs
3126
+ * @name RevOrgsDelete
3127
+ * @request POST:/rev-orgs.delete
3128
+ * @secure
3129
+ */
3130
+ revOrgsDelete = (data: RevOrgsDeleteRequest, params: RequestParams = {}) =>
3131
+ this.request<
3132
+ RevOrgsDeleteResponse,
3133
+ | ErrorBadRequest
3134
+ | ErrorUnauthorized
3135
+ | ErrorForbidden
3136
+ | ErrorNotFound
3137
+ | ErrorTooManyRequests
3138
+ | ErrorInternalServerError
3139
+ | ErrorServiceUnavailable
3140
+ >({
3141
+ path: `/rev-orgs.delete`,
3142
+ method: 'POST',
3143
+ body: data,
3144
+ secure: true,
3145
+ type: ContentType.Json,
3146
+ format: 'json',
3147
+ ...params,
3148
+ });
3149
+
3150
+ /**
3151
+ * @description Retrieves the Rev organization's information.
3152
+ *
3153
+ * @tags rev-orgs
3154
+ * @name RevOrgsGet
3155
+ * @request GET:/rev-orgs.get
3156
+ * @secure
3157
+ */
3158
+ revOrgsGet = (
3159
+ query: {
3160
+ /**
3161
+ * The ID of the required Rev organization.
3162
+ * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
3163
+ */
3164
+ id: string;
3165
+ },
3166
+ params: RequestParams = {}
3167
+ ) =>
3168
+ this.request<
3169
+ RevOrgsGetResponse,
3170
+ | ErrorBadRequest
3171
+ | ErrorUnauthorized
3172
+ | ErrorForbidden
3173
+ | ErrorNotFound
3174
+ | ErrorTooManyRequests
3175
+ | ErrorInternalServerError
3176
+ | ErrorServiceUnavailable
3177
+ >({
3178
+ path: `/rev-orgs.get`,
3179
+ method: 'GET',
3180
+ query: query,
3181
+ secure: true,
3182
+ format: 'json',
3183
+ ...params,
3184
+ });
3185
+
3186
+ /**
3187
+ * @description Gets the list of Rev organizations' information belonging to the authenticated user's Dev Organization which the user is also authorized to access.
3188
+ *
3189
+ * @tags rev-orgs
3190
+ * @name RevOrgsList
3191
+ * @request GET:/rev-orgs.list
3192
+ * @secure
3193
+ */
3194
+ revOrgsList = (
3195
+ query?: {
3196
+ /** Filters by creator. */
3197
+ created_by?: string[];
3198
+ /**
3199
+ * Filters for objects created after the provided timestamp (inclusive).
3200
+ * @format date-time
3201
+ */
3202
+ 'created_date.after'?: string;
3203
+ /**
3204
+ * Filters for objects created before the provided timestamp
3205
+ * (inclusive).
3206
+ * @format date-time
3207
+ */
3208
+ 'created_date.before'?: string;
3209
+ /**
3210
+ * The cursor to resume iteration from. If not provided, then iteration
3211
+ * starts from the beginning.
3212
+ */
3213
+ cursor?: string;
3214
+ /**
3215
+ * The maximum number of Rev organizations to be retrieved per page.
3216
+ * @format int32
3217
+ */
3218
+ limit?: number;
3219
+ /**
3220
+ * The iteration mode to use, otherwise if not set, then "after" is
3221
+ * used.
3222
+ */
3223
+ mode?: ListMode;
3224
+ /**
3225
+ * Filters for objects created after the provided timestamp (inclusive).
3226
+ * @format date-time
3227
+ */
3228
+ 'modified_date.after'?: string;
3229
+ /**
3230
+ * Filters for objects created before the provided timestamp
3231
+ * (inclusive).
3232
+ * @format date-time
3233
+ */
3234
+ 'modified_date.before'?: string;
3235
+ /**
3236
+ * Fields to sort the Rev organizations by and the direction to sort
3237
+ * them.
3238
+ */
3239
+ sort_by?: string[];
3240
+ },
3241
+ params: RequestParams = {}
3242
+ ) =>
3243
+ this.request<
3244
+ RevOrgsListResponse,
3245
+ | ErrorBadRequest
3246
+ | ErrorUnauthorized
3247
+ | ErrorForbidden
3248
+ | ErrorNotFound
3249
+ | ErrorTooManyRequests
3250
+ | ErrorInternalServerError
3251
+ | ErrorServiceUnavailable
3252
+ >({
3253
+ path: `/rev-orgs.list`,
3254
+ method: 'GET',
3255
+ query: query,
3256
+ secure: true,
3257
+ format: 'json',
3258
+ ...params,
3259
+ });
3260
+
3261
+ /**
3262
+ * @description Updates the Rev organization's information.
3263
+ *
3264
+ * @tags rev-orgs
3265
+ * @name RevOrgsUpdate
3266
+ * @request POST:/rev-orgs.update
3267
+ * @secure
3268
+ */
3269
+ revOrgsUpdate = (data: RevOrgsUpdateRequest, params: RequestParams = {}) =>
3270
+ this.request<
3271
+ RevOrgsUpdateResponse,
3272
+ | ErrorBadRequest
3273
+ | ErrorUnauthorized
3274
+ | ErrorForbidden
3275
+ | ErrorNotFound
3276
+ | ErrorTooManyRequests
3277
+ | ErrorInternalServerError
3278
+ | ErrorServiceUnavailable
3279
+ >({
3280
+ path: `/rev-orgs.update`,
3281
+ method: 'POST',
3282
+ body: data,
3283
+ secure: true,
3284
+ type: ContentType.Json,
3285
+ format: 'json',
3286
+ ...params,
3287
+ });
3288
+
3289
+ /**
3290
+ * @description Creates a new tag, which is used to create associations between objects and a logical concept denoted by the tag's name.
3291
+ *
3292
+ * @tags tags
3293
+ * @name TagsCreate
3294
+ * @request POST:/tags.create
3295
+ * @secure
3296
+ */
3297
+ tagsCreate = (data: TagsCreateRequest, params: RequestParams = {}) =>
3298
+ this.request<
3299
+ TagsCreateResponse,
3300
+ | ErrorBadRequest
3301
+ | ErrorUnauthorized
3302
+ | ErrorForbidden
3303
+ | ErrorTooManyRequests
3304
+ | ErrorInternalServerError
3305
+ | ErrorServiceUnavailable
3306
+ >({
3307
+ path: `/tags.create`,
3308
+ method: 'POST',
3309
+ body: data,
3310
+ secure: true,
3311
+ type: ContentType.Json,
3312
+ format: 'json',
3313
+ ...params,
3314
+ });
3315
+
3316
+ /**
3317
+ * @description Deletes a tag.
3318
+ *
3319
+ * @tags tags
3320
+ * @name TagsDelete
3321
+ * @request POST:/tags.delete
3322
+ * @secure
3323
+ */
3324
+ tagsDelete = (data: TagsDeleteRequest, params: RequestParams = {}) =>
3325
+ this.request<
3326
+ TagsDeleteResponse,
3327
+ | ErrorBadRequest
3328
+ | ErrorUnauthorized
3329
+ | ErrorForbidden
3330
+ | ErrorNotFound
3331
+ | ErrorTooManyRequests
3332
+ | ErrorInternalServerError
3333
+ | ErrorServiceUnavailable
3334
+ >({
3335
+ path: `/tags.delete`,
3336
+ method: 'POST',
3337
+ body: data,
3338
+ secure: true,
3339
+ type: ContentType.Json,
3340
+ format: 'json',
3341
+ ...params,
3342
+ });
3343
+
3344
+ /**
3345
+ * @description Gets a tag's information.
3346
+ *
3347
+ * @tags tags
3348
+ * @name TagsGet
3349
+ * @request GET:/tags.get
3350
+ * @secure
3351
+ */
3352
+ tagsGet = (
3353
+ query: {
3354
+ /**
3355
+ * The requested tag's ID.
3356
+ * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
3357
+ */
3358
+ id: string;
3359
+ },
3360
+ params: RequestParams = {}
3361
+ ) =>
3362
+ this.request<
3363
+ TagsGetResponse,
3364
+ | ErrorBadRequest
3365
+ | ErrorUnauthorized
3366
+ | ErrorForbidden
3367
+ | ErrorNotFound
3368
+ | ErrorTooManyRequests
3369
+ | ErrorInternalServerError
3370
+ | ErrorServiceUnavailable
3371
+ >({
3372
+ path: `/tags.get`,
3373
+ method: 'GET',
3374
+ query: query,
3375
+ secure: true,
3376
+ format: 'json',
3377
+ ...params,
3378
+ });
3379
+
3380
+ /**
3381
+ * @description Lists the available tags.
3382
+ *
3383
+ * @tags tags
3384
+ * @name TagsList
3385
+ * @request GET:/tags.list
3386
+ * @secure
3387
+ */
3388
+ tagsList = (
3389
+ query?: {
3390
+ /**
3391
+ * The cursor to resume iteration from. If not provided, then iteration
3392
+ * starts from the beginning.
3393
+ */
3394
+ cursor?: string;
3395
+ /**
3396
+ * The maximum number of tags to return. The default is '50'.
3397
+ * @format int32
3398
+ */
3399
+ limit?: number;
3400
+ /**
3401
+ * The iteration mode to use, otherwise if not set, then "after" is
3402
+ * used.
3403
+ */
3404
+ mode?: ListMode;
3405
+ },
3406
+ params: RequestParams = {}
3407
+ ) =>
3408
+ this.request<
3409
+ TagsListResponse,
3410
+ | ErrorBadRequest
3411
+ | ErrorUnauthorized
3412
+ | ErrorForbidden
3413
+ | ErrorTooManyRequests
3414
+ | ErrorInternalServerError
3415
+ | ErrorServiceUnavailable
3416
+ >({
3417
+ path: `/tags.list`,
3418
+ method: 'GET',
3419
+ query: query,
3420
+ secure: true,
3421
+ format: 'json',
3422
+ ...params,
3423
+ });
3424
+
3425
+ /**
3426
+ * @description Updates a tag's information.
3427
+ *
3428
+ * @tags tags
3429
+ * @name TagsUpdate
3430
+ * @request POST:/tags.update
3431
+ * @secure
3432
+ */
3433
+ tagsUpdate = (data: TagsUpdateRequest, params: RequestParams = {}) =>
3434
+ this.request<
3435
+ TagsUpdateResponse,
3436
+ | ErrorBadRequest
3437
+ | ErrorUnauthorized
3438
+ | ErrorForbidden
3439
+ | ErrorNotFound
3440
+ | ErrorTooManyRequests
3441
+ | ErrorInternalServerError
3442
+ | ErrorServiceUnavailable
3443
+ >({
3444
+ path: `/tags.update`,
3445
+ method: 'POST',
3446
+ body: data,
3447
+ secure: true,
3448
+ type: ContentType.Json,
3449
+ format: 'json',
3450
+ ...params,
3451
+ });
3452
+
3453
+ /**
3454
+ * @description Creates a new entry on an object's timeline.
3455
+ *
3456
+ * @tags timeline-entries
3457
+ * @name TimelineEntriesCreate
3458
+ * @request POST:/timeline-entries.create
3459
+ * @secure
3460
+ */
3461
+ timelineEntriesCreate = (
3462
+ data: TimelineEntriesCreateRequest,
3463
+ params: RequestParams = {}
3464
+ ) =>
3465
+ this.request<
3466
+ TimelineEntriesCreateResponse,
3467
+ | ErrorBadRequest
3468
+ | ErrorUnauthorized
3469
+ | ErrorForbidden
3470
+ | ErrorTooManyRequests
3471
+ | ErrorInternalServerError
3472
+ | ErrorServiceUnavailable
3473
+ >({
3474
+ path: `/timeline-entries.create`,
3475
+ method: 'POST',
3476
+ body: data,
3477
+ secure: true,
3478
+ type: ContentType.Json,
3479
+ format: 'json',
3480
+ ...params,
3481
+ });
3482
+
3483
+ /**
3484
+ * @description Gets an entry on an object's timeline.
3485
+ *
3486
+ * @tags timeline-entries
3487
+ * @name TimelineEntriesGet
3488
+ * @request GET:/timeline-entries.get
3489
+ * @secure
3490
+ */
3491
+ timelineEntriesGet = (
3492
+ query: {
3493
+ /** The ID of the timeline entry to get. */
3494
+ id: string;
3495
+ },
3496
+ params: RequestParams = {}
3497
+ ) =>
3498
+ this.request<
3499
+ TimelineEntriesGetResponse,
3500
+ | ErrorBadRequest
3501
+ | ErrorUnauthorized
3502
+ | ErrorForbidden
3503
+ | ErrorNotFound
3504
+ | ErrorTooManyRequests
3505
+ | ErrorInternalServerError
3506
+ | ErrorServiceUnavailable
3507
+ >({
3508
+ path: `/timeline-entries.get`,
3509
+ method: 'GET',
3510
+ query: query,
3511
+ secure: true,
3512
+ format: 'json',
3513
+ ...params,
3514
+ });
3515
+
3516
+ /**
3517
+ * @description Lists the timeline entries for an object.
3518
+ *
3519
+ * @tags timeline-entries
3520
+ * @name TimelineEntriesList
3521
+ * @request GET:/timeline-entries.list
3522
+ * @secure
3523
+ */
3524
+ timelineEntriesList = (
3525
+ query: {
3526
+ /**
3527
+ * The ID of the object to list timeline entries for.
3528
+ * @example "don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"
3529
+ */
3530
+ object: string;
3531
+ /**
3532
+ * The cursor to resume iteration from. If not provided, then iteration
3533
+ * starts from the beginning.
3534
+ */
3535
+ cursor?: string;
3536
+ /**
3537
+ * The maximum number of entries to return. If not set, then this
3538
+ * defaults to `50`.
3539
+ * @format int32
3540
+ */
3541
+ limit?: number;
3542
+ /**
3543
+ * The iteration mode to use, otherwise if not set, then "after" is
3544
+ * used.
3545
+ */
3546
+ mode?: ListMode;
3547
+ },
3548
+ params: RequestParams = {}
3549
+ ) =>
3550
+ this.request<
3551
+ TimelineEntriesListResponse,
3552
+ | ErrorBadRequest
3553
+ | ErrorUnauthorized
3554
+ | ErrorForbidden
3555
+ | ErrorNotFound
3556
+ | ErrorTooManyRequests
3557
+ | ErrorInternalServerError
3558
+ | ErrorServiceUnavailable
3559
+ >({
3560
+ path: `/timeline-entries.list`,
3561
+ method: 'GET',
3562
+ query: query,
3563
+ secure: true,
3564
+ format: 'json',
3565
+ ...params,
3566
+ });
3567
+
3568
+ /**
3569
+ * @description Updates an entry on an object's timeline.
3570
+ *
3571
+ * @tags timeline-entries
3572
+ * @name TimelineEntriesUpdate
3573
+ * @request POST:/timeline-entries.update
3574
+ * @secure
3575
+ */
3576
+ timelineEntriesUpdate = (
3577
+ data: TimelineEntriesUpdateRequest,
3578
+ params: RequestParams = {}
3579
+ ) =>
3580
+ this.request<
3581
+ TimelineEntriesUpdateResponse,
3582
+ | ErrorBadRequest
3583
+ | ErrorUnauthorized
3584
+ | ErrorForbidden
3585
+ | ErrorTooManyRequests
3586
+ | ErrorInternalServerError
3587
+ | ErrorServiceUnavailable
3588
+ >({
3589
+ path: `/timeline-entries.update`,
3590
+ method: 'POST',
3591
+ body: data,
3592
+ secure: true,
3593
+ type: ContentType.Json,
3594
+ format: 'json',
3595
+ ...params,
3596
+ });
3597
+
3598
+ /**
3599
+ * @description Creates a new webhook target.
3600
+ *
3601
+ * @tags webhooks
3602
+ * @name WebhooksCreate
3603
+ * @request POST:/webhooks.create
3604
+ * @secure
3605
+ */
3606
+ webhooksCreate = (data: WebhooksCreateRequest, params: RequestParams = {}) =>
3607
+ this.request<
3608
+ WebhooksCreateResponse,
3609
+ | ErrorBadRequest
3610
+ | ErrorUnauthorized
3611
+ | ErrorForbidden
3612
+ | ErrorTooManyRequests
3613
+ | ErrorInternalServerError
3614
+ | ErrorServiceUnavailable
3615
+ >({
3616
+ path: `/webhooks.create`,
3617
+ method: 'POST',
3618
+ body: data,
3619
+ secure: true,
3620
+ type: ContentType.Json,
3621
+ format: 'json',
3622
+ ...params,
3623
+ });
3624
+
3625
+ /**
3626
+ * @description Deletes the requested webhook.
3627
+ *
3628
+ * @tags webhooks
3629
+ * @name WebhooksDelete
3630
+ * @request POST:/webhooks.delete
3631
+ * @secure
3632
+ */
3633
+ webhooksDelete = (data: WebhooksDeleteRequest, params: RequestParams = {}) =>
3634
+ this.request<
3635
+ WebhooksDeleteResponse,
3636
+ | ErrorBadRequest
3637
+ | ErrorUnauthorized
3638
+ | ErrorForbidden
3639
+ | ErrorNotFound
3640
+ | ErrorTooManyRequests
3641
+ | ErrorInternalServerError
3642
+ | ErrorServiceUnavailable
3643
+ >({
3644
+ path: `/webhooks.delete`,
3645
+ method: 'POST',
3646
+ body: data,
3647
+ secure: true,
3648
+ type: ContentType.Json,
3649
+ format: 'json',
3650
+ ...params,
3651
+ });
3652
+
3653
+ /**
3654
+ * @description Gets the requested webhook's information.
3655
+ *
3656
+ * @tags webhooks
3657
+ * @name WebhooksGet
3658
+ * @request GET:/webhooks.get
3659
+ * @secure
3660
+ */
3661
+ webhooksGet = (
3662
+ query: {
3663
+ /**
3664
+ * ID for the webhook.
3665
+ * @example "don:<partition>:integration:devo/<dev-org-id>:webhook/<webhook-id>"
3666
+ */
3667
+ id: string;
3668
+ },
3669
+ params: RequestParams = {}
3670
+ ) =>
3671
+ this.request<
3672
+ WebhooksGetResponse,
3673
+ | ErrorBadRequest
3674
+ | ErrorUnauthorized
3675
+ | ErrorForbidden
3676
+ | ErrorNotFound
3677
+ | ErrorTooManyRequests
3678
+ | ErrorInternalServerError
3679
+ | ErrorServiceUnavailable
3680
+ >({
3681
+ path: `/webhooks.get`,
3682
+ method: 'GET',
3683
+ query: query,
3684
+ secure: true,
3685
+ format: 'json',
3686
+ ...params,
3687
+ });
3688
+
3689
+ /**
3690
+ * @description Lists the webhooks.
3691
+ *
3692
+ * @tags webhooks
3693
+ * @name WebhooksList
3694
+ * @request GET:/webhooks.list
3695
+ * @secure
3696
+ */
3697
+ webhooksList = (params: RequestParams = {}) =>
3698
+ this.request<
3699
+ WebhooksListResponse,
3700
+ | ErrorBadRequest
3701
+ | ErrorUnauthorized
3702
+ | ErrorForbidden
3703
+ | ErrorTooManyRequests
3704
+ | ErrorInternalServerError
3705
+ | ErrorServiceUnavailable
3706
+ >({
3707
+ path: `/webhooks.list`,
3708
+ method: 'GET',
3709
+ secure: true,
3710
+ format: 'json',
3711
+ ...params,
3712
+ });
3713
+
3714
+ /**
3715
+ * @description Updates the requested webhook.
3716
+ *
3717
+ * @tags webhooks
3718
+ * @name WebhooksUpdate
3719
+ * @request POST:/webhooks.update
3720
+ * @secure
3721
+ */
3722
+ webhooksUpdate = (data: WebhooksUpdateRequest, params: RequestParams = {}) =>
3723
+ this.request<
3724
+ WebhooksUpdateResponse,
3725
+ | ErrorBadRequest
3726
+ | ErrorUnauthorized
3727
+ | ErrorForbidden
3728
+ | ErrorNotFound
3729
+ | ErrorTooManyRequests
3730
+ | ErrorInternalServerError
3731
+ | ErrorServiceUnavailable
3732
+ >({
3733
+ path: `/webhooks.update`,
3734
+ method: 'POST',
3735
+ body: data,
3736
+ secure: true,
3737
+ type: ContentType.Json,
3738
+ format: 'json',
3739
+ ...params,
3740
+ });
3741
+
3742
+ /**
3743
+ * @description Creates new work ([issue](https://devrev.ai/docs/product/build), [ticket](https://devrev.ai/docs/product/support)) item.
3744
+ *
3745
+ * @tags works
3746
+ * @name WorksCreate
3747
+ * @request POST:/works.create
3748
+ * @secure
3749
+ */
3750
+ worksCreate = (data: WorksCreateRequest, params: RequestParams = {}) =>
3751
+ this.request<
3752
+ WorksCreateResponse,
3753
+ | ErrorBadRequest
3754
+ | ErrorUnauthorized
3755
+ | ErrorForbidden
3756
+ | ErrorTooManyRequests
3757
+ | ErrorInternalServerError
3758
+ | ErrorServiceUnavailable
3759
+ >({
3760
+ path: `/works.create`,
3761
+ method: 'POST',
3762
+ body: data,
3763
+ secure: true,
3764
+ type: ContentType.Json,
3765
+ format: 'json',
3766
+ ...params,
3767
+ });
3768
+
3769
+ /**
3770
+ * @description Deletes a work item.
3771
+ *
3772
+ * @tags works
3773
+ * @name WorksDelete
3774
+ * @request POST:/works.delete
3775
+ * @secure
3776
+ */
3777
+ worksDelete = (data: WorksDeleteRequest, params: RequestParams = {}) =>
3778
+ this.request<
3779
+ WorksDeleteResponse,
3780
+ | ErrorBadRequest
3781
+ | ErrorUnauthorized
3782
+ | ErrorForbidden
3783
+ | ErrorNotFound
3784
+ | ErrorTooManyRequests
3785
+ | ErrorInternalServerError
3786
+ | ErrorServiceUnavailable
3787
+ >({
3788
+ path: `/works.delete`,
3789
+ method: 'POST',
3790
+ body: data,
3791
+ secure: true,
3792
+ type: ContentType.Json,
3793
+ format: 'json',
3794
+ ...params,
3795
+ });
3796
+
3797
+ /**
3798
+ * @description Exports a collection of work items.
3799
+ *
3800
+ * @tags works
3801
+ * @name WorksExport
3802
+ * @request GET:/works.export
3803
+ * @secure
3804
+ */
3805
+ worksExport = (
3806
+ query?: {
3807
+ /**
3808
+ * Filters for work belonging to any of the provided parts.
3809
+ * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
3810
+ */
3811
+ applies_to_part?: string[];
3812
+ /**
3813
+ * Filters for work created by any of these users.
3814
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3815
+ */
3816
+ created_by?: string[];
3817
+ /**
3818
+ * The number of work items to return. The default is '50', the maximum
3819
+ * is '5000'.
3820
+ * @format int32
3821
+ */
3822
+ first?: number;
3823
+ /** Filters for issues with any of the provided priorities. */
3824
+ 'issue.priority'?: IssuePriority[];
3825
+ /**
3826
+ * Filters for issues with any of the provided Rev organizations.
3827
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
3828
+ */
3829
+ 'issue.rev_orgs'?: string[];
3830
+ /**
3831
+ * Filters for work owned by any of these users.
3832
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3833
+ */
3834
+ owned_by?: string[];
3835
+ /** Filters for records in the provided stage(s). */
3836
+ 'stage.name'?: string[];
3837
+ /**
3838
+ * Filters for tickets that are associated with any of the provided Rev
3839
+ * organizations.
3840
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
3841
+ */
3842
+ 'ticket.rev_org'?: string[];
3843
+ /** Filters for tickets with any of the provided severities. */
3844
+ 'ticket.severity'?: TicketSeverity[];
3845
+ /** Filters for work of the provided types. */
3846
+ type?: WorkType[];
3847
+ },
3848
+ params: RequestParams = {}
3849
+ ) =>
3850
+ this.request<
3851
+ WorksExportResponse,
3852
+ | ErrorBadRequest
3853
+ | ErrorUnauthorized
3854
+ | ErrorForbidden
3855
+ | ErrorTooManyRequests
3856
+ | ErrorInternalServerError
3857
+ | ErrorServiceUnavailable
3858
+ >({
3859
+ path: `/works.export`,
3860
+ method: 'GET',
3861
+ query: query,
3862
+ secure: true,
3863
+ format: 'json',
3864
+ ...params,
3865
+ });
3866
+
3867
+ /**
3868
+ * @description Gets a work item's information.
3869
+ *
3870
+ * @tags works
3871
+ * @name WorksGet
3872
+ * @request GET:/works.get
3873
+ * @secure
3874
+ */
3875
+ worksGet = (
3876
+ query: {
3877
+ /**
3878
+ * The work's ID.
3879
+ * @example "don:<partition>:core:devo/<dev-org-id>:<work-type>/<work-id>"
3880
+ */
3881
+ id: string;
3882
+ },
3883
+ params: RequestParams = {}
3884
+ ) =>
3885
+ this.request<
3886
+ WorksGetResponse,
3887
+ | ErrorBadRequest
3888
+ | ErrorUnauthorized
3889
+ | ErrorForbidden
3890
+ | ErrorNotFound
3891
+ | ErrorTooManyRequests
3892
+ | ErrorInternalServerError
3893
+ | ErrorServiceUnavailable
3894
+ >({
3895
+ path: `/works.get`,
3896
+ method: 'GET',
3897
+ query: query,
3898
+ secure: true,
3899
+ format: 'json',
3900
+ ...params,
3901
+ });
3902
+
3903
+ /**
3904
+ * @description Lists a collection of work items.
3905
+ *
3906
+ * @tags works
3907
+ * @name WorksList
3908
+ * @request GET:/works.list
3909
+ * @secure
3910
+ */
3911
+ worksList = (
3912
+ query?: {
3913
+ /**
3914
+ * Filters for work belonging to any of the provided parts.
3915
+ * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
3916
+ */
3917
+ applies_to_part?: string[];
3918
+ /**
3919
+ * Filters for work created by any of these users.
3920
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3921
+ */
3922
+ created_by?: string[];
3923
+ /**
3924
+ * The cursor to resume iteration from. If not provided, then iteration
3925
+ * starts from the beginning.
3926
+ */
3927
+ cursor?: string;
3928
+ /** Filters for issues with any of the provided priorities. */
3929
+ 'issue.priority'?: IssuePriority[];
3930
+ /**
3931
+ * Filters for issues with any of the provided Rev organizations.
3932
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
3933
+ */
3934
+ 'issue.rev_orgs'?: string[];
3935
+ /**
3936
+ * The maximum number of works to return. The default is '50'.
3937
+ * @format int32
3938
+ */
3939
+ limit?: number;
3940
+ /**
3941
+ * The iteration mode to use, otherwise if not set, then "after" is
3942
+ * used.
3943
+ */
3944
+ mode?: ListMode;
3945
+ /**
3946
+ * Filters for work owned by any of these users.
3947
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
3948
+ */
3949
+ owned_by?: string[];
3950
+ /** Filters for records in the provided stage(s). */
3951
+ 'stage.name'?: string[];
3952
+ /**
3953
+ * Filters for tickets that are associated with any of the provided Rev
3954
+ * organizations.
3955
+ * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
3956
+ */
3957
+ 'ticket.rev_org'?: string[];
3958
+ /** Filters for tickets with any of the provided severities. */
3959
+ 'ticket.severity'?: TicketSeverity[];
3960
+ /** Filters for work of the provided types. */
3961
+ type?: WorkType[];
3962
+ },
3963
+ params: RequestParams = {}
3964
+ ) =>
3965
+ this.request<
3966
+ WorksListResponse,
3967
+ | ErrorBadRequest
3968
+ | ErrorUnauthorized
3969
+ | ErrorForbidden
3970
+ | ErrorTooManyRequests
3971
+ | ErrorInternalServerError
3972
+ | ErrorServiceUnavailable
3973
+ >({
3974
+ path: `/works.list`,
3975
+ method: 'GET',
3976
+ query: query,
3977
+ secure: true,
3978
+ format: 'json',
3979
+ ...params,
3980
+ });
3981
+
3982
+ /**
3983
+ * @description Updates a work item's information.
3984
+ *
3985
+ * @tags works
3986
+ * @name WorksUpdate
3987
+ * @request POST:/works.update
3988
+ * @secure
3989
+ */
3990
+ worksUpdate = (data: WorksUpdateRequest, params: RequestParams = {}) =>
3991
+ this.request<
3992
+ WorksUpdateResponse,
3993
+ | ErrorBadRequest
3994
+ | ErrorUnauthorized
3995
+ | ErrorForbidden
3996
+ | ErrorNotFound
3997
+ | ErrorTooManyRequests
3998
+ | ErrorInternalServerError
3999
+ | ErrorServiceUnavailable
4000
+ >({
4001
+ path: `/works.update`,
4002
+ method: 'POST',
4003
+ body: data,
4004
+ secure: true,
4005
+ type: ContentType.Json,
4006
+ format: 'json',
4007
+ ...params,
4008
+ });
4009
+ }