forked from wei18/github-rest-api-swift-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypes.swift
More file actions
1944 lines (1940 loc) · 95.3 KB
/
Types.swift
File metadata and controls
1944 lines (1940 loc) · 95.3 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
// Generated by swift-openapi-generator, do not modify.
@_spi(Generated) import OpenAPIRuntime
#if os(Linux)
@preconcurrency import struct Foundation.URL
@preconcurrency import struct Foundation.Data
@preconcurrency import struct Foundation.Date
#else
import struct Foundation.URL
import struct Foundation.Data
import struct Foundation.Date
#endif
/// A type that performs HTTP operations defined by the OpenAPI document.
public protocol APIProtocol: Sendable {
/// Get an assignment
///
/// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)`.
func classroomGetAnAssignment(_ input: Operations.ClassroomGetAnAssignment.Input) async throws -> Operations.ClassroomGetAnAssignment.Output
/// List accepted assignments for an assignment
///
/// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`.
func classroomListAcceptedAssignmentsForAnAssignment(_ input: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input) async throws -> Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Output
/// Get assignment grades
///
/// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}/grades`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)`.
func classroomGetAssignmentGrades(_ input: Operations.ClassroomGetAssignmentGrades.Input) async throws -> Operations.ClassroomGetAssignmentGrades.Output
/// List classrooms
///
/// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.
///
/// - Remark: HTTP `GET /classrooms`.
/// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)`.
func classroomListClassrooms(_ input: Operations.ClassroomListClassrooms.Input) async throws -> Operations.ClassroomListClassrooms.Output
/// Get a classroom
///
/// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.
///
/// - Remark: HTTP `GET /classrooms/{classroom_id}`.
/// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)`.
func classroomGetAClassroom(_ input: Operations.ClassroomGetAClassroom.Input) async throws -> Operations.ClassroomGetAClassroom.Output
/// List assignments for a classroom
///
/// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.
///
/// - Remark: HTTP `GET /classrooms/{classroom_id}/assignments`.
/// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)`.
func classroomListAssignmentsForAClassroom(_ input: Operations.ClassroomListAssignmentsForAClassroom.Input) async throws -> Operations.ClassroomListAssignmentsForAClassroom.Output
}
/// Convenience overloads for operation inputs.
extension APIProtocol {
/// Get an assignment
///
/// Gets a GitHub Classroom assignment. Assignment will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/get(classroom/get-an-assignment)`.
public func classroomGetAnAssignment(
path: Operations.ClassroomGetAnAssignment.Input.Path,
headers: Operations.ClassroomGetAnAssignment.Input.Headers = .init()
) async throws -> Operations.ClassroomGetAnAssignment.Output {
try await classroomGetAnAssignment(Operations.ClassroomGetAnAssignment.Input(
path: path,
headers: headers
))
}
/// List accepted assignments for an assignment
///
/// Lists any assignment repositories that have been created by students accepting a GitHub Classroom assignment. Accepted assignments will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}/accepted_assignments`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/accepted_assignments/get(classroom/list-accepted-assignments-for-an-assignment)`.
public func classroomListAcceptedAssignmentsForAnAssignment(
path: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input.Path,
query: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input.Query = .init(),
headers: Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input.Headers = .init()
) async throws -> Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Output {
try await classroomListAcceptedAssignmentsForAnAssignment(Operations.ClassroomListAcceptedAssignmentsForAnAssignment.Input(
path: path,
query: query,
headers: headers
))
}
/// Get assignment grades
///
/// Gets grades for a GitHub Classroom assignment. Grades will only be returned if the current user is an administrator of the GitHub Classroom for the assignment.
///
/// - Remark: HTTP `GET /assignments/{assignment_id}/grades`.
/// - Remark: Generated from `#/paths//assignments/{assignment_id}/grades/get(classroom/get-assignment-grades)`.
public func classroomGetAssignmentGrades(
path: Operations.ClassroomGetAssignmentGrades.Input.Path,
headers: Operations.ClassroomGetAssignmentGrades.Input.Headers = .init()
) async throws -> Operations.ClassroomGetAssignmentGrades.Output {
try await classroomGetAssignmentGrades(Operations.ClassroomGetAssignmentGrades.Input(
path: path,
headers: headers
))
}
/// List classrooms
///
/// Lists GitHub Classroom classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms.
///
/// - Remark: HTTP `GET /classrooms`.
/// - Remark: Generated from `#/paths//classrooms/get(classroom/list-classrooms)`.
public func classroomListClassrooms(
query: Operations.ClassroomListClassrooms.Input.Query = .init(),
headers: Operations.ClassroomListClassrooms.Input.Headers = .init()
) async throws -> Operations.ClassroomListClassrooms.Output {
try await classroomListClassrooms(Operations.ClassroomListClassrooms.Input(
query: query,
headers: headers
))
}
/// Get a classroom
///
/// Gets a GitHub Classroom classroom for the current user. Classroom will only be returned if the current user is an administrator of the GitHub Classroom.
///
/// - Remark: HTTP `GET /classrooms/{classroom_id}`.
/// - Remark: Generated from `#/paths//classrooms/{classroom_id}/get(classroom/get-a-classroom)`.
public func classroomGetAClassroom(
path: Operations.ClassroomGetAClassroom.Input.Path,
headers: Operations.ClassroomGetAClassroom.Input.Headers = .init()
) async throws -> Operations.ClassroomGetAClassroom.Output {
try await classroomGetAClassroom(Operations.ClassroomGetAClassroom.Input(
path: path,
headers: headers
))
}
/// List assignments for a classroom
///
/// Lists GitHub Classroom assignments for a classroom. Assignments will only be returned if the current user is an administrator of the GitHub Classroom.
///
/// - Remark: HTTP `GET /classrooms/{classroom_id}/assignments`.
/// - Remark: Generated from `#/paths//classrooms/{classroom_id}/assignments/get(classroom/list-assignments-for-a-classroom)`.
public func classroomListAssignmentsForAClassroom(
path: Operations.ClassroomListAssignmentsForAClassroom.Input.Path,
query: Operations.ClassroomListAssignmentsForAClassroom.Input.Query = .init(),
headers: Operations.ClassroomListAssignmentsForAClassroom.Input.Headers = .init()
) async throws -> Operations.ClassroomListAssignmentsForAClassroom.Output {
try await classroomListAssignmentsForAClassroom(Operations.ClassroomListAssignmentsForAClassroom.Input(
path: path,
query: query,
headers: headers
))
}
}
/// Server URLs defined in the OpenAPI document.
public enum Servers {
public enum Server1 {
public static func url() throws -> Foundation.URL {
try Foundation.URL(
validatingOpenAPIServerURL: "https://api.github.com",
variables: []
)
}
}
@available(*, deprecated, renamed: "Servers.Server1.url")
public static func server1() throws -> Foundation.URL {
try Foundation.URL(
validatingOpenAPIServerURL: "https://api.github.com",
variables: []
)
}
}
/// Types generated from the components section of the OpenAPI document.
public enum Components {
/// Types generated from the `#/components/schemas` section of the OpenAPI document.
public enum Schemas {
/// Basic Error
///
/// - Remark: Generated from `#/components/schemas/basic-error`.
public struct BasicError: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/basic-error/message`.
public var message: Swift.String?
/// - Remark: Generated from `#/components/schemas/basic-error/documentation_url`.
public var documentationUrl: Swift.String?
/// - Remark: Generated from `#/components/schemas/basic-error/url`.
public var url: Swift.String?
/// - Remark: Generated from `#/components/schemas/basic-error/status`.
public var status: Swift.String?
/// Creates a new `BasicError`.
///
/// - Parameters:
/// - message:
/// - documentationUrl:
/// - url:
/// - status:
public init(
message: Swift.String? = nil,
documentationUrl: Swift.String? = nil,
url: Swift.String? = nil,
status: Swift.String? = nil
) {
self.message = message
self.documentationUrl = documentationUrl
self.url = url
self.status = status
}
public enum CodingKeys: String, CodingKey {
case message
case documentationUrl = "documentation_url"
case url
case status
}
}
/// A GitHub repository view for Classroom
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository`.
public struct SimpleClassroomRepository: Codable, Hashable, Sendable {
/// A unique identifier of the repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/id`.
public var id: Swift.Int
/// The full, globally unique name of the repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/full_name`.
public var fullName: Swift.String
/// The URL to view the repository on GitHub.com.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/html_url`.
public var htmlUrl: Swift.String
/// The GraphQL identifier of the repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/node_id`.
public var nodeId: Swift.String
/// Whether the repository is private.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/private`.
public var _private: Swift.Bool
/// The default branch for the repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-repository/default_branch`.
public var defaultBranch: Swift.String
/// Creates a new `SimpleClassroomRepository`.
///
/// - Parameters:
/// - id: A unique identifier of the repository.
/// - fullName: The full, globally unique name of the repository.
/// - htmlUrl: The URL to view the repository on GitHub.com.
/// - nodeId: The GraphQL identifier of the repository.
/// - _private: Whether the repository is private.
/// - defaultBranch: The default branch for the repository.
public init(
id: Swift.Int,
fullName: Swift.String,
htmlUrl: Swift.String,
nodeId: Swift.String,
_private: Swift.Bool,
defaultBranch: Swift.String
) {
self.id = id
self.fullName = fullName
self.htmlUrl = htmlUrl
self.nodeId = nodeId
self._private = _private
self.defaultBranch = defaultBranch
}
public enum CodingKeys: String, CodingKey {
case id
case fullName = "full_name"
case htmlUrl = "html_url"
case nodeId = "node_id"
case _private = "private"
case defaultBranch = "default_branch"
}
}
/// A GitHub organization.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization`.
public struct SimpleClassroomOrganization: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/id`.
public var id: Swift.Int
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/login`.
public var login: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/node_id`.
public var nodeId: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/html_url`.
public var htmlUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/name`.
public var name: Swift.String?
/// - Remark: Generated from `#/components/schemas/simple-classroom-organization/avatar_url`.
public var avatarUrl: Swift.String
/// Creates a new `SimpleClassroomOrganization`.
///
/// - Parameters:
/// - id:
/// - login:
/// - nodeId:
/// - htmlUrl:
/// - name:
/// - avatarUrl:
public init(
id: Swift.Int,
login: Swift.String,
nodeId: Swift.String,
htmlUrl: Swift.String,
name: Swift.String? = nil,
avatarUrl: Swift.String
) {
self.id = id
self.login = login
self.nodeId = nodeId
self.htmlUrl = htmlUrl
self.name = name
self.avatarUrl = avatarUrl
}
public enum CodingKeys: String, CodingKey {
case id
case login
case nodeId = "node_id"
case htmlUrl = "html_url"
case name
case avatarUrl = "avatar_url"
}
}
/// A GitHub Classroom classroom
///
/// - Remark: Generated from `#/components/schemas/classroom`.
public struct Classroom: Codable, Hashable, Sendable {
/// Unique identifier of the classroom.
///
/// - Remark: Generated from `#/components/schemas/classroom/id`.
public var id: Swift.Int
/// The name of the classroom.
///
/// - Remark: Generated from `#/components/schemas/classroom/name`.
public var name: Swift.String
/// Whether classroom is archived.
///
/// - Remark: Generated from `#/components/schemas/classroom/archived`.
public var archived: Swift.Bool
/// - Remark: Generated from `#/components/schemas/classroom/organization`.
public var organization: Components.Schemas.SimpleClassroomOrganization
/// The URL of the classroom on GitHub Classroom.
///
/// - Remark: Generated from `#/components/schemas/classroom/url`.
public var url: Swift.String
/// Creates a new `Classroom`.
///
/// - Parameters:
/// - id: Unique identifier of the classroom.
/// - name: The name of the classroom.
/// - archived: Whether classroom is archived.
/// - organization:
/// - url: The URL of the classroom on GitHub Classroom.
public init(
id: Swift.Int,
name: Swift.String,
archived: Swift.Bool,
organization: Components.Schemas.SimpleClassroomOrganization,
url: Swift.String
) {
self.id = id
self.name = name
self.archived = archived
self.organization = organization
self.url = url
}
public enum CodingKeys: String, CodingKey {
case id
case name
case archived
case organization
case url
}
}
/// A GitHub Classroom assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment`.
public struct ClassroomAssignment: Codable, Hashable, Sendable {
/// Unique identifier of the repository.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/id`.
public var id: Swift.Int
/// Whether an accepted assignment creates a public repository.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/public_repo`.
public var publicRepo: Swift.Bool
/// Assignment title.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/title`.
public var title: Swift.String
/// Whether it's a group assignment or individual assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/type`.
@frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable {
case individual = "individual"
case group = "group"
}
/// Whether it's a group assignment or individual assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/type`.
public var _type: Components.Schemas.ClassroomAssignment._TypePayload
/// The link that a student can use to accept the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/invite_link`.
public var inviteLink: Swift.String
/// Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/invitations_enabled`.
public var invitationsEnabled: Swift.Bool
/// Sluggified name of the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/slug`.
public var slug: Swift.String
/// Whether students are admins on created repository when a student accepts the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/students_are_repo_admins`.
public var studentsAreRepoAdmins: Swift.Bool
/// Whether feedback pull request will be created when a student accepts the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/feedback_pull_requests_enabled`.
public var feedbackPullRequestsEnabled: Swift.Bool
/// The maximum allowable teams for the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/max_teams`.
public var maxTeams: Swift.Int?
/// The maximum allowable members per team.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/max_members`.
public var maxMembers: Swift.Int?
/// The selected editor for the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/editor`.
public var editor: Swift.String
/// The number of students that have accepted the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/accepted`.
public var accepted: Swift.Int
/// The number of students that have submitted the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/submitted`.
public var submitted: Swift.Int
/// The number of students that have passed the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/passing`.
public var passing: Swift.Int
/// The programming language used in the assignment.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/language`.
public var language: Swift.String
/// The time at which the assignment is due.
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment/deadline`.
public var deadline: Foundation.Date?
/// - Remark: Generated from `#/components/schemas/classroom-assignment/starter_code_repository`.
public var starterCodeRepository: Components.Schemas.SimpleClassroomRepository
/// - Remark: Generated from `#/components/schemas/classroom-assignment/classroom`.
public var classroom: Components.Schemas.Classroom
/// Creates a new `ClassroomAssignment`.
///
/// - Parameters:
/// - id: Unique identifier of the repository.
/// - publicRepo: Whether an accepted assignment creates a public repository.
/// - title: Assignment title.
/// - _type: Whether it's a group assignment or individual assignment.
/// - inviteLink: The link that a student can use to accept the assignment.
/// - invitationsEnabled: Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment.
/// - slug: Sluggified name of the assignment.
/// - studentsAreRepoAdmins: Whether students are admins on created repository when a student accepts the assignment.
/// - feedbackPullRequestsEnabled: Whether feedback pull request will be created when a student accepts the assignment.
/// - maxTeams: The maximum allowable teams for the assignment.
/// - maxMembers: The maximum allowable members per team.
/// - editor: The selected editor for the assignment.
/// - accepted: The number of students that have accepted the assignment.
/// - submitted: The number of students that have submitted the assignment.
/// - passing: The number of students that have passed the assignment.
/// - language: The programming language used in the assignment.
/// - deadline: The time at which the assignment is due.
/// - starterCodeRepository:
/// - classroom:
public init(
id: Swift.Int,
publicRepo: Swift.Bool,
title: Swift.String,
_type: Components.Schemas.ClassroomAssignment._TypePayload,
inviteLink: Swift.String,
invitationsEnabled: Swift.Bool,
slug: Swift.String,
studentsAreRepoAdmins: Swift.Bool,
feedbackPullRequestsEnabled: Swift.Bool,
maxTeams: Swift.Int? = nil,
maxMembers: Swift.Int? = nil,
editor: Swift.String,
accepted: Swift.Int,
submitted: Swift.Int,
passing: Swift.Int,
language: Swift.String,
deadline: Foundation.Date? = nil,
starterCodeRepository: Components.Schemas.SimpleClassroomRepository,
classroom: Components.Schemas.Classroom
) {
self.id = id
self.publicRepo = publicRepo
self.title = title
self._type = _type
self.inviteLink = inviteLink
self.invitationsEnabled = invitationsEnabled
self.slug = slug
self.studentsAreRepoAdmins = studentsAreRepoAdmins
self.feedbackPullRequestsEnabled = feedbackPullRequestsEnabled
self.maxTeams = maxTeams
self.maxMembers = maxMembers
self.editor = editor
self.accepted = accepted
self.submitted = submitted
self.passing = passing
self.language = language
self.deadline = deadline
self.starterCodeRepository = starterCodeRepository
self.classroom = classroom
}
public enum CodingKeys: String, CodingKey {
case id
case publicRepo = "public_repo"
case title
case _type = "type"
case inviteLink = "invite_link"
case invitationsEnabled = "invitations_enabled"
case slug
case studentsAreRepoAdmins = "students_are_repo_admins"
case feedbackPullRequestsEnabled = "feedback_pull_requests_enabled"
case maxTeams = "max_teams"
case maxMembers = "max_members"
case editor
case accepted
case submitted
case passing
case language
case deadline
case starterCodeRepository = "starter_code_repository"
case classroom
}
}
/// A GitHub user simplified for Classroom.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-user`.
public struct SimpleClassroomUser: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/simple-classroom-user/id`.
public var id: Swift.Int
/// - Remark: Generated from `#/components/schemas/simple-classroom-user/login`.
public var login: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-classroom-user/avatar_url`.
public var avatarUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-classroom-user/html_url`.
public var htmlUrl: Swift.String
/// Creates a new `SimpleClassroomUser`.
///
/// - Parameters:
/// - id:
/// - login:
/// - avatarUrl:
/// - htmlUrl:
public init(
id: Swift.Int,
login: Swift.String,
avatarUrl: Swift.String,
htmlUrl: Swift.String
) {
self.id = id
self.login = login
self.avatarUrl = avatarUrl
self.htmlUrl = htmlUrl
}
public enum CodingKeys: String, CodingKey {
case id
case login
case avatarUrl = "avatar_url"
case htmlUrl = "html_url"
}
}
/// A GitHub Classroom classroom
///
/// - Remark: Generated from `#/components/schemas/simple-classroom`.
public struct SimpleClassroom: Codable, Hashable, Sendable {
/// Unique identifier of the classroom.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom/id`.
public var id: Swift.Int
/// The name of the classroom.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom/name`.
public var name: Swift.String
/// Returns whether classroom is archived or not.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom/archived`.
public var archived: Swift.Bool
/// The url of the classroom on GitHub Classroom.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom/url`.
public var url: Swift.String
/// Creates a new `SimpleClassroom`.
///
/// - Parameters:
/// - id: Unique identifier of the classroom.
/// - name: The name of the classroom.
/// - archived: Returns whether classroom is archived or not.
/// - url: The url of the classroom on GitHub Classroom.
public init(
id: Swift.Int,
name: Swift.String,
archived: Swift.Bool,
url: Swift.String
) {
self.id = id
self.name = name
self.archived = archived
self.url = url
}
public enum CodingKeys: String, CodingKey {
case id
case name
case archived
case url
}
}
/// A GitHub Classroom assignment
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment`.
public struct SimpleClassroomAssignment: Codable, Hashable, Sendable {
/// Unique identifier of the repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/id`.
public var id: Swift.Int
/// Whether an accepted assignment creates a public repository.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/public_repo`.
public var publicRepo: Swift.Bool
/// Assignment title.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/title`.
public var title: Swift.String
/// Whether it's a Group Assignment or Individual Assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/type`.
@frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable {
case individual = "individual"
case group = "group"
}
/// Whether it's a Group Assignment or Individual Assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/type`.
public var _type: Components.Schemas.SimpleClassroomAssignment._TypePayload
/// The link that a student can use to accept the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/invite_link`.
public var inviteLink: Swift.String
/// Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/invitations_enabled`.
public var invitationsEnabled: Swift.Bool
/// Sluggified name of the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/slug`.
public var slug: Swift.String
/// Whether students are admins on created repository on accepted assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/students_are_repo_admins`.
public var studentsAreRepoAdmins: Swift.Bool
/// Whether feedback pull request will be created on assignment acceptance.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/feedback_pull_requests_enabled`.
public var feedbackPullRequestsEnabled: Swift.Bool
/// The maximum allowable teams for the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/max_teams`.
public var maxTeams: Swift.Int?
/// The maximum allowable members per team.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/max_members`.
public var maxMembers: Swift.Int?
/// The selected editor for the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/editor`.
public var editor: Swift.String
/// The number of students that have accepted the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/accepted`.
public var accepted: Swift.Int
/// The number of students that have submitted the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/submitted`.
public var submitted: Swift.Int
/// The number of students that have passed the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/passing`.
public var passing: Swift.Int
/// The programming language used in the assignment.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/language`.
public var language: Swift.String
/// The time at which the assignment is due.
///
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/deadline`.
public var deadline: Foundation.Date?
/// - Remark: Generated from `#/components/schemas/simple-classroom-assignment/classroom`.
public var classroom: Components.Schemas.SimpleClassroom
/// Creates a new `SimpleClassroomAssignment`.
///
/// - Parameters:
/// - id: Unique identifier of the repository.
/// - publicRepo: Whether an accepted assignment creates a public repository.
/// - title: Assignment title.
/// - _type: Whether it's a Group Assignment or Individual Assignment.
/// - inviteLink: The link that a student can use to accept the assignment.
/// - invitationsEnabled: Whether the invitation link is enabled. Visiting an enabled invitation link will accept the assignment.
/// - slug: Sluggified name of the assignment.
/// - studentsAreRepoAdmins: Whether students are admins on created repository on accepted assignment.
/// - feedbackPullRequestsEnabled: Whether feedback pull request will be created on assignment acceptance.
/// - maxTeams: The maximum allowable teams for the assignment.
/// - maxMembers: The maximum allowable members per team.
/// - editor: The selected editor for the assignment.
/// - accepted: The number of students that have accepted the assignment.
/// - submitted: The number of students that have submitted the assignment.
/// - passing: The number of students that have passed the assignment.
/// - language: The programming language used in the assignment.
/// - deadline: The time at which the assignment is due.
/// - classroom:
public init(
id: Swift.Int,
publicRepo: Swift.Bool,
title: Swift.String,
_type: Components.Schemas.SimpleClassroomAssignment._TypePayload,
inviteLink: Swift.String,
invitationsEnabled: Swift.Bool,
slug: Swift.String,
studentsAreRepoAdmins: Swift.Bool,
feedbackPullRequestsEnabled: Swift.Bool,
maxTeams: Swift.Int? = nil,
maxMembers: Swift.Int? = nil,
editor: Swift.String,
accepted: Swift.Int,
submitted: Swift.Int,
passing: Swift.Int,
language: Swift.String,
deadline: Foundation.Date? = nil,
classroom: Components.Schemas.SimpleClassroom
) {
self.id = id
self.publicRepo = publicRepo
self.title = title
self._type = _type
self.inviteLink = inviteLink
self.invitationsEnabled = invitationsEnabled
self.slug = slug
self.studentsAreRepoAdmins = studentsAreRepoAdmins
self.feedbackPullRequestsEnabled = feedbackPullRequestsEnabled
self.maxTeams = maxTeams
self.maxMembers = maxMembers
self.editor = editor
self.accepted = accepted
self.submitted = submitted
self.passing = passing
self.language = language
self.deadline = deadline
self.classroom = classroom
}
public enum CodingKeys: String, CodingKey {
case id
case publicRepo = "public_repo"
case title
case _type = "type"
case inviteLink = "invite_link"
case invitationsEnabled = "invitations_enabled"
case slug
case studentsAreRepoAdmins = "students_are_repo_admins"
case feedbackPullRequestsEnabled = "feedback_pull_requests_enabled"
case maxTeams = "max_teams"
case maxMembers = "max_members"
case editor
case accepted
case submitted
case passing
case language
case deadline
case classroom
}
}
/// A GitHub Classroom accepted assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment`.
public struct ClassroomAcceptedAssignment: Codable, Hashable, Sendable {
/// Unique identifier of the repository.
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/id`.
public var id: Swift.Int
/// Whether an accepted assignment has been submitted.
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/submitted`.
public var submitted: Swift.Bool
/// Whether a submission passed.
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/passing`.
public var passing: Swift.Bool
/// Count of student commits.
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/commit_count`.
public var commitCount: Swift.Int
/// Most recent grade.
///
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/grade`.
public var grade: Swift.String
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/students`.
public var students: [Components.Schemas.SimpleClassroomUser]
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/repository`.
public var repository: Components.Schemas.SimpleClassroomRepository
/// - Remark: Generated from `#/components/schemas/classroom-accepted-assignment/assignment`.
public var assignment: Components.Schemas.SimpleClassroomAssignment
/// Creates a new `ClassroomAcceptedAssignment`.
///
/// - Parameters:
/// - id: Unique identifier of the repository.
/// - submitted: Whether an accepted assignment has been submitted.
/// - passing: Whether a submission passed.
/// - commitCount: Count of student commits.
/// - grade: Most recent grade.
/// - students:
/// - repository:
/// - assignment:
public init(
id: Swift.Int,
submitted: Swift.Bool,
passing: Swift.Bool,
commitCount: Swift.Int,
grade: Swift.String,
students: [Components.Schemas.SimpleClassroomUser],
repository: Components.Schemas.SimpleClassroomRepository,
assignment: Components.Schemas.SimpleClassroomAssignment
) {
self.id = id
self.submitted = submitted
self.passing = passing
self.commitCount = commitCount
self.grade = grade
self.students = students
self.repository = repository
self.assignment = assignment
}
public enum CodingKeys: String, CodingKey {
case id
case submitted
case passing
case commitCount = "commit_count"
case grade
case students
case repository
case assignment
}
}
/// Grade for a student or groups GitHub Classroom assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade`.
public struct ClassroomAssignmentGrade: Codable, Hashable, Sendable {
/// Name of the assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/assignment_name`.
public var assignmentName: Swift.String
/// URL of the assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/assignment_url`.
public var assignmentUrl: Swift.String
/// URL of the starter code for the assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/starter_code_url`.
public var starterCodeUrl: Swift.String
/// GitHub username of the student
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/github_username`.
public var githubUsername: Swift.String
/// Roster identifier of the student
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/roster_identifier`.
public var rosterIdentifier: Swift.String
/// Name of the student's assignment repository
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/student_repository_name`.
public var studentRepositoryName: Swift.String
/// URL of the student's assignment repository
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/student_repository_url`.
public var studentRepositoryUrl: Swift.String
/// Timestamp of the student's assignment submission
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/submission_timestamp`.
public var submissionTimestamp: Swift.String
/// Number of points awarded to the student
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/points_awarded`.
public var pointsAwarded: Swift.Int
/// Number of points available for the assignment
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/points_available`.
public var pointsAvailable: Swift.Int
/// If a group assignment, name of the group the student is in
///
/// - Remark: Generated from `#/components/schemas/classroom-assignment-grade/group_name`.
public var groupName: Swift.String?
/// Creates a new `ClassroomAssignmentGrade`.
///
/// - Parameters:
/// - assignmentName: Name of the assignment
/// - assignmentUrl: URL of the assignment
/// - starterCodeUrl: URL of the starter code for the assignment
/// - githubUsername: GitHub username of the student
/// - rosterIdentifier: Roster identifier of the student
/// - studentRepositoryName: Name of the student's assignment repository
/// - studentRepositoryUrl: URL of the student's assignment repository
/// - submissionTimestamp: Timestamp of the student's assignment submission
/// - pointsAwarded: Number of points awarded to the student
/// - pointsAvailable: Number of points available for the assignment
/// - groupName: If a group assignment, name of the group the student is in
public init(
assignmentName: Swift.String,
assignmentUrl: Swift.String,
starterCodeUrl: Swift.String,
githubUsername: Swift.String,
rosterIdentifier: Swift.String,
studentRepositoryName: Swift.String,
studentRepositoryUrl: Swift.String,
submissionTimestamp: Swift.String,
pointsAwarded: Swift.Int,
pointsAvailable: Swift.Int,
groupName: Swift.String? = nil
) {
self.assignmentName = assignmentName
self.assignmentUrl = assignmentUrl
self.starterCodeUrl = starterCodeUrl
self.githubUsername = githubUsername
self.rosterIdentifier = rosterIdentifier
self.studentRepositoryName = studentRepositoryName
self.studentRepositoryUrl = studentRepositoryUrl
self.submissionTimestamp = submissionTimestamp
self.pointsAwarded = pointsAwarded
self.pointsAvailable = pointsAvailable
self.groupName = groupName
}
public enum CodingKeys: String, CodingKey {
case assignmentName = "assignment_name"
case assignmentUrl = "assignment_url"
case starterCodeUrl = "starter_code_url"
case githubUsername = "github_username"
case rosterIdentifier = "roster_identifier"
case studentRepositoryName = "student_repository_name"
case studentRepositoryUrl = "student_repository_url"
case submissionTimestamp = "submission_timestamp"
case pointsAwarded = "points_awarded"
case pointsAvailable = "points_available"
case groupName = "group_name"
}
}
}
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
public enum Parameters {
/// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
///
/// - Remark: Generated from `#/components/parameters/per-page`.
public typealias PerPage = Swift.Int
/// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
///
/// - Remark: Generated from `#/components/parameters/page`.
public typealias Page = Swift.Int
/// The unique identifier of the classroom assignment.
///
/// - Remark: Generated from `#/components/parameters/assignment-id`.
public typealias AssignmentId = Swift.Int
/// The unique identifier of the classroom.
///
/// - Remark: Generated from `#/components/parameters/classroom-id`.
public typealias ClassroomId = Swift.Int
}
/// Types generated from the `#/components/requestBodies` section of the OpenAPI document.
public enum RequestBodies {}
/// Types generated from the `#/components/responses` section of the OpenAPI document.
public enum Responses {
public struct NotFound: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/not_found/content`.
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/not_found/content/application\/json`.
case json(Components.Schemas.BasicError)
/// The associated value of the enum case if `self` is `.json`.
///
/// - Throws: An error if `self` is not `.json`.
/// - SeeAlso: `.json`.
public var json: Components.Schemas.BasicError {
get throws {
switch self {
case let .json(body):
return body
}
}