Repository navigation
Expand file tree
/
Copy pathopenapi.client.pas
More file actions
2044 lines (1834 loc) · 71.9 KB
/
Copy pathopenapi.client.pas
File metadata and controls
2044 lines (1834 loc) · 71.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Client unit for Redmine API
// - Redmine exposes some of its data through a REST API. This API provides
// access and basic CRUD operations (create, update, delete) for the resources
// described below. The API supports both XML and JSON formats.
// - version 3.5
unit openapi.client;
{$I mormot.defines.inc}
interface
{
----------------------------------------------------------------------
REDMINE API client as TOpenapiClient class
Generated 29 Apr 2025 by via mopenapi - DO NOT MODIFY BY HAND!
----------------------------------------------------------------------
}
uses
classes,
sysutils,
mormot.core.base,
mormot.core.unicode,
mormot.core.text,
mormot.core.buffers,
mormot.core.datetime,
mormot.core.rtti,
mormot.core.json,
mormot.core.variants,
mormot.net.client,
openapi.dto;
type
{ ************ Custom Exceptions }
// exception raised on (401)
ENotAuthorized = class(EJsonClient)
protected
fError: TNotAuthorized;
public
constructor CreateResp(const Format: RawUtf8; const Args: array of const;
const Resp: TJsonResponse); override;
property Error: TNotAuthorized
read fError;
end;
// exception raised on (404)
EResNotFound = class(EJsonClient)
protected
fError: TResNotFound;
public
constructor CreateResp(const Format: RawUtf8; const Args: array of const;
const Resp: TJsonResponse); override;
property Error: TResNotFound
read fError;
end;
// exception raised on (default)
EUnknownError = class(EJsonClient)
protected
fError: TUnknownError;
public
constructor CreateResp(const Format: RawUtf8; const Args: array of const;
const Resp: TJsonResponse); override;
property Error: TUnknownError
read fError;
end;
// exception raised on (422)
EValidationError = class(EJsonClient)
protected
fError: TValidationError;
public
constructor CreateResp(const Format: RawUtf8; const Args: array of const;
const Resp: TJsonResponse); override;
property Error: TValidationError
read fError;
end;
// exception raised on (403)
EForbidden = class(EJsonClient)
protected
fError: TForbidden;
public
constructor CreateResp(const Format: RawUtf8; const Args: array of const;
const Resp: TJsonResponse); override;
property Error: TForbidden
read fError;
end;
{ ************ Main TOpenapiClient Class }
// Client class for Redmine API
// - Redmine exposes some of its data through a REST API. This API provides
// access and basic CRUD operations (create, update, delete) for the resources
// described below. The API supports both XML and JSON formats.
TOpenapiClient = class
private
fClient: IJsonClient;
// TOnJsonClientError event handlers
procedure OnError1(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError2(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError3(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError4(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError5(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError6(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError7(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError8(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
procedure OnError9(const Sender: IJsonClient;
const Response: TJsonResponse; const ErrorMsg: shortstring);
public
// initialize this Client with an associated HTTP/JSON request
constructor Create(const aClient: IJsonClient);
// ---------------------
// REDMINE API METHODS
// ---------------------
// Search [get] /search.{format}
//
// Summary: Returns the search results by the specified condition parameters
//
// Params:
// - [path] Format (required): json or xml
// - [query] Offset: the offset of the first object to retrieve
// - [query] Limit: number of issues per page (optional)
// - [query] Q: query strings. enable to specify multiple values separated by
// a space ' '
// - [query] Scope: search scope condition
// - [query] AllWords: matched all query strings or not
// - [query] TitlesOnly: matched only title or not
// - [query] Issues: include Issues or not
// - [query] News: include News or not
// - [query] Documents: include Documents or not
// - [query] Changesets: include Changesets or not
// - [query] WikiPages: include Wiki Pages or not
// - [query] Messages: include Messages or not
// - [query] Projects: include Projects or not
// - [query] OpenIssues: filtered by open issues
// - [query] Attachments: filtered by description and attachment
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function Search(const Format: TEnumOpenapi11; Offset: integer = 0; Limit: integer = 0;
const Q: string = ''; const Scope: TEnumOpenapi20 = eo20None; AllWords: integer = 0;
TitlesOnly: integer = 0; Issues: integer = 0; News: integer = 0;
Documents: integer = 0; Changesets: integer = 0; WikiPages: integer = 0;
Messages: integer = 0; Projects: integer = 0; OpenIssues: integer = 0;
Attachments: integer = 0): TDtoOpenapi38;
// ----------------
// ISSUES METHODS
// ----------------
// IssuesList [get] /issues.{format}
//
// Summary: Listing issues
// Description:
// Returns a paginated list of issues. By default, it returns open issues only.
// NB: operators containing ">", "<" or "=" should be hex-encoded so they're parsed correctly. Most evolved API clients will do that for you by default, but for the sake of clarity the following examples have been written with no such magic feature in mind.
//
// Params:
// - [path] Format (required): json or xml
// - [query] Offset: the offset of the first object to retrieve
// - [query] Limit: number of issues per page (optional)
// - [query] Sort: column to sort with. Append :desc to invert the order.
// - [query] Include: fetch associated data (optional, use comma to fetch multiple
// associations). Possible values:
// - [query] IssueId: get issue with the given id or multiple issues by id using
// ',' to separate id
// - [query] ProjectId: get issues from the project with the given id (a numeric
// value, not a project identifier).
// - [query] SubprojectId: get issues from the subproject with the given id. You
// can use project_id=XXX&subproject_id=!* to get only the issues of a given project
// and none of its subprojects.
// - [query] TrackerId: get issues from the tracker with the given id
// - [query] QueryId: you can get the corresponding issue list using
// - [query] StatusId: get issues with the given status id only. Possible values:
// open, closed, * to get open and closed issues, status id
// - [query] AssignedToId: get issues which are assigned to the given user id.
// me can be used instead an ID to fetch all issues from the logged in user (via
// API key or HTTP auth)
// - [query] ParentId: get issues whose parent issue is given id
// - [query] CfX: get issues with the given value for custom field with an ID
// of x. (Custom field must have 'used as a filter' checked.)
// - [query] AuthorId
// - [query] WatcherId
// - [query] ChildId
// - [query] MemberOfGroup
// - [query] AssignedToRole
// - [query] FixedVersionId
// - [query] CategoryId
// - [query] Subject: may use ~ before string value
// - [query] Description: may use ~ before string value
// - [query] Notes: may use ~ before string value
// - [query] ClosedOn: may use ~ before string value
// - [query] StartDate
// - [query] DueDate
// - [query] EstimatedHours
// - [query] SpentTime
// - [query] DoneRatio
// - [query] IsPrivate
// - [query] Attachment: may has ~ at the beginning. Search into field 'filename'
// attachments
// - [query] AttachmentDescription: may has ~ at the beginning. Search into field
// 'description' attachments
// - [query] UpdatedBy: id an user which has made changes in journal
// - [query] LastUpdatedBy: id a last user which has made changes in journal
// - [query] RelationType: array of string through comma
// - [query] CreatedOn: To fetch issues for a date range
// - [query] UpdatedOn: To fetch issues updated after a certain timestamp
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function IssuesList(const Format: TEnumOpenapi11; const StatusId: variant;
const AssignedToId: variant; Offset: integer = 0; Limit: integer = 0;
const Sort: TStringDynArray = nil; const Include: TEnumOpenapi12Set = [];
const IssueId: TIntegerDynArray = nil; ProjectId: integer = 0; const SubprojectId: TEnumOpenapi13 = eo13None;
TrackerId: integer = 0; QueryId: integer = 0; ParentId: integer = 0;
const Cf_id:Integer=0;const CfX: string = ''; AuthorId: integer = 0; WatcherId: integer = 0;
ChildId: integer = 0; MemberOfGroup: integer = 0; AssignedToRole: integer = 0;
FixedVersionId: integer = 0; CategoryId: integer = 0; const Subject: string = '';
const Description: string = ''; const Notes: string = ''; const ClosedOn: string = '';
const StartDate: string = ''; const DueDate: string = ''; EstimatedHours: double = 0;
SpentTime: double = 0; DoneRatio: double = 0; IsPrivate: boolean = false;
const Attachment: string = ''; const AttachmentDescription: string = '';
UpdatedBy: integer = 0; LastUpdatedBy: integer = 0; const RelationType: string = '';
const CreatedOn: string = ''; const UpdatedOn: string = ''): TIssueList;
// IssueCreate [post] /issues.{format}
//
// Summary: Creating an issue
// Description:
// Creating a new issue
//
// Params:
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): Created: issue was created
// - 401 [ENotAuthorized]
// - 422 [EValidationError]
procedure IssueCreate(const Format: TEnumOpenapi11; const Payload: TIssueNew);
// IssueShow [get] /issues/{issue_id}.{format}
//
// Summary: Showing an issue
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
// - [query] Include: fetch associated data (optional, use comma to fetch multiple
// associations). Possible values:
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function IssueShow(IssueId: integer; const Format: TEnumOpenapi11; const Include: TEnumOpenapi14Set = []): TIssueShow;
// IssueUpdate [put] /issues/{issue_id}.{format}
//
// Summary: Updating an issue
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 422 [EValidationError]
procedure IssueUpdate(IssueId: integer; const Format: TEnumOpenapi11; const Payload: TIssueUpdate);
// IssueDelete [delete] /issues/{issue_id}.{format}
//
// Summary: Deleting an issue
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
procedure IssueDelete(IssueId: integer; const Format: TEnumOpenapi11);
// WatcherAdd [post] /issues/{issue_id}/watchers.{format}
//
// Summary: Adding a watcher
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
procedure WatcherAdd(IssueId: integer; const Format: TEnumOpenapi11; const Payload: TWatcherAdd);
// WatcherDelete [delete] /issues/{issue_id}/watchers/{user_id}.{format}
//
// Summary: Removing a watcher
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] UserId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
procedure WatcherDelete(IssueId: integer; const UserId: variant; const Format: TEnumOpenapi11);
// ------------------
// RELATION METHODS
// ------------------
// RelationList [get] /issues/{issue_id}/relations.{format}
//
// Summary: returns the relations for the issue of given id (:issue_id).
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function RelationList(IssueId: integer; const Format: TEnumOpenapi11): TRelationList;
// RelationCreate [post] /issues/{issue_id}/relations.{format}
//
// Summary: Creates a relation for the issue of given id (:issue_id).
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): relation was created
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: relation was not created due to validation failures
// (response body contains the error messages)
procedure RelationCreate(IssueId: integer; const Format: TEnumOpenapi11;
const Payload: TRelationNew);
// RelationShow [get] /relations/{relation_id}.{format}
//
// Summary: Returns the relation of given id.
//
// Params:
// - [path] RelationId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function RelationShow(RelationId: integer; const Format: TEnumOpenapi11): TRelationShow;
// RelationDelete [delete] /relations/{relation_id}.{format}
//
// Summary: Deletes the relation of given id.
//
// Params:
// - [path] RelationId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): relation was deleted
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: relation was not deleted (response body contains
// the error messages)
procedure RelationDelete(RelationId: integer; const Format: TEnumOpenapi11);
// ---------------
// GROUP METHODS
// ---------------
// GroupList [get] /groups.{format}
//
// Summary: Returns the list of groups.
// This endpoint requires admin privileges.
//
// Params:
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
// - default [EUnknownError]
function GroupList(const Format: TEnumOpenapi11): TGroupList;
// GroupCreate [post] /groups.{format}
//
// Summary: Creates a group.
// This endpoint requires admin privileges.
//
// Params:
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): group was created
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 422 [EValidationError]
procedure GroupCreate(const Format: TEnumOpenapi11; const Payload: TGroupNew);
// GroupShow [get] /groups/{group_id}.{format}
//
// Summary: Returns details of a group.
// This endpoint requires admin privileges.
//
// Params:
// - [path] GroupId (required): The user identifier number
// - [path] Format (required): json or xml
// - [query] Include: a coma separated list of associations to include in the
// response:
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
// - default [EUnknownError]
function GroupShow(GroupId: integer; const Format: TEnumOpenapi11; const Include: TEnumOpenapi15Set = []): TGroupShow;
// GroupUpdate [put] /groups/{group_id}.{format}
//
// Summary: Updates an existing group.
// This endpoint requires admin privileges.
//
// Params:
// - [path] GroupId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
procedure GroupUpdate(GroupId: integer; const Format: TEnumOpenapi11; const Payload: TGroupUpdate);
// GroupDelete [delete] /groups/{group_id}.{format}
//
// Summary: Deletes an existing group.
// This endpoint requires admin privileges.
//
// Params:
// - [path] GroupId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
procedure GroupDelete(GroupId: integer; const Format: TEnumOpenapi11);
// UserAdd [post] /groups/{group_id}/users.{format}
//
// Summary: Adds an existing user to a group. This endpoint requires admin privileges.
//
// Params:
// - [path] GroupId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): user was added to the group
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
procedure UserAdd(GroupId: integer; const Format: TEnumOpenapi11; const Payload: TUserAdd);
// [delete] /groups/{group_id}/users/{user_id}.{format}
//
// Summary: Removes a user from a group. This endpoint requires admin privileges.
//
// Params:
// - [path] GroupId (required): The user identifier number
// - [path] UserId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): user was removed to the group
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
procedure DeleteGroupsGroupIdUsersUserIdFormat(GroupId: integer; const UserId: variant;
const Format: TEnumOpenapi11);
// -----------------------
// ISSUESTATUSES METHODS
// -----------------------
// StatusesList [get] /issue_statuses.{format}
//
// Summary: Returns possible Status Values for Issues
//
// Params:
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function StatusesList(const Format: TEnumOpenapi11): TIssueStatusesList;
// ------------------
// TRACKERS METHODS
// ------------------
// TrackersList [get] /trackers.{format}
//
// Summary: List trackers
// Description:
// Returns the list of all trackers.
//
// Params:
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function TrackersList(const Format: TEnumOpenapi11): TTrackerList;
// ---------------
// USERS METHODS
// ---------------
// UsersList [get] /users.{format}
//
// Summary: Returns a list of users. This endpoint requires admin privileges.
//
// Params:
// - [path] Format (required): json or xml
// - [query] Offset: the offset of the first object to retrieve
// - [query] Limit: number of issues per page (optional)
// - [query] Status: get only users with the given status. See app/models/principal.rb
// for a list of available statuses. Supply an empty value to match all users
// regardless of their status. Default is 1 (active users)
// - [query] Name: filter users on their login, firstname, lastname and mail ;
// if the pattern contains a space, it will also return users whose firstname
// match the first word or lastname match the second word
// - [query] GroupId: get only users who are members of the given group. Don't
// replace components/parameters/group_id
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
// - default [EUnknownError]
function UsersList(const Format: TEnumOpenapi11; Offset: integer = 0; Limit: integer = 0;
const Status: TEnumOpenapi16 = eo16None; const Name: string = '';
GroupId: integer = 0): TUserList;
// UserCreate [post] /users.{format}
//
// Summary: Creates a user.This endpoint requires admin privileges.
//
// Params:
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): user was created
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 422 [EValidationError]: user was not created due to validation failures (response
// body contains the error messages)
procedure UserCreate(const Format: TEnumOpenapi11; const Payload: TUserNew);
// UserShow [get] /users/{user_id}.{format}
//
// Summary: Returns the user details. You can use /users/current.:format for retrieving
// the user whose credentials are used to access the API.
// This endpoint can be used by admin or non admin but the returned fields will
// depend on the privileges of the requesting user
//
// Params:
// - [path] UserId (required): The user identifier number
// - [path] Format (required): json or xml
// - [query] Include: a comma separated list of associations to include in the
// response:
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
// - default [EUnknownError]
function UserShow(const UserId: variant; const Format: TEnumOpenapi11;
const Include: TEnumOpenapi17Set = []): TUserShow;
// --------------
// USER METHODS
// --------------
// UserUpdate [put] /users/{user_id}.{format}
//
// Summary: Updates a user.
// This endpoint requires admin privileges.
//
// Params:
// - [path] UserId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
procedure UserUpdate(const UserId: variant; const Format: TEnumOpenapi11;
const Payload: TUserUpdate);
// UserDelete [delete] /users/{user_id}.{format}
//
// Summary: This endpoint requires admin privileges.
// Deletes a user.
//
// Params:
// - [path] UserId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): user was deleted
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
procedure UserDelete(const UserId: variant; const Format: TEnumOpenapi11);
// -----------------
// VERSION METHODS
// -----------------
// VersionShow [get] /versions/{version_id}.{format}
//
// Summary: Returns the version of given id.
//
// Params:
// - [path] VersionId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function VersionShow(VersionId: integer; const Format: TEnumOpenapi11): TVersionShow;
// VersionUpdate [put] /versions/{version_id}.{format}
//
// Summary: Updates the version of given id
//
// Params:
// - [path] VersionId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): version was updated
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: version was not updated due to validation failures
// (response body contains the error messages)
procedure VersionUpdate(VersionId: integer; const Format: TEnumOpenapi11;
const Payload: TVersionUpdate);
// VersionDelete [delete] /versions/{version_id}.{format}
//
// Summary: Deletes the version of given id.
//
// Params:
// - [path] VersionId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): version was deleted
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - 422 [EValidationError]: version was not deleted (response body contains the
// error messages)
procedure VersionDelete(VersionId: integer; const Format: TEnumOpenapi11);
// VersionList [get] /projects/{project_id}/versions.{format}
//
// Summary: Returns the versions available for the project of given id or identifier
// (:project_id). The response may include shared versions from other projects.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function VersionList(const ProjectId: variant; const Format: TEnumOpenapi11): TVersionList;
// VersionCreate [post] /projects/{project_id}/versions.{format}
//
// Summary: Creates a version for the project of given id or identifier (:project_id).
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): version was created
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: version was not created due to validation failures
// (response body contains the error messages)
procedure VersionCreate(const ProjectId: variant; const Format: TEnumOpenapi11;
const Payload: TVersionNew);
// --------------------
// CHECKLISTS METHODS
// --------------------
// ChecklistList [get] /issues/{issue_id}/checklists.{format}
//
// Summary: Returns list of checklist items for issue issue_id
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function ChecklistList(IssueId: integer; const Format: TEnumOpenapi11): TCheckListList;
// CheckListCreate [post] /issues/{issue_id}/checklists.{format}
//
// Summary: Creating a checklist
//
// Params:
// - [path] IssueId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
procedure CheckListCreate(IssueId: integer; const Format: TEnumOpenapi11;
const Payload: TCheckListNew);
// ChecklistUpdate [put] /checklists/{checklist_id}.{format}
//
// Summary: Updating a checklist
//
// Params:
// - [path] ChecklistId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
procedure ChecklistUpdate(ChecklistId: integer; const Format: TEnumOpenapi11;
const Payload: TCheckListUpdate);
// ----------------------
// CUSTOMFIELDS METHODS
// ----------------------
// CustomFieldList [get] /custom_fields.{format}
//
// Summary: Returns all the custom fields definitions.
// This endpoint requires admin privileges.
//
// Params:
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 403 [EForbidden]
// - 404 [EResNotFound]
// - default [EUnknownError]
function CustomFieldList(const Format: TEnumOpenapi11): TCustomFieldsList;
// ----------------------
// ENUMERATIONS METHODS
// ----------------------
// EnumList [get] /enumerations/{type}.{format}
//
// Summary: Returns enum for given Type
//
// Params:
// - [path] _Type (required): Enumeration Type issue_priorities,time_entry_activities,
//document_categories
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function EnumList(const _Type: TEnumOpenapi18; const Format: TEnumOpenapi11): TEnumList;
// ------------------
// PROJECTS METHODS
// ------------------
// ProjectsList [get] /projects.{format}
//
// Summary: Listing projects
// Description:
// Returns all projects (all public projects and private projects where user have access to)
//
// Params:
// - [path] Format (required): json or xml
// - [query] Offset: the offset of the first object to retrieve
// - [query] Limit: number of issues per page (optional)
// - [query] Include: fetch associated data (optional). Possible values: trackers,
// issue_categories, enabled_modules (since 2.6.0).
// Values should be separated by a comma ",".
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function ProjectsList(const Format: TEnumOpenapi11; Offset: integer = 0;
Limit: integer = 0; const Include: TEnumOpenapi19Set = []): TProjectList;
// ProjectCreate [post] /projects.{format}
//
// Summary: Creating a project
// Description:
// Creates a the project
//
// Params:
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): project was created
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: project was not created due to validation failures
// (response body contains the error messages)
procedure ProjectCreate(const Format: TEnumOpenapi11; const Payload: TProjectNew);
// ProjectShow [get] /projects/{project_id}.{format}
//
// Summary: Showing a project
// Description:
// Returns the project of given id or identifier.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
// - [query] Include: fetch associated data (optional). Possible values: trackers,
// issue_categories, enabled_modules (since 2.6.0).
// Values should be separated by a comma ",".
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function ProjectShow(const ProjectId: variant; const Format: TEnumOpenapi11;
const Include: TEnumOpenapi19Set = []): TProjectShow;
// ProjectUpdate [put] /projects/{project_id}.{format}
//
// Summary: Updating a project
// Description:
// Updates the project of given id or identifier.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
procedure ProjectUpdate(const ProjectId: variant; const Format: TEnumOpenapi11;
const Payload: TProjectUpdate);
// ProjectDelete [delete] /projects/{project_id}.{format}
//
// Summary: Deleting a project
// Description:
// Deletes the project of given id or identifier.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 204 (main): Success
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
procedure ProjectDelete(const ProjectId: variant; const Format: TEnumOpenapi11);
// MemberShipList [get] /projects/{project_id}/memberships.{format}
//
// Summary: Returns a paginated list of the project memberships. :project_id can
// be either the project numerical id or the project identifier.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]
// - 404 [EResNotFound]
// - default [EUnknownError]
function MemberShipList(const ProjectId: variant; const Format: TEnumOpenapi11): TMemberShipList;
// MemberShipAdd [post] /projects/{project_id}/memberships.{format}
//
// Summary: Adds a project member.
//
// Params:
// - [path] ProjectId (required): The user identifier number
// - [path] Format (required): json or xml
// - [body] Payload (required)
//
// Responses:
// - 201 (main): membership was created
// - 401 [ENotAuthorized]
// - 422 [EValidationError]: membership was not created due to validation failures
// (response body contains the error messages)
procedure MemberShipAdd(const ProjectId: variant; const Format: TEnumOpenapi11;
const Payload: TMemberShipAdd);
// ------------------
// CATEGORY METHODS
// ------------------
// IssueCategoryShow [get] /issue_categories/{issue_category_id}.{format}
//
// Summary: Returns the issue category of given id.
//
// Params:
// - [path] IssueCategoryId (required): The user identifier number
// - [path] Format (required): json or xml
//
// Responses:
// - 200 (main)
// - 401 [ENotAuthorized]