-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitlab_response_models.py
More file actions
3805 lines (3596 loc) · 148 KB
/
gitlab_response_models.py
File metadata and controls
3805 lines (3596 loc) · 148 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
#!/usr/bin/python
from typing import Union, List, Dict, Optional, Any, TypeVar, Generic
import requests
from pydantic import (
BaseModel,
Field,
ConfigDict,
field_validator,
model_validator,
HttpUrl,
EmailStr,
)
from datetime import datetime
class IssueStats(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="IssueStats")
total: Optional[int] = Field(default=None, description="Total number of issues")
closed: Optional[int] = Field(default=None, description="Number of closed issues")
opened: Optional[int] = Field(default=None, description="Number of opened issues")
class Milestone(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Milestone")
id: Optional[int] = Field(
default=None, description="Unique identifier for the milestone"
)
iid: Optional[int] = Field(
default=None, description="Internal ID for the milestone"
)
project_id: Optional[int] = Field(
default=None, description="ID of the project the milestone belongs to"
)
title: Optional[str] = Field(default=None, description="Title of the milestone")
description: Optional[str] = Field(
default=None, description="Description of the milestone"
)
state: Optional[str] = Field(
default=None, description="State of the milestone (e.g., active, closed)"
)
created_at: Optional[datetime] = Field(
default=None, description="Timestamp when the milestone was created"
)
updated_at: Optional[datetime] = Field(
default=None, description="Timestamp when the milestone was last updated"
)
due_date: Optional[str] = Field(
default=None, description="Due date for the milestone"
)
start_date: Optional[str] = Field(
default=None, description="Start date for the milestone"
)
web_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="URL to the milestone in GitLab"
)
closed_at: Optional[datetime] = Field(
default=None, description="Timestamp when the milestone was closed."
)
issue_stats: Optional[IssueStats] = Field(
default=None, description="Statistics of issues related to the milestone"
)
class TimeStats(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="TimeStats")
time_estimate: Optional[int] = Field(
default=None,
description="Estimated time to complete the merge request (in seconds)",
)
total_time_spent: Optional[int] = Field(
default=None, description="Total time spent on the merge request (in seconds)"
)
human_time_estimate: Optional[str] = Field(
default=None,
description="Human-readable estimated time to complete the merge request",
)
human_total_time_spent: Optional[str] = Field(
default=None, description="Human-readable total time spent on the merge request"
)
class TaskCompletionStatus(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="TaskCompletionStatus")
count: Optional[int] = Field(
default=None, description="Total number of tasks in the merge request"
)
completed_count: Optional[int] = Field(
default=None, description="Number of completed tasks in the merge request"
)
class References(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="References")
short: Optional[str] = Field(
default=None, description="Short reference of the merge request"
)
relative: Optional[str] = Field(
default=None, description="Relative reference of the merge request"
)
full: Optional[str] = Field(
default=None, description="Full reference of the merge request"
)
class Artifact(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Artifact")
file_type: Optional[str] = Field(
default=None, description="Type of the artifact file."
)
size: Optional[int] = Field(default=None, description="Size of the artifact file.")
filename: Optional[str] = Field(
default=None, description="Filename of the artifact file."
)
file_format: Optional[str] = Field(
default=None, description="Format of the artifact file."
)
class ArtifactsFile(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="ArtifactsFile")
filename: Optional[str] = Field(
default=None, description="Filename of the artifacts file."
)
size: Optional[int] = Field(default=None, description="Size of the artifacts file.")
class RunnerManager(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="RunnerManager")
id: Optional[int] = Field(default=None, description="ID of the runner manager.")
system_id: Optional[str] = Field(
default=None, description="System ID of the runner manager."
)
version: Optional[str] = Field(
default=None, description="Version of the runner manager."
)
revision: Optional[str] = Field(
default=None, description="Revision of the runner manager."
)
platform: Optional[str] = Field(
default=None, description="Platform of the runner manager."
)
architecture: Optional[str] = Field(
default=None, description="Architecture of the runner manager."
)
created_at: Optional[datetime] = Field(
default=None, description="Timestamp when the runner manager was created."
)
contacted_at: Optional[datetime] = Field(
default=None,
description="Timestamp when the runner manager was last contacted.",
)
ip_address: Optional[str] = Field(
default=None, description="IP address of the runner manager."
)
status: Optional[str] = Field(
default=None, description="Status of the runner manager."
)
class Configuration(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Configuration")
approvals_before_merge: Optional[int] = Field(
default=None, description="Number of approvals required before merge"
)
reset_approvals_on_push: Optional[bool] = Field(
default=None, description="Whether approvals reset on new push"
)
selective_code_owner_removals: Optional[bool] = Field(
default=None, description="Whether selective code owner removals are allowed"
)
disable_overriding_approvers_per_merge_request: Optional[bool] = Field(
default=None,
description="Whether overriding approvers per merge request is disabled",
)
merge_requests_author_approval: Optional[bool] = Field(
default=None, description="Whether authors can approve their own merge requests"
)
merge_requests_disable_committers_approval: Optional[bool] = Field(
default=None, description="Whether committers are disabled from approving"
)
require_password_to_approve: Optional[bool] = Field(
default=None, description="Whether a password is required to approve"
)
require_reauthentication_to_approve: Optional[bool] = Field(
default=None,
description="Require reauthentication to approve (replacement for require_password_to_approve).",
)
class Iteration(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Iteration")
id: Optional[int] = Field(default=None)
iid: Optional[int] = Field(default=None)
sequence: Optional[int] = Field(default=None)
group_id: Optional[int] = Field(default=None)
title: Optional[str] = Field(default=None)
description: Optional[str] = Field(default=None)
state: Optional[int] = Field(default=None)
created_at: Optional[datetime] = Field(default=None)
updated_at: Optional[datetime] = Field(default=None)
start_date: Optional[str] = Field(default=None)
due_date: Optional[str] = Field(default=None)
web_url: Optional[Union[HttpUrl, str]] = Field(default=None)
class Identity(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Identity")
provider: Optional[str] = Field(default=None, description="The external provider.")
extern_uid: Optional[str] = Field(
default=None, description="The external authentication provider UID."
)
class GroupSamlIdentity(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="GroupSamlIdentity")
extern_uid: Optional[str] = Field(
default=None, description="External UID of the SAML identity"
)
provider: Optional[str] = Field(
default=None, description="Provider of the SAML identity"
)
saml_provider_id: Optional[int] = Field(
default=None, description="ID of the SAML provider"
)
class User(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="User")
id: Optional[int] = Field(default=None, description="The unique ID of the user.")
username: Optional[str] = Field(
default=None, description="The username of the user."
)
user: Optional[str] = Field(default=None, description="The user.")
email: Optional[Union[EmailStr, str]] = Field(
default=None, description="The email of the user."
)
name: Optional[str] = Field(default=None, description="The name of the user.")
state: Optional[str] = Field(
default=None, description="The state of the user (e.g., active, blocked)."
)
locked: Optional[bool] = Field(
default=None, description="Indicates if the user is locked."
)
avatar_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="The URL of the user's avatar."
)
web_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="The URL of the user's web profile."
)
created_at: Optional[datetime] = Field(
default=None, description="The creation date of the user."
)
is_admin: Optional[bool] = Field(
default=None, description="Indicates if the user is an administrator."
)
bio: Optional[str] = Field(default=None, description="The bio of the user.")
location: Optional[str] = Field(
default=None, description="The location of the user."
)
skype: Optional[str] = Field(default=None, description="The Skype ID of the user.")
linkedin: Optional[str] = Field(
default=None, description="The LinkedIn ID of the user."
)
twitter: Optional[str] = Field(
default=None, description="The Twitter handle of the user."
)
discord: Optional[str] = Field(
default=None, description="The Discord ID of the user."
)
website_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="The website URL of the user."
)
organization: Optional[str] = Field(
default=None, description="The organization the user belongs to."
)
job_title: Optional[str] = Field(
default=None, description="The job title of the user."
)
last_sign_in_at: Optional[datetime] = Field(
default=None, description="The last sign-in date of the user."
)
confirmed_at: Optional[datetime] = Field(
default=None, description="The date the user was confirmed."
)
theme_id: Optional[int] = Field(
default=None, description="The theme ID of the user's profile."
)
last_activity_on: Optional[datetime] = Field(
default=None, description="The last activity date of the user."
)
color_scheme_id: Optional[int] = Field(
default=None, description="The color scheme ID of the user's profile."
)
projects_limit: Optional[int] = Field(
default=None, description="The project limit for the user."
)
current_sign_in_at: Optional[datetime] = Field(
default=None, description="The current sign-in date of the user."
)
note: Optional[str] = Field(default=None, description="A note about the user.")
identities: Optional[List[Identity]] = Field(
default=None,
description="List of external identities associated with the user.",
)
can_create_group: Optional[bool] = Field(
default=None, description="Indicates if the user can create groups."
)
can_create_project: Optional[bool] = Field(
default=None, description="Indicates if the user can create projects."
)
two_factor_enabled: Optional[bool] = Field(
default=None, description="Indicates if two-factor authentication is enabled."
)
external: Optional[bool] = Field(
default=None, description="Indicates if the user is external."
)
private_profile: Optional[bool] = Field(
default=None, description="Indicates if the user's profile is private."
)
current_sign_in_ip: Optional[str] = Field(
default=None, description="The current sign-in IP of the user."
)
last_sign_in_ip: Optional[str] = Field(
default=None, description="The last sign-in IP of the user."
)
namespace_id: Optional[int] = Field(
default=None, description="The namespace ID of the user."
)
created_by: Optional[Union[int, "User"]] = Field(
default=None, description="The ID of the user who created this user."
)
email_reset_offered_at: Optional[datetime] = Field(
default=None, description="The date when an email reset was offered."
)
expires_at: Optional[datetime] = Field(
default=None, description="Timestamp of when the member's access expires"
)
access_level: Optional[int] = Field(
default=None, description="Access level of the member"
)
group_saml_identity: Optional[GroupSamlIdentity] = Field(
default=None, description="SAML identity details of the member"
)
approved: Optional[bool] = Field(
default=None, description="Approval status of the pending member"
)
invited: Optional[bool] = Field(
default=None, description="Invitation status of the pending member"
)
public_email: Optional[str] = Field(
None, description="Public email address of the user"
)
pronouns: Optional[str] = Field(None, description="Pronouns of the user")
bot: Optional[bool] = Field(
default=None, description="Indicates if the user is a bot"
)
work_information: Optional[str] = Field(
None, description="Work information of the user"
)
followers: Optional[int] = Field(
default=None, description="Number of followers the user has"
)
following: Optional[int] = Field(
default=None, description="Number of people the user is following"
)
local_time: Optional[str] = Field(None, description="Local time of the user")
commit_email: Optional[str] = Field(
default=None, description="Commit email address of the user"
)
shared_runners_minutes_limit: Optional[int] = Field(
None, description="Shared runners minutes limit for the user"
)
extra_shared_runners_minutes_limit: Optional[int] = Field(
None, description="Extra shared runners minutes limit"
)
membership_type: Optional[str] = Field(None, description="Membership type")
removable: Optional[bool] = Field(
default=None, description="Whether or not the members are removable"
)
last_login_at: Optional[datetime] = Field(
default=None, description="The last login-in date of the user."
)
@field_validator("identities", mode="before")
def validate_tags(cls, v):
if isinstance(v, list) and not v:
return None
if isinstance(v, list):
identities = []
for item in v:
identities.append(Identity(**item))
return identities
return v
class Namespace(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Namespace")
id: Optional[int] = Field(default=None, description="The ID of the namespace.")
name: Optional[str] = Field(default=None, description="The name of the namespace.")
path: Optional[str] = Field(default=None, description="The path of the namespace.")
kind: Optional[str] = Field(default=None, description="The kind of the namespace.")
full_path: Optional[str] = Field(
default=None, description="The full path of the namespace."
)
parent_id: Optional[int] = Field(
default=None, description="The parent ID of the namespace, if any."
)
root_repository_size: Optional[int] = Field(
default=None, description="The root repository size."
)
projects_count: Optional[int] = Field(
default=None, description="The project count."
)
avatar_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="The avatar URL of the namespace."
)
web_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="The web URL of the namespace."
)
members_count_with_descendants: Optional[int] = Field(
default=None, description="Number of descendant members"
)
billable_members_count: Optional[int] = Field(
default=None, description="The Billable members count of the namespace, if any."
)
plan: Optional[str] = Field(default=None, description="Plan of the Namespace")
trial_ends_on: Optional[datetime] = Field(
default=None, description="The date the Trial ends"
)
trial: Optional[bool] = Field(
default=None, description="Indicates if the namespace is a trial"
)
class ContainerExpirationPolicy(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="ContainerExpirationPolicy")
cadence: Optional[str] = Field(
default=None, description="The cadence of the expiration policy."
)
enabled: Optional[bool] = Field(
default=None, description="Whether the expiration policy is enabled."
)
keep_n: Optional[int] = Field(default=None, description="Number of items to keep.")
older_than: Optional[str] = Field(
default=None, description="Items older than this will be removed."
)
name_regex: Optional[str] = Field(default=None, description="Regex to match names.")
name_regex_keep: Optional[str] = Field(
default=None, description="Regex to match names to keep."
)
next_run_at: Optional[datetime] = Field(
default=None, description="The next run time of the policy."
)
class Permissions(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Permissions")
project_access: Optional[Dict] = Field(
default=None, description="Project access level and notification settings."
)
group_access: Optional[Dict] = Field(
default=None, description="Group access level and notification settings."
)
class Statistics(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Statistics")
commit_count: Optional[int] = Field(
default=None, description="The number of commits in the project."
)
storage_size: Optional[int] = Field(
default=None, description="The total storage size of the project."
)
repository_size: Optional[int] = Field(
default=None, description="The size of the repository."
)
wiki_size: Optional[int] = Field(default=None, description="The size of the wiki.")
lfs_objects_size: Optional[int] = Field(
default=None, description="The size of LFS objects."
)
job_artifacts_size: Optional[int] = Field(
default=None, description="The size of job artifacts."
)
pipeline_artifacts_size: Optional[int] = Field(
default=None, description="The size of pipeline artifacts."
)
packages_size: Optional[int] = Field(
default=None, description="The size of packages."
)
snippets_size: Optional[int] = Field(
default=None, description="The size of snippets."
)
uploads_size: Optional[int] = Field(
default=None, description="The size of uploads."
)
class Diff(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Diff")
id: Optional[int] = Field(default=None, description="The ID of the Diff")
merge_request_id: Optional[int] = Field(
default=None, description="The merge request ID"
)
head_commit_sha: Optional[str] = Field(
default=None, description="The head commit sha"
)
base_commit_sha: Optional[str] = Field(
default=None, description="The base commit sha"
)
start_commit_sha: Optional[str] = Field(
default=None, description="The start commit sha"
)
created_at: Optional[datetime] = Field(
default=None, description="Creation date of the note"
)
state: Optional[str] = Field(default=None, description="The state of the Diff")
real_size: Optional[str] = Field(
default=None, description="The real size of the Diff"
)
patch_id_sha: Optional[str] = Field(
default=None, description="The patch ID of the sha"
)
diff: Optional[str] = Field(default=None, description="The diff of the commit")
new_path: Optional[str] = Field(
default=None, description="The new path of the file"
)
old_path: Optional[str] = Field(
default=None, description="The old path of the file"
)
a_mode: Optional[str] = Field(
default=None, description="The file mode for the old file"
)
b_mode: Optional[str] = Field(
default=None, description="The file mode for the new file"
)
new_file: Optional[bool] = Field(
default=None, description="Whether this is a new file"
)
renamed_file: Optional[bool] = Field(
default=None, description="Whether this file was renamed"
)
deleted_file: Optional[bool] = Field(
default=None, description="Whether this file was deleted"
)
generated_file: Optional[bool] = Field(
default=None, description="Whether this file was generated"
)
class DetailedStatus(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="DetailedStatus")
icon: Optional[str] = Field(
default=None, description="The icon representing the status."
)
text: Optional[str] = Field(
default=None, description="The text describing the status."
)
label: Optional[str] = Field(default=None, description="The label of the status.")
group: Optional[str] = Field(
default=None, description="The group to which this status belongs."
)
tooltip: Optional[str] = Field(
default=None, description="The tooltip text for the status."
)
has_details: Optional[bool] = Field(
default=None, description="Indicates if the status has details."
)
details_path: Optional[str] = Field(
default=None, description="The path to the details of the status."
)
illustration: Optional[Any] = Field(
default=None, description="The illustration object related to the status."
)
favicon: Optional[str] = Field(
default=None, description="The URL to the favicon representing the status."
)
class PipelineSchedule(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="PipelineSchedule")
id: Optional[int] = Field(default=None, description="ID of the pipeline schedule")
description: Optional[str] = Field(
default=None, description="Description of the schedule"
)
ref: Optional[str] = Field(
default=None, description="Git reference (e.g., refs/heads/main)"
)
cron: Optional[str] = Field(
default=None, description="Cron expression for scheduling"
)
cron_timezone: Optional[str] = Field(
default=None, description="Timezone for the cron schedule"
)
next_run_at: Optional[datetime] = Field(
default=None, description="Next scheduled run time"
)
active: bool = Field(default=True, description="Whether the schedule is active")
created_at: Optional[datetime] = Field(
default=None, description="Creation timestamp"
)
updated_at: Optional[datetime] = Field(
default=None, description="Last update timestamp"
)
owner: Optional[User] = Field(
default=None, description="Owner of the pipeline schedule"
)
last_pipeline: Optional["Pipeline"] = Field(
default=None, description="Last pipeline triggered by this schedule"
)
variables: Optional[List["PipelineVariable"]] = Field(
default=None, description="List of variables for the schedule"
)
class Pipeline(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Pipeline")
id: Optional[int] = Field(default=None, description="ID of the pipeline")
iid: Optional[int] = Field(
default=None, description="The internal ID of the pipeline."
)
ref: Optional[str] = Field(
default=None, description="Reference name of the pipeline"
)
sha: Optional[str] = Field(default=None, description="SHA of the pipeline")
status: Optional[str] = Field(default=None, description="Status of the pipeline")
web_url: Optional[Union[HttpUrl, str]] = Field(
default=None, description="URL for the pipeline"
)
project_id: Optional[int] = Field(
default=None, description="The ID of the project associated with the pipeline."
)
before_sha: Optional[str] = Field(
default=None, description="The commit SHA before the current one."
)
tag: Optional[bool] = Field(
default=None, description="Indicates if the pipeline is for a tag."
)
yaml_errors: Optional[str] = Field(
default=None,
description="Errors encountered in the pipeline YAML configuration.",
)
user: Optional[User] = Field(
default=None, description="The user who triggered the pipeline."
)
created_at: Optional[str] = Field(
default=None, description="Timestamp when the pipeline was created."
)
updated_at: Optional[str] = Field(
default=None, description="Timestamp when the pipeline was last updated."
)
started_at: Optional[str] = Field(
default=None, description="Timestamp when the pipeline started."
)
finished_at: Optional[str] = Field(
default=None, description="Timestamp when the pipeline finished."
)
committed_at: Optional[str] = Field(
default=None, description="Timestamp when the pipeline was committed."
)
duration: Optional[float] = Field(
default=None, description="The duration of the pipeline in seconds."
)
queued_duration: Optional[float] = Field(
default=None, description="The duration the pipeline spent in the queue."
)
coverage: Optional[str] = Field(
default=None, description="The code coverage percentage."
)
name: Optional[str] = Field(default=None, description="The name of the pipeline.")
source: Optional[str] = Field(
default=None, description="The source of the pipeline (e.g., push, web)."
)
detailed_status: Optional[DetailedStatus] = Field(
default=None, description="The detailed status of the pipeline."
)
class PackageLink(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="PackageLink")
web_path: Optional[str] = Field(
default=None, description="Web path to access the package"
)
delete_api_path: Optional[str] = Field(
default=None, description="API path to delete the package"
)
class PackageVersion(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="PackageVersion")
id: Optional[int] = Field(default=None, description="Version ID of the package")
version: Optional[str] = Field(default=None, description="Version of the package")
created_at: Optional[datetime] = Field(
default=None, description="Creation date and time of the package version"
)
pipelines: Optional[List[Pipeline]] = Field(
default=None,
description="List of pipelines associated with the package version",
)
@field_validator("pipelines", mode="before")
def validate_pipelines(cls, v):
if isinstance(v, list) and not v:
return None
if isinstance(v, list):
pipelines = []
for item in v:
pipelines.append(Pipeline(**item))
return pipelines
return v
class Package(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Package")
id: Optional[int] = Field(default=None, description="Package ID")
name: Optional[str] = Field(default=None, description="Name of the package")
version: Optional[str] = Field(default=None, description="Version of the package")
package_type: Optional[str] = Field(
default=None, description="Type of the package (e.g., maven, npm, conan)"
)
created_at: Optional[datetime] = Field(
default=None, description="Creation date and time of the package"
)
last_downloaded_at: Optional[datetime] = Field(
default=None, description="Last downloaded date and time of the package"
)
conan_package_name: Optional[str] = Field(
default=None, description="Conan package name if applicable"
)
links: Optional[PackageLink] = Field(
default=None, alias="_links", description="Links related to the package"
)
pipelines: Optional[List[Pipeline]] = Field(
default=None, description="List of pipelines associated with the package"
)
tags: Optional[List["Tag"]] = Field(
default=None, description="List of tags associated with the package"
)
versions: Optional[List[PackageVersion]] = Field(
default=None, description="List of different versions of the package"
)
package_id: Optional[int] = Field(
default=None, description="ID of the package this file belongs to"
)
file_name: Optional[str] = Field(
default=None, description="Name of the package file"
)
size: Optional[int] = Field(
default=None, description="Size of the package file in bytes"
)
file_md5: Optional[str] = Field(
default=None, description="MD5 checksum of the package file"
)
file_sha1: Optional[str] = Field(
default=None, description="SHA-1 checksum of the package file"
)
file_sha256: Optional[str] = Field(
default=None, description="SHA-256 checksum of the package file"
)
@field_validator("pipelines", mode="before")
def validate_pipelines(cls, v):
if isinstance(v, list) and not v:
return None
if isinstance(v, list):
pipelines = []
for item in v:
pipelines.append(Pipeline(**item))
return pipelines
return v
@field_validator("tags", mode="before")
def validate_tags(cls, v):
if isinstance(v, list) and not v:
return None
if isinstance(v, list):
tags = []
for item in v:
tags.append(Tag(tag=item))
return tags
if isinstance(v, str):
tags = [Tag(tag=v)]
return tags
return v
class Contributor(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Contributor")
name: str = Field(default=None, description="The name of the contributor.")
email: Union[EmailStr, str] = Field(
default=None, description="The email of the contributor."
)
commits: int = Field(default=None, description="Number of commits from contributor")
additions: int = Field(
default=None, description="Number of additions from contributor"
)
deletions: int = Field(
default=None, description="Number of deletions from contributor"
)
class CommitStats(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="CommitStats")
additions: Optional[int] = Field(
default=None, description="Number of additions in the commit"
)
deletions: Optional[int] = Field(
default=None, description="Number of deletions in the commit"
)
total: Optional[int] = Field(
default=None, description="Total number of changes in the commit"
)
class CommitSignature(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="CommitSignature")
signature_type: Optional[str] = Field(
default=None, description="Type of the signature"
)
verification_status: Optional[str] = Field(
default=None, description="Verification status of the signature"
)
commit_source: Optional[str] = Field(
default=None, description="Source of the commit"
)
gpg_key_id: Optional[int] = Field(default=None, description="ID of the GPG key")
gpg_key_primary_keyid: Optional[str] = Field(
default=None, description="Primary key ID of the GPG key"
)
gpg_key_user_name: Optional[str] = Field(
default=None, description="User name of the GPG key owner"
)
gpg_key_user_email: Optional[str] = Field(
default=None, description="User email of the GPG key owner"
)
gpg_key_subkey_id: Optional[str] = Field(
default=None, description="Subkey ID of the GPG key"
)
key: Optional[Dict[str, Any]] = Field(default=None, description="SSH key details")
x509_certificate: Optional[Dict[str, Any]] = Field(
default=None, description="X509 certificate details"
)
message: Optional[str] = Field(
default=None, description="The message from the signature response."
)
class Comment(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Comment")
id: Optional[int] = Field(default=None, description="ID of the note")
type: Optional[str] = Field(default=None, description="Type of the note")
body: Optional[str] = Field(default=None, description="Body content of the note")
note: Optional[str] = Field(default=None, description="Content of the note")
attachment: Optional[Any] = Field(
default=None, description="Attachment associated with the note"
)
author: Optional[User] = Field(default=None, description="Author of the note")
created_at: Optional[datetime] = Field(
default=None, description="Creation date of the note"
)
updated_at: Optional[datetime] = Field(
default=None, description="Last update date of the note"
)
system: Optional[bool] = Field(
default=None, description="Whether the note is a system note"
)
notable_id: Optional[int] = Field(
default=None, description="ID of the notable entity", alias="noteable_id"
)
notable_type: Optional[str] = Field(
default=None, description="Type of the notable entity", alias="noteable_type"
)
resolvable: Optional[bool] = Field(
default=None, description="Whether the note is resolvable"
)
confidential: Optional[bool] = Field(
default=None, description="Whether the note is confidential"
)
notable_iid: Optional[int] = Field(
default=None, description="IID of the notable entity", alias="noteable_iid"
)
commands_changes: Optional[Dict[str, Any]] = Field(
default=None, description="Command changes associated with the note"
)
line_type: Optional[str] = Field(default=None, description="Line type")
path: Optional[str] = Field(default=None, description="Path")
line: Optional[int] = Field(default=None, description="Line in note")
class ParentID(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="ParentID")
parent_id: str = Field(default=None, description="Parent ID")
class Commit(BaseModel):
model_config = ConfigDict(extra="allow")
__hash__ = object.__hash__
base_type: str = Field(default="Commit")
id: Optional[Union[str, int]] = Field(default=None, description="The commit ID.")
short_id: Optional[str] = Field(
default=None, description="A shortened version of the commit ID."
)
started_at: Optional[datetime] = Field(
default=None, description="The start date of the commit."
)
finished_at: Optional[datetime] = Field(
default=None, description="The finished date of the commit."
)
created_at: Optional[datetime] = Field(
default=None, description="The creation date of the commit."
)
parent_ids: Optional[List[ParentID]] = Field(
default=None, description="A list of parent commit IDs."
)
title: Optional[str] = Field(default=None, description="The title of the commit.")
description: Optional[str] = Field(
default=None, description="The commit description."
)
message: Optional[str] = Field(
default=None, description="The name of the commit author."
)
author: Optional[User] = Field(
default=None, description="The author of the commit."
)
author_name: Optional[str] = Field(
default=None, description="The name of the commit author."
)
author_email: Optional[str] = Field(
default=None, description="The email of the commit author."
)
authored_date: Optional[datetime] = Field(
default=None, description="The date the commit was authored."
)
committer_name: Optional[str] = Field(
default=None, description="The name of the committer."
)
committer_email: Optional[Union[EmailStr, str]] = Field(
default=None, description="The email of the committer."
)
committed_date: Optional[datetime] = Field(