-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTypes.swift
More file actions
2452 lines (2448 loc) · 117 KB
/
Types.swift
File metadata and controls
2452 lines (2448 loc) · 117 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 {
/// List campaigns for an organization
///
/// Lists campaigns in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/campaigns`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`.
func campaignsListOrgCampaigns(_ input: Operations.CampaignsListOrgCampaigns.Input) async throws -> Operations.CampaignsListOrgCampaigns.Output
/// Create a campaign for an organization
///
/// Create a campaign for an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included
/// in the campaign.
///
/// - Remark: HTTP `POST /orgs/{org}/campaigns`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`.
func campaignsCreateCampaign(_ input: Operations.CampaignsCreateCampaign.Input) async throws -> Operations.CampaignsCreateCampaign.Output
/// Get a campaign for an organization
///
/// Gets a campaign for an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`.
func campaignsGetCampaignSummary(_ input: Operations.CampaignsGetCampaignSummary.Input) async throws -> Operations.CampaignsGetCampaignSummary.Output
/// Update a campaign
///
/// Updates a campaign in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`.
func campaignsUpdateCampaign(_ input: Operations.CampaignsUpdateCampaign.Input) async throws -> Operations.CampaignsUpdateCampaign.Output
/// Delete a campaign for an organization
///
/// Deletes a campaign in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`.
func campaignsDeleteCampaign(_ input: Operations.CampaignsDeleteCampaign.Input) async throws -> Operations.CampaignsDeleteCampaign.Output
}
/// Convenience overloads for operation inputs.
extension APIProtocol {
/// List campaigns for an organization
///
/// Lists campaigns in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/campaigns`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`.
public func campaignsListOrgCampaigns(
path: Operations.CampaignsListOrgCampaigns.Input.Path,
query: Operations.CampaignsListOrgCampaigns.Input.Query = .init(),
headers: Operations.CampaignsListOrgCampaigns.Input.Headers = .init()
) async throws -> Operations.CampaignsListOrgCampaigns.Output {
try await campaignsListOrgCampaigns(Operations.CampaignsListOrgCampaigns.Input(
path: path,
query: query,
headers: headers
))
}
/// Create a campaign for an organization
///
/// Create a campaign for an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// Fine-grained tokens must have the "Code scanning alerts" repository permissions (read) on all repositories included
/// in the campaign.
///
/// - Remark: HTTP `POST /orgs/{org}/campaigns`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/post(campaigns/create-campaign)`.
public func campaignsCreateCampaign(
path: Operations.CampaignsCreateCampaign.Input.Path,
headers: Operations.CampaignsCreateCampaign.Input.Headers = .init(),
body: Operations.CampaignsCreateCampaign.Input.Body
) async throws -> Operations.CampaignsCreateCampaign.Output {
try await campaignsCreateCampaign(Operations.CampaignsCreateCampaign.Input(
path: path,
headers: headers,
body: body
))
}
/// Get a campaign for an organization
///
/// Gets a campaign for an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/get(campaigns/get-campaign-summary)`.
public func campaignsGetCampaignSummary(
path: Operations.CampaignsGetCampaignSummary.Input.Path,
headers: Operations.CampaignsGetCampaignSummary.Input.Headers = .init()
) async throws -> Operations.CampaignsGetCampaignSummary.Output {
try await campaignsGetCampaignSummary(Operations.CampaignsGetCampaignSummary.Input(
path: path,
headers: headers
))
}
/// Update a campaign
///
/// Updates a campaign in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `PATCH /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/patch(campaigns/update-campaign)`.
public func campaignsUpdateCampaign(
path: Operations.CampaignsUpdateCampaign.Input.Path,
headers: Operations.CampaignsUpdateCampaign.Input.Headers = .init(),
body: Operations.CampaignsUpdateCampaign.Input.Body
) async throws -> Operations.CampaignsUpdateCampaign.Output {
try await campaignsUpdateCampaign(Operations.CampaignsUpdateCampaign.Input(
path: path,
headers: headers,
body: body
))
}
/// Delete a campaign for an organization
///
/// Deletes a campaign in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `DELETE /orgs/{org}/campaigns/{campaign_number}`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/{campaign_number}/delete(campaigns/delete-campaign)`.
public func campaignsDeleteCampaign(
path: Operations.CampaignsDeleteCampaign.Input.Path,
headers: Operations.CampaignsDeleteCampaign.Input.Headers = .init()
) async throws -> Operations.CampaignsDeleteCampaign.Output {
try await campaignsDeleteCampaign(Operations.CampaignsDeleteCampaign.Input(
path: path,
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 {
/// A GitHub user.
///
/// - Remark: Generated from `#/components/schemas/simple-user`.
public struct SimpleUser: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/simple-user/name`.
public var name: Swift.String?
/// - Remark: Generated from `#/components/schemas/simple-user/email`.
public var email: Swift.String?
/// - Remark: Generated from `#/components/schemas/simple-user/login`.
public var login: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/id`.
public var id: Swift.Int64
/// - Remark: Generated from `#/components/schemas/simple-user/node_id`.
public var nodeId: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/avatar_url`.
public var avatarUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/gravatar_id`.
public var gravatarId: Swift.String?
/// - Remark: Generated from `#/components/schemas/simple-user/url`.
public var url: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/html_url`.
public var htmlUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/followers_url`.
public var followersUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/following_url`.
public var followingUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/gists_url`.
public var gistsUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/starred_url`.
public var starredUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/subscriptions_url`.
public var subscriptionsUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/organizations_url`.
public var organizationsUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/repos_url`.
public var reposUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/events_url`.
public var eventsUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/received_events_url`.
public var receivedEventsUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/type`.
public var _type: Swift.String
/// - Remark: Generated from `#/components/schemas/simple-user/site_admin`.
public var siteAdmin: Swift.Bool
/// - Remark: Generated from `#/components/schemas/simple-user/starred_at`.
public var starredAt: Swift.String?
/// - Remark: Generated from `#/components/schemas/simple-user/user_view_type`.
public var userViewType: Swift.String?
/// Creates a new `SimpleUser`.
///
/// - Parameters:
/// - name:
/// - email:
/// - login:
/// - id:
/// - nodeId:
/// - avatarUrl:
/// - gravatarId:
/// - url:
/// - htmlUrl:
/// - followersUrl:
/// - followingUrl:
/// - gistsUrl:
/// - starredUrl:
/// - subscriptionsUrl:
/// - organizationsUrl:
/// - reposUrl:
/// - eventsUrl:
/// - receivedEventsUrl:
/// - _type:
/// - siteAdmin:
/// - starredAt:
/// - userViewType:
public init(
name: Swift.String? = nil,
email: Swift.String? = nil,
login: Swift.String,
id: Swift.Int64,
nodeId: Swift.String,
avatarUrl: Swift.String,
gravatarId: Swift.String? = nil,
url: Swift.String,
htmlUrl: Swift.String,
followersUrl: Swift.String,
followingUrl: Swift.String,
gistsUrl: Swift.String,
starredUrl: Swift.String,
subscriptionsUrl: Swift.String,
organizationsUrl: Swift.String,
reposUrl: Swift.String,
eventsUrl: Swift.String,
receivedEventsUrl: Swift.String,
_type: Swift.String,
siteAdmin: Swift.Bool,
starredAt: Swift.String? = nil,
userViewType: Swift.String? = nil
) {
self.name = name
self.email = email
self.login = login
self.id = id
self.nodeId = nodeId
self.avatarUrl = avatarUrl
self.gravatarId = gravatarId
self.url = url
self.htmlUrl = htmlUrl
self.followersUrl = followersUrl
self.followingUrl = followingUrl
self.gistsUrl = gistsUrl
self.starredUrl = starredUrl
self.subscriptionsUrl = subscriptionsUrl
self.organizationsUrl = organizationsUrl
self.reposUrl = reposUrl
self.eventsUrl = eventsUrl
self.receivedEventsUrl = receivedEventsUrl
self._type = _type
self.siteAdmin = siteAdmin
self.starredAt = starredAt
self.userViewType = userViewType
}
public enum CodingKeys: String, CodingKey {
case name
case email
case login
case id
case nodeId = "node_id"
case avatarUrl = "avatar_url"
case gravatarId = "gravatar_id"
case url
case htmlUrl = "html_url"
case followersUrl = "followers_url"
case followingUrl = "following_url"
case gistsUrl = "gists_url"
case starredUrl = "starred_url"
case subscriptionsUrl = "subscriptions_url"
case organizationsUrl = "organizations_url"
case reposUrl = "repos_url"
case eventsUrl = "events_url"
case receivedEventsUrl = "received_events_url"
case _type = "type"
case siteAdmin = "site_admin"
case starredAt = "starred_at"
case userViewType = "user_view_type"
}
}
/// 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
}
}
/// Indicates whether a campaign is open or closed
///
/// - Remark: Generated from `#/components/schemas/campaign-state`.
@frozen public enum CampaignState: String, Codable, Hashable, Sendable, CaseIterable {
case open = "open"
case closed = "closed"
}
/// Groups of organization members that gives permissions on specified repositories.
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple`.
public struct NullableTeamSimple: Codable, Hashable, Sendable {
/// Unique identifier of the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/id`.
public var id: Swift.Int
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/node_id`.
public var nodeId: Swift.String
/// URL for the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/url`.
public var url: Swift.String
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/members_url`.
public var membersUrl: Swift.String
/// Name of the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/name`.
public var name: Swift.String
/// Description of the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/description`.
public var description: Swift.String?
/// Permission that the team will have for its repositories
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/permission`.
public var permission: Swift.String
/// The level of privacy this team should have
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/privacy`.
public var privacy: Swift.String?
/// The notification setting the team has set
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/notification_setting`.
public var notificationSetting: Swift.String?
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/html_url`.
public var htmlUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/repositories_url`.
public var repositoriesUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/slug`.
public var slug: Swift.String
/// Distinguished Name (DN) that team maps to within LDAP environment
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/ldap_dn`.
public var ldapDn: Swift.String?
/// The ownership type of the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`.
@frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable {
case enterprise = "enterprise"
case organization = "organization"
}
/// The ownership type of the team
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/type`.
public var _type: Components.Schemas.NullableTeamSimple._TypePayload
/// Unique identifier of the organization to which this team belongs
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/organization_id`.
public var organizationId: Swift.Int?
/// Unique identifier of the enterprise to which this team belongs
///
/// - Remark: Generated from `#/components/schemas/nullable-team-simple/enterprise_id`.
public var enterpriseId: Swift.Int?
/// Creates a new `NullableTeamSimple`.
///
/// - Parameters:
/// - id: Unique identifier of the team
/// - nodeId:
/// - url: URL for the team
/// - membersUrl:
/// - name: Name of the team
/// - description: Description of the team
/// - permission: Permission that the team will have for its repositories
/// - privacy: The level of privacy this team should have
/// - notificationSetting: The notification setting the team has set
/// - htmlUrl:
/// - repositoriesUrl:
/// - slug:
/// - ldapDn: Distinguished Name (DN) that team maps to within LDAP environment
/// - _type: The ownership type of the team
/// - organizationId: Unique identifier of the organization to which this team belongs
/// - enterpriseId: Unique identifier of the enterprise to which this team belongs
public init(
id: Swift.Int,
nodeId: Swift.String,
url: Swift.String,
membersUrl: Swift.String,
name: Swift.String,
description: Swift.String? = nil,
permission: Swift.String,
privacy: Swift.String? = nil,
notificationSetting: Swift.String? = nil,
htmlUrl: Swift.String,
repositoriesUrl: Swift.String,
slug: Swift.String,
ldapDn: Swift.String? = nil,
_type: Components.Schemas.NullableTeamSimple._TypePayload,
organizationId: Swift.Int? = nil,
enterpriseId: Swift.Int? = nil
) {
self.id = id
self.nodeId = nodeId
self.url = url
self.membersUrl = membersUrl
self.name = name
self.description = description
self.permission = permission
self.privacy = privacy
self.notificationSetting = notificationSetting
self.htmlUrl = htmlUrl
self.repositoriesUrl = repositoriesUrl
self.slug = slug
self.ldapDn = ldapDn
self._type = _type
self.organizationId = organizationId
self.enterpriseId = enterpriseId
}
public enum CodingKeys: String, CodingKey {
case id
case nodeId = "node_id"
case url
case membersUrl = "members_url"
case name
case description
case permission
case privacy
case notificationSetting = "notification_setting"
case htmlUrl = "html_url"
case repositoriesUrl = "repositories_url"
case slug
case ldapDn = "ldap_dn"
case _type = "type"
case organizationId = "organization_id"
case enterpriseId = "enterprise_id"
}
}
/// Groups of organization members that gives permissions on specified repositories.
///
/// - Remark: Generated from `#/components/schemas/team`.
public struct Team: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/team/id`.
public var id: Swift.Int
/// - Remark: Generated from `#/components/schemas/team/node_id`.
public var nodeId: Swift.String
/// - Remark: Generated from `#/components/schemas/team/name`.
public var name: Swift.String
/// - Remark: Generated from `#/components/schemas/team/slug`.
public var slug: Swift.String
/// - Remark: Generated from `#/components/schemas/team/description`.
public var description: Swift.String?
/// - Remark: Generated from `#/components/schemas/team/privacy`.
public var privacy: Swift.String?
/// - Remark: Generated from `#/components/schemas/team/notification_setting`.
public var notificationSetting: Swift.String?
/// - Remark: Generated from `#/components/schemas/team/permission`.
public var permission: Swift.String
/// - Remark: Generated from `#/components/schemas/team/permissions`.
public struct PermissionsPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/team/permissions/pull`.
public var pull: Swift.Bool
/// - Remark: Generated from `#/components/schemas/team/permissions/triage`.
public var triage: Swift.Bool
/// - Remark: Generated from `#/components/schemas/team/permissions/push`.
public var push: Swift.Bool
/// - Remark: Generated from `#/components/schemas/team/permissions/maintain`.
public var maintain: Swift.Bool
/// - Remark: Generated from `#/components/schemas/team/permissions/admin`.
public var admin: Swift.Bool
/// Creates a new `PermissionsPayload`.
///
/// - Parameters:
/// - pull:
/// - triage:
/// - push:
/// - maintain:
/// - admin:
public init(
pull: Swift.Bool,
triage: Swift.Bool,
push: Swift.Bool,
maintain: Swift.Bool,
admin: Swift.Bool
) {
self.pull = pull
self.triage = triage
self.push = push
self.maintain = maintain
self.admin = admin
}
public enum CodingKeys: String, CodingKey {
case pull
case triage
case push
case maintain
case admin
}
}
/// - Remark: Generated from `#/components/schemas/team/permissions`.
public var permissions: Components.Schemas.Team.PermissionsPayload?
/// - Remark: Generated from `#/components/schemas/team/url`.
public var url: Swift.String
/// - Remark: Generated from `#/components/schemas/team/html_url`.
public var htmlUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/team/members_url`.
public var membersUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/team/repositories_url`.
public var repositoriesUrl: Swift.String
/// The ownership type of the team
///
/// - Remark: Generated from `#/components/schemas/team/type`.
@frozen public enum _TypePayload: String, Codable, Hashable, Sendable, CaseIterable {
case enterprise = "enterprise"
case organization = "organization"
}
/// The ownership type of the team
///
/// - Remark: Generated from `#/components/schemas/team/type`.
public var _type: Components.Schemas.Team._TypePayload
/// Unique identifier of the organization to which this team belongs
///
/// - Remark: Generated from `#/components/schemas/team/organization_id`.
public var organizationId: Swift.Int?
/// Unique identifier of the enterprise to which this team belongs
///
/// - Remark: Generated from `#/components/schemas/team/enterprise_id`.
public var enterpriseId: Swift.Int?
/// - Remark: Generated from `#/components/schemas/team/parent`.
public var parent: Components.Schemas.NullableTeamSimple?
/// Creates a new `Team`.
///
/// - Parameters:
/// - id:
/// - nodeId:
/// - name:
/// - slug:
/// - description:
/// - privacy:
/// - notificationSetting:
/// - permission:
/// - permissions:
/// - url:
/// - htmlUrl:
/// - membersUrl:
/// - repositoriesUrl:
/// - _type: The ownership type of the team
/// - organizationId: Unique identifier of the organization to which this team belongs
/// - enterpriseId: Unique identifier of the enterprise to which this team belongs
/// - parent:
public init(
id: Swift.Int,
nodeId: Swift.String,
name: Swift.String,
slug: Swift.String,
description: Swift.String? = nil,
privacy: Swift.String? = nil,
notificationSetting: Swift.String? = nil,
permission: Swift.String,
permissions: Components.Schemas.Team.PermissionsPayload? = nil,
url: Swift.String,
htmlUrl: Swift.String,
membersUrl: Swift.String,
repositoriesUrl: Swift.String,
_type: Components.Schemas.Team._TypePayload,
organizationId: Swift.Int? = nil,
enterpriseId: Swift.Int? = nil,
parent: Components.Schemas.NullableTeamSimple? = nil
) {
self.id = id
self.nodeId = nodeId
self.name = name
self.slug = slug
self.description = description
self.privacy = privacy
self.notificationSetting = notificationSetting
self.permission = permission
self.permissions = permissions
self.url = url
self.htmlUrl = htmlUrl
self.membersUrl = membersUrl
self.repositoriesUrl = repositoriesUrl
self._type = _type
self.organizationId = organizationId
self.enterpriseId = enterpriseId
self.parent = parent
}
public enum CodingKeys: String, CodingKey {
case id
case nodeId = "node_id"
case name
case slug
case description
case privacy
case notificationSetting = "notification_setting"
case permission
case permissions
case url
case htmlUrl = "html_url"
case membersUrl = "members_url"
case repositoriesUrl = "repositories_url"
case _type = "type"
case organizationId = "organization_id"
case enterpriseId = "enterprise_id"
case parent
}
}
/// The campaign metadata and alert stats.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary`.
public struct CampaignSummary: Codable, Hashable, Sendable {
/// The number of the newly created campaign
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/number`.
public var number: Swift.Int
/// The date and time the campaign was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/created_at`.
public var createdAt: Foundation.Date
/// The date and time the campaign was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/updated_at`.
public var updatedAt: Foundation.Date
/// The campaign name
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/name`.
public var name: Swift.String?
/// The campaign description
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/description`.
public var description: Swift.String
/// The campaign managers
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/managers`.
public var managers: [Components.Schemas.SimpleUser]
/// The campaign team managers
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/team_managers`.
public var teamManagers: [Components.Schemas.Team]?
/// The date and time the campaign was published, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/published_at`.
public var publishedAt: Foundation.Date?
/// The date and time the campaign has ended, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/ends_at`.
public var endsAt: Foundation.Date
/// The date and time the campaign was closed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the campaign is still open.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/closed_at`.
public var closedAt: Foundation.Date?
/// - Remark: Generated from `#/components/schemas/campaign-summary/state`.
public var state: Components.Schemas.CampaignState
/// The contact link of the campaign.
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/contact_link`.
public var contactLink: Swift.String?
/// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats`.
public struct AlertStatsPayload: Codable, Hashable, Sendable {
/// The number of open alerts
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/open_count`.
public var openCount: Swift.Int
/// The number of closed alerts
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/closed_count`.
public var closedCount: Swift.Int
/// The number of in-progress alerts
///
/// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats/in_progress_count`.
public var inProgressCount: Swift.Int
/// Creates a new `AlertStatsPayload`.
///
/// - Parameters:
/// - openCount: The number of open alerts
/// - closedCount: The number of closed alerts
/// - inProgressCount: The number of in-progress alerts
public init(
openCount: Swift.Int,
closedCount: Swift.Int,
inProgressCount: Swift.Int
) {
self.openCount = openCount
self.closedCount = closedCount
self.inProgressCount = inProgressCount
}
public enum CodingKeys: String, CodingKey {
case openCount = "open_count"
case closedCount = "closed_count"
case inProgressCount = "in_progress_count"
}
public init(from decoder: any Swift.Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.openCount = try container.decode(
Swift.Int.self,
forKey: .openCount
)
self.closedCount = try container.decode(
Swift.Int.self,
forKey: .closedCount
)
self.inProgressCount = try container.decode(
Swift.Int.self,
forKey: .inProgressCount
)
try decoder.ensureNoAdditionalProperties(knownKeys: [
"open_count",
"closed_count",
"in_progress_count"
])
}
}
/// - Remark: Generated from `#/components/schemas/campaign-summary/alert_stats`.
public var alertStats: Components.Schemas.CampaignSummary.AlertStatsPayload?
/// Creates a new `CampaignSummary`.
///
/// - Parameters:
/// - number: The number of the newly created campaign
/// - createdAt: The date and time the campaign was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
/// - updatedAt: The date and time the campaign was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
/// - name: The campaign name
/// - description: The campaign description
/// - managers: The campaign managers
/// - teamManagers: The campaign team managers
/// - publishedAt: The date and time the campaign was published, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
/// - endsAt: The date and time the campaign has ended, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
/// - closedAt: The date and time the campaign was closed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the campaign is still open.
/// - state:
/// - contactLink: The contact link of the campaign.
/// - alertStats:
public init(
number: Swift.Int,
createdAt: Foundation.Date,
updatedAt: Foundation.Date,
name: Swift.String? = nil,
description: Swift.String,
managers: [Components.Schemas.SimpleUser],
teamManagers: [Components.Schemas.Team]? = nil,
publishedAt: Foundation.Date? = nil,
endsAt: Foundation.Date,
closedAt: Foundation.Date? = nil,
state: Components.Schemas.CampaignState,
contactLink: Swift.String? = nil,
alertStats: Components.Schemas.CampaignSummary.AlertStatsPayload? = nil
) {
self.number = number
self.createdAt = createdAt
self.updatedAt = updatedAt
self.name = name
self.description = description
self.managers = managers
self.teamManagers = teamManagers
self.publishedAt = publishedAt
self.endsAt = endsAt
self.closedAt = closedAt
self.state = state
self.contactLink = contactLink
self.alertStats = alertStats
}
public enum CodingKeys: String, CodingKey {
case number
case createdAt = "created_at"
case updatedAt = "updated_at"
case name
case description
case managers
case teamManagers = "team_managers"
case publishedAt = "published_at"
case endsAt = "ends_at"
case closedAt = "closed_at"
case state
case contactLink = "contact_link"
case alertStats = "alert_stats"
}
}
}
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
public enum Parameters {
/// The direction to sort the results by.
///
/// - Remark: Generated from `#/components/parameters/direction`.
@frozen public enum Direction: String, Codable, Hashable, Sendable, CaseIterable {
case asc = "asc"
case desc = "desc"
}
/// 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 organization name. The name is not case sensitive.
///
/// - Remark: Generated from `#/components/parameters/org`.
public typealias Org = Swift.String
}
/// 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
}
}
}
}
/// Received HTTP response body
public var body: Components.Responses.NotFound.Body
/// Creates a new `NotFound`.
///
/// - Parameters:
/// - body: Received HTTP response body
public init(body: Components.Responses.NotFound.Body) {
self.body = body
}
}
public struct ServiceUnavailable: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/service_unavailable/content`.
@frozen public enum Body: Sendable, Hashable {
/// - Remark: Generated from `#/components/responses/service_unavailable/content/json`.
public struct JsonPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/responses/service_unavailable/content/json/code`.
public var code: Swift.String?
/// - Remark: Generated from `#/components/responses/service_unavailable/content/json/message`.
public var message: Swift.String?
/// - Remark: Generated from `#/components/responses/service_unavailable/content/json/documentation_url`.
public var documentationUrl: Swift.String?
/// Creates a new `JsonPayload`.
///
/// - Parameters:
/// - code:
/// - message:
/// - documentationUrl:
public init(
code: Swift.String? = nil,
message: Swift.String? = nil,
documentationUrl: Swift.String? = nil
) {
self.code = code
self.message = message
self.documentationUrl = documentationUrl
}
public enum CodingKeys: String, CodingKey {
case code
case message
case documentationUrl = "documentation_url"
}
}
/// - Remark: Generated from `#/components/responses/service_unavailable/content/application\/json`.
case json(Components.Responses.ServiceUnavailable.Body.JsonPayload)
/// 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.Responses.ServiceUnavailable.Body.JsonPayload {
get throws {
switch self {
case let .json(body):
return body
}
}
}
}
/// Received HTTP response body
public var body: Components.Responses.ServiceUnavailable.Body
/// Creates a new `ServiceUnavailable`.
///
/// - Parameters:
/// - body: Received HTTP response body
public init(body: Components.Responses.ServiceUnavailable.Body) {
self.body = body
}
}
}
/// Types generated from the `#/components/headers` section of the OpenAPI document.
public enum Headers {
/// - Remark: Generated from `#/components/headers/link`.
public typealias Link = Swift.String
}
}
/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
public enum Operations {
/// List campaigns for an organization
///
/// Lists campaigns in an organization.
///
/// The authenticated user must be an owner or security manager for the organization to use this endpoint.
///
/// OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint.
///
/// - Remark: HTTP `GET /orgs/{org}/campaigns`.
/// - Remark: Generated from `#/paths//orgs/{org}/campaigns/get(campaigns/list-org-campaigns)`.