-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTypes.swift
More file actions
5389 lines (5385 loc) · 280 KB
/
Types.swift
File metadata and controls
5389 lines (5385 loc) · 280 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 all budgets for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager.
/// Each page returns up to 10 budgets.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`.
func billingGetAllBudgetsOrg(_ input: Operations.BillingGetAllBudgetsOrg.Input) async throws -> Operations.BillingGetAllBudgetsOrg.Output
/// Get a budget by ID for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a budget by ID. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`.
func billingGetBudgetOrg(_ input: Operations.BillingGetBudgetOrg.Input) async throws -> Operations.BillingGetBudgetOrg.Output
/// Update a budget for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`.
func billingUpdateBudgetOrg(_ input: Operations.BillingUpdateBudgetOrg.Input) async throws -> Operations.BillingUpdateBudgetOrg.Output
/// Delete a budget for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`.
func billingDeleteBudgetOrg(_ input: Operations.BillingDeleteBudgetOrg.Input) async throws -> Operations.BillingDeleteBudgetOrg.Output
/// Get billing premium request usage report for an organization
///
/// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`.
func billingGetGithubBillingPremiumRequestUsageReportOrg(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output
/// Get billing usage report for an organization
///
/// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)."
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`.
func billingGetGithubBillingUsageReportOrg(_ input: Operations.BillingGetGithubBillingUsageReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output
/// Get billing usage summary for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`.
func billingGetGithubBillingUsageSummaryReportOrg(_ input: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportOrg.Output
/// Get billing premium request usage report for a user
///
/// Gets a report of premium request usage for a user.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`.
func billingGetGithubBillingPremiumRequestUsageReportUser(_ input: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output
/// Get billing usage report for a user
///
/// Gets a report of the total usage for a user.
///
/// **Note:** This endpoint is only available to users with access to the enhanced billing platform.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/usage`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`.
func billingGetGithubBillingUsageReportUser(_ input: Operations.BillingGetGithubBillingUsageReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output
/// Get billing usage summary for a user
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a summary report of usage for a user.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`.
func billingGetGithubBillingUsageSummaryReportUser(_ input: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportUser.Output
}
/// Convenience overloads for operation inputs.
extension APIProtocol {
/// Get all budgets for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets all budgets for an organization. The authenticated user must be an organization admin or billing manager.
/// Each page returns up to 10 budgets.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/get(billing/get-all-budgets-org)`.
public func billingGetAllBudgetsOrg(
path: Operations.BillingGetAllBudgetsOrg.Input.Path,
query: Operations.BillingGetAllBudgetsOrg.Input.Query = .init(),
headers: Operations.BillingGetAllBudgetsOrg.Input.Headers = .init()
) async throws -> Operations.BillingGetAllBudgetsOrg.Output {
try await billingGetAllBudgetsOrg(Operations.BillingGetAllBudgetsOrg.Input(
path: path,
query: query,
headers: headers
))
}
/// Get a budget by ID for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a budget by ID. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/get(billing/get-budget-org)`.
public func billingGetBudgetOrg(
path: Operations.BillingGetBudgetOrg.Input.Path,
headers: Operations.BillingGetBudgetOrg.Input.Headers = .init()
) async throws -> Operations.BillingGetBudgetOrg.Output {
try await billingGetBudgetOrg(Operations.BillingGetBudgetOrg.Input(
path: path,
headers: headers
))
}
/// Update a budget for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Updates an existing budget for an organization. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `PATCH /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/patch(billing/update-budget-org)`.
public func billingUpdateBudgetOrg(
path: Operations.BillingUpdateBudgetOrg.Input.Path,
headers: Operations.BillingUpdateBudgetOrg.Input.Headers = .init(),
body: Operations.BillingUpdateBudgetOrg.Input.Body
) async throws -> Operations.BillingUpdateBudgetOrg.Output {
try await billingUpdateBudgetOrg(Operations.BillingUpdateBudgetOrg.Input(
path: path,
headers: headers,
body: body
))
}
/// Delete a budget for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Deletes a budget by ID for an organization. The authenticated user must be an organization admin or billing manager.
///
/// - Remark: HTTP `DELETE /organizations/{org}/settings/billing/budgets/{budget_id}`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/budgets/{budget_id}/delete(billing/delete-budget-org)`.
public func billingDeleteBudgetOrg(
path: Operations.BillingDeleteBudgetOrg.Input.Path,
headers: Operations.BillingDeleteBudgetOrg.Input.Headers = .init()
) async throws -> Operations.BillingDeleteBudgetOrg.Output {
try await billingDeleteBudgetOrg(Operations.BillingDeleteBudgetOrg.Input(
path: path,
headers: headers
))
}
/// Get billing premium request usage report for an organization
///
/// Gets a report of premium request usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/premium_request/usage`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-org)`.
public func billingGetGithubBillingPremiumRequestUsageReportOrg(
path: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Path,
query: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Output {
try await billingGetGithubBillingPremiumRequestUsageReportOrg(Operations.BillingGetGithubBillingPremiumRequestUsageReportOrg.Input(
path: path,
query: query,
headers: headers
))
}
/// Get billing usage report for an organization
///
/// Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "[About the enhanced billing platform](https://docs.github.com/billing/using-the-new-billing-platform)."
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/get(billing/get-github-billing-usage-report-org)`.
public func billingGetGithubBillingUsageReportOrg(
path: Operations.BillingGetGithubBillingUsageReportOrg.Input.Path,
query: Operations.BillingGetGithubBillingUsageReportOrg.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingUsageReportOrg.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingUsageReportOrg.Output {
try await billingGetGithubBillingUsageReportOrg(Operations.BillingGetGithubBillingUsageReportOrg.Input(
path: path,
query: query,
headers: headers
))
}
/// Get billing usage summary for an organization
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a summary report of usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /organizations/{org}/settings/billing/usage/summary`.
/// - Remark: Generated from `#/paths//organizations/{org}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-org)`.
public func billingGetGithubBillingUsageSummaryReportOrg(
path: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Path,
query: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportOrg.Output {
try await billingGetGithubBillingUsageSummaryReportOrg(Operations.BillingGetGithubBillingUsageSummaryReportOrg.Input(
path: path,
query: query,
headers: headers
))
}
/// Get billing premium request usage report for a user
///
/// Gets a report of premium request usage for a user.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/premium_request/usage`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/premium_request/usage/get(billing/get-github-billing-premium-request-usage-report-user)`.
public func billingGetGithubBillingPremiumRequestUsageReportUser(
path: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Path,
query: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Output {
try await billingGetGithubBillingPremiumRequestUsageReportUser(Operations.BillingGetGithubBillingPremiumRequestUsageReportUser.Input(
path: path,
query: query,
headers: headers
))
}
/// Get billing usage report for a user
///
/// Gets a report of the total usage for a user.
///
/// **Note:** This endpoint is only available to users with access to the enhanced billing platform.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/usage`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/get(billing/get-github-billing-usage-report-user)`.
public func billingGetGithubBillingUsageReportUser(
path: Operations.BillingGetGithubBillingUsageReportUser.Input.Path,
query: Operations.BillingGetGithubBillingUsageReportUser.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingUsageReportUser.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingUsageReportUser.Output {
try await billingGetGithubBillingUsageReportUser(Operations.BillingGetGithubBillingUsageReportUser.Input(
path: path,
query: query,
headers: headers
))
}
/// Get billing usage summary for a user
///
/// > [!NOTE]
/// > This endpoint is in public preview and is subject to change.
///
/// Gets a summary report of usage for a user.
///
/// **Note:** Only data from the past 24 months is accessible via this endpoint.
///
/// - Remark: HTTP `GET /users/{username}/settings/billing/usage/summary`.
/// - Remark: Generated from `#/paths//users/{username}/settings/billing/usage/summary/get(billing/get-github-billing-usage-summary-report-user)`.
public func billingGetGithubBillingUsageSummaryReportUser(
path: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Path,
query: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Query = .init(),
headers: Operations.BillingGetGithubBillingUsageSummaryReportUser.Input.Headers = .init()
) async throws -> Operations.BillingGetGithubBillingUsageSummaryReportUser.Output {
try await billingGetGithubBillingUsageSummaryReportUser(Operations.BillingGetGithubBillingUsageSummaryReportUser.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
}
}
/// Scim Error
///
/// - Remark: Generated from `#/components/schemas/scim-error`.
public struct ScimError: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/scim-error/message`.
public var message: Swift.String?
/// - Remark: Generated from `#/components/schemas/scim-error/documentation_url`.
public var documentationUrl: Swift.String?
/// - Remark: Generated from `#/components/schemas/scim-error/detail`.
public var detail: Swift.String?
/// - Remark: Generated from `#/components/schemas/scim-error/status`.
public var status: Swift.Int?
/// - Remark: Generated from `#/components/schemas/scim-error/scimType`.
public var scimType: Swift.String?
/// - Remark: Generated from `#/components/schemas/scim-error/schemas`.
public var schemas: [Swift.String]?
/// Creates a new `ScimError`.
///
/// - Parameters:
/// - message:
/// - documentationUrl:
/// - detail:
/// - status:
/// - scimType:
/// - schemas:
public init(
message: Swift.String? = nil,
documentationUrl: Swift.String? = nil,
detail: Swift.String? = nil,
status: Swift.Int? = nil,
scimType: Swift.String? = nil,
schemas: [Swift.String]? = nil
) {
self.message = message
self.documentationUrl = documentationUrl
self.detail = detail
self.status = status
self.scimType = scimType
self.schemas = schemas
}
public enum CodingKeys: String, CodingKey {
case message
case documentationUrl = "documentation_url"
case detail
case status
case scimType
case schemas
}
}
/// Validation Error
///
/// - Remark: Generated from `#/components/schemas/validation-error`.
public struct ValidationError: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/validation-error/message`.
public var message: Swift.String
/// - Remark: Generated from `#/components/schemas/validation-error/documentation_url`.
public var documentationUrl: Swift.String
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload`.
public struct ErrorsPayloadPayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/resource`.
public var resource: Swift.String?
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/field`.
public var field: Swift.String?
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/message`.
public var message: Swift.String?
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/code`.
public var code: Swift.String
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/index`.
public var index: Swift.Int?
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`.
@frozen public enum ValuePayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case1`.
case case1(Swift.String?)
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case2`.
case case2(Swift.Int?)
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value/case3`.
case case3([Swift.String]?)
public init(from decoder: any Swift.Decoder) throws {
var errors: [any Swift.Error] = []
do {
self = .case1(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
do {
self = .case2(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
do {
self = .case3(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
throw Swift.DecodingError.failedToDecodeOneOfSchema(
type: Self.self,
codingPath: decoder.codingPath,
errors: errors
)
}
public func encode(to encoder: any Swift.Encoder) throws {
switch self {
case let .case1(value):
try encoder.encodeToSingleValueContainer(value)
case let .case2(value):
try encoder.encodeToSingleValueContainer(value)
case let .case3(value):
try encoder.encodeToSingleValueContainer(value)
}
}
}
/// - Remark: Generated from `#/components/schemas/validation-error/ErrorsPayload/value`.
public var value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload?
/// Creates a new `ErrorsPayloadPayload`.
///
/// - Parameters:
/// - resource:
/// - field:
/// - message:
/// - code:
/// - index:
/// - value:
public init(
resource: Swift.String? = nil,
field: Swift.String? = nil,
message: Swift.String? = nil,
code: Swift.String,
index: Swift.Int? = nil,
value: Components.Schemas.ValidationError.ErrorsPayloadPayload.ValuePayload? = nil
) {
self.resource = resource
self.field = field
self.message = message
self.code = code
self.index = index
self.value = value
}
public enum CodingKeys: String, CodingKey {
case resource
case field
case message
case code
case index
case value
}
}
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
public typealias ErrorsPayload = [Components.Schemas.ValidationError.ErrorsPayloadPayload]
/// - Remark: Generated from `#/components/schemas/validation-error/errors`.
public var errors: Components.Schemas.ValidationError.ErrorsPayload?
/// Creates a new `ValidationError`.
///
/// - Parameters:
/// - message:
/// - documentationUrl:
/// - errors:
public init(
message: Swift.String,
documentationUrl: Swift.String,
errors: Components.Schemas.ValidationError.ErrorsPayload? = nil
) {
self.message = message
self.documentationUrl = documentationUrl
self.errors = errors
}
public enum CodingKeys: String, CodingKey {
case message
case documentationUrl = "documentation_url"
case errors
}
}
/// - Remark: Generated from `#/components/schemas/budget`.
public struct Budget: Codable, Hashable, Sendable {
/// The unique identifier for the budget
///
/// - Remark: Generated from `#/components/schemas/budget/id`.
public var id: Swift.String
/// The type of pricing for the budget
///
/// - Remark: Generated from `#/components/schemas/budget/budget_type`.
@frozen public enum BudgetTypePayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/budget/budget_type/case1`.
@frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable {
case skuPricing = "SkuPricing"
}
/// - Remark: Generated from `#/components/schemas/budget/budget_type/case1`.
case case1(Components.Schemas.Budget.BudgetTypePayload.Case1Payload)
/// - Remark: Generated from `#/components/schemas/budget/budget_type/case2`.
@frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable {
case productPricing = "ProductPricing"
}
/// - Remark: Generated from `#/components/schemas/budget/budget_type/case2`.
case case2(Components.Schemas.Budget.BudgetTypePayload.Case2Payload)
public init(from decoder: any Swift.Decoder) throws {
var errors: [any Swift.Error] = []
do {
self = .case1(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
do {
self = .case2(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
throw Swift.DecodingError.failedToDecodeOneOfSchema(
type: Self.self,
codingPath: decoder.codingPath,
errors: errors
)
}
public func encode(to encoder: any Swift.Encoder) throws {
switch self {
case let .case1(value):
try encoder.encodeToSingleValueContainer(value)
case let .case2(value):
try encoder.encodeToSingleValueContainer(value)
}
}
}
/// The type of pricing for the budget
///
/// - Remark: Generated from `#/components/schemas/budget/budget_type`.
public var budgetType: Components.Schemas.Budget.BudgetTypePayload
/// The budget amount limit in whole dollars. For license-based products, this represents the number of licenses.
///
/// - Remark: Generated from `#/components/schemas/budget/budget_amount`.
public var budgetAmount: Swift.Int
/// The type of limit enforcement for the budget
///
/// - Remark: Generated from `#/components/schemas/budget/prevent_further_usage`.
public var preventFurtherUsage: Swift.Bool
/// The scope of the budget (enterprise, organization, repository, cost center)
///
/// - Remark: Generated from `#/components/schemas/budget/budget_scope`.
public var budgetScope: Swift.String
/// The name of the entity for the budget (enterprise does not require a name).
///
/// - Remark: Generated from `#/components/schemas/budget/budget_entity_name`.
public var budgetEntityName: Swift.String?
/// A single product or sku to apply the budget to.
///
/// - Remark: Generated from `#/components/schemas/budget/budget_product_sku`.
public var budgetProductSku: Swift.String
/// - Remark: Generated from `#/components/schemas/budget/budget_alerting`.
public struct BudgetAlertingPayload: Codable, Hashable, Sendable {
/// Whether alerts are enabled for this budget
///
/// - Remark: Generated from `#/components/schemas/budget/budget_alerting/will_alert`.
public var willAlert: Swift.Bool
/// Array of user login names who will receive alerts
///
/// - Remark: Generated from `#/components/schemas/budget/budget_alerting/alert_recipients`.
public var alertRecipients: [Swift.String]
/// Creates a new `BudgetAlertingPayload`.
///
/// - Parameters:
/// - willAlert: Whether alerts are enabled for this budget
/// - alertRecipients: Array of user login names who will receive alerts
public init(
willAlert: Swift.Bool,
alertRecipients: [Swift.String]
) {
self.willAlert = willAlert
self.alertRecipients = alertRecipients
}
public enum CodingKeys: String, CodingKey {
case willAlert = "will_alert"
case alertRecipients = "alert_recipients"
}
}
/// - Remark: Generated from `#/components/schemas/budget/budget_alerting`.
public var budgetAlerting: Components.Schemas.Budget.BudgetAlertingPayload
/// Creates a new `Budget`.
///
/// - Parameters:
/// - id: The unique identifier for the budget
/// - budgetType: The type of pricing for the budget
/// - budgetAmount: The budget amount limit in whole dollars. For license-based products, this represents the number of licenses.
/// - preventFurtherUsage: The type of limit enforcement for the budget
/// - budgetScope: The scope of the budget (enterprise, organization, repository, cost center)
/// - budgetEntityName: The name of the entity for the budget (enterprise does not require a name).
/// - budgetProductSku: A single product or sku to apply the budget to.
/// - budgetAlerting:
public init(
id: Swift.String,
budgetType: Components.Schemas.Budget.BudgetTypePayload,
budgetAmount: Swift.Int,
preventFurtherUsage: Swift.Bool,
budgetScope: Swift.String,
budgetEntityName: Swift.String? = nil,
budgetProductSku: Swift.String,
budgetAlerting: Components.Schemas.Budget.BudgetAlertingPayload
) {
self.id = id
self.budgetType = budgetType
self.budgetAmount = budgetAmount
self.preventFurtherUsage = preventFurtherUsage
self.budgetScope = budgetScope
self.budgetEntityName = budgetEntityName
self.budgetProductSku = budgetProductSku
self.budgetAlerting = budgetAlerting
}
public enum CodingKeys: String, CodingKey {
case id
case budgetType = "budget_type"
case budgetAmount = "budget_amount"
case preventFurtherUsage = "prevent_further_usage"
case budgetScope = "budget_scope"
case budgetEntityName = "budget_entity_name"
case budgetProductSku = "budget_product_sku"
case budgetAlerting = "budget_alerting"
}
}
/// - Remark: Generated from `#/components/schemas/get_all_budgets`.
public struct GetAllBudgets: Codable, Hashable, Sendable {
/// Array of budget objects for the enterprise
///
/// - Remark: Generated from `#/components/schemas/get_all_budgets/budgets`.
public var budgets: [Components.Schemas.Budget]
/// Indicates if there are more pages of results available (maps to hasNextPage from billing platform)
///
/// - Remark: Generated from `#/components/schemas/get_all_budgets/has_next_page`.
public var hasNextPage: Swift.Bool?
/// Total number of budgets matching the query
///
/// - Remark: Generated from `#/components/schemas/get_all_budgets/total_count`.
public var totalCount: Swift.Int?
/// Creates a new `GetAllBudgets`.
///
/// - Parameters:
/// - budgets: Array of budget objects for the enterprise
/// - hasNextPage: Indicates if there are more pages of results available (maps to hasNextPage from billing platform)
/// - totalCount: Total number of budgets matching the query
public init(
budgets: [Components.Schemas.Budget],
hasNextPage: Swift.Bool? = nil,
totalCount: Swift.Int? = nil
) {
self.budgets = budgets
self.hasNextPage = hasNextPage
self.totalCount = totalCount
}
public enum CodingKeys: String, CodingKey {
case budgets
case hasNextPage = "has_next_page"
case totalCount = "total_count"
}
}
/// - Remark: Generated from `#/components/schemas/get-budget`.
public struct GetBudget: Codable, Hashable, Sendable {
/// ID of the budget.
///
/// - Remark: Generated from `#/components/schemas/get-budget/id`.
public var id: Swift.String
/// The type of scope for the budget
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_scope`.
@frozen public enum BudgetScopePayload: String, Codable, Hashable, Sendable, CaseIterable {
case enterprise = "enterprise"
case organization = "organization"
case repository = "repository"
case costCenter = "cost_center"
}
/// The type of scope for the budget
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_scope`.
public var budgetScope: Components.Schemas.GetBudget.BudgetScopePayload
/// The name of the entity to apply the budget to
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_entity_name`.
public var budgetEntityName: Swift.String
/// The budget amount in whole dollars. For license-based products, this represents the number of licenses.
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_amount`.
public var budgetAmount: Swift.Int
/// Whether to prevent additional spending once the budget is exceeded
///
/// - Remark: Generated from `#/components/schemas/get-budget/prevent_further_usage`.
public var preventFurtherUsage: Swift.Bool
/// A single product or sku to apply the budget to.
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_product_sku`.
public var budgetProductSku: Swift.String
/// The type of pricing for the budget
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type`.
@frozen public enum BudgetTypePayload: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case1`.
@frozen public enum Case1Payload: String, Codable, Hashable, Sendable, CaseIterable {
case productPricing = "ProductPricing"
}
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case1`.
case case1(Components.Schemas.GetBudget.BudgetTypePayload.Case1Payload)
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case2`.
@frozen public enum Case2Payload: String, Codable, Hashable, Sendable, CaseIterable {
case skuPricing = "SkuPricing"
}
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type/case2`.
case case2(Components.Schemas.GetBudget.BudgetTypePayload.Case2Payload)
public init(from decoder: any Swift.Decoder) throws {
var errors: [any Swift.Error] = []
do {
self = .case1(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
do {
self = .case2(try decoder.decodeFromSingleValueContainer())
return
} catch {
errors.append(error)
}
throw Swift.DecodingError.failedToDecodeOneOfSchema(
type: Self.self,
codingPath: decoder.codingPath,
errors: errors
)
}
public func encode(to encoder: any Swift.Encoder) throws {
switch self {
case let .case1(value):
try encoder.encodeToSingleValueContainer(value)
case let .case2(value):
try encoder.encodeToSingleValueContainer(value)
}
}
}
/// The type of pricing for the budget
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_type`.
public var budgetType: Components.Schemas.GetBudget.BudgetTypePayload
/// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting`.
public struct BudgetAlertingPayload: Codable, Hashable, Sendable {
/// Whether alerts are enabled for this budget
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting/will_alert`.
public var willAlert: Swift.Bool?
/// Array of user login names who will receive alerts
///
/// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting/alert_recipients`.
public var alertRecipients: [Swift.String]?
/// Creates a new `BudgetAlertingPayload`.
///
/// - Parameters:
/// - willAlert: Whether alerts are enabled for this budget
/// - alertRecipients: Array of user login names who will receive alerts
public init(
willAlert: Swift.Bool? = nil,
alertRecipients: [Swift.String]? = nil
) {
self.willAlert = willAlert
self.alertRecipients = alertRecipients
}
public enum CodingKeys: String, CodingKey {
case willAlert = "will_alert"
case alertRecipients = "alert_recipients"
}
}
/// - Remark: Generated from `#/components/schemas/get-budget/budget_alerting`.
public var budgetAlerting: Components.Schemas.GetBudget.BudgetAlertingPayload
/// Creates a new `GetBudget`.
///
/// - Parameters:
/// - id: ID of the budget.
/// - budgetScope: The type of scope for the budget
/// - budgetEntityName: The name of the entity to apply the budget to
/// - budgetAmount: The budget amount in whole dollars. For license-based products, this represents the number of licenses.
/// - preventFurtherUsage: Whether to prevent additional spending once the budget is exceeded
/// - budgetProductSku: A single product or sku to apply the budget to.
/// - budgetType: The type of pricing for the budget
/// - budgetAlerting:
public init(
id: Swift.String,
budgetScope: Components.Schemas.GetBudget.BudgetScopePayload,
budgetEntityName: Swift.String,
budgetAmount: Swift.Int,
preventFurtherUsage: Swift.Bool,
budgetProductSku: Swift.String,
budgetType: Components.Schemas.GetBudget.BudgetTypePayload,
budgetAlerting: Components.Schemas.GetBudget.BudgetAlertingPayload
) {
self.id = id
self.budgetScope = budgetScope
self.budgetEntityName = budgetEntityName
self.budgetAmount = budgetAmount
self.preventFurtherUsage = preventFurtherUsage
self.budgetProductSku = budgetProductSku
self.budgetType = budgetType
self.budgetAlerting = budgetAlerting
}
public enum CodingKeys: String, CodingKey {
case id
case budgetScope = "budget_scope"
case budgetEntityName = "budget_entity_name"
case budgetAmount = "budget_amount"
case preventFurtherUsage = "prevent_further_usage"
case budgetProductSku = "budget_product_sku"
case budgetType = "budget_type"
case budgetAlerting = "budget_alerting"
}
}
/// - Remark: Generated from `#/components/schemas/delete-budget`.
public struct DeleteBudget: Codable, Hashable, Sendable {
/// A message indicating the result of the deletion operation
///
/// - Remark: Generated from `#/components/schemas/delete-budget/message`.
public var message: Swift.String
/// The ID of the deleted budget
///
/// - Remark: Generated from `#/components/schemas/delete-budget/id`.
public var id: Swift.String
/// Creates a new `DeleteBudget`.
///
/// - Parameters:
/// - message: A message indicating the result of the deletion operation
/// - id: The ID of the deleted budget
public init(
message: Swift.String,
id: Swift.String
) {
self.message = message
self.id = id
}
public enum CodingKeys: String, CodingKey {
case message
case id
}
}
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org`.
public struct BillingPremiumRequestUsageReportOrg: Codable, Hashable, Sendable {
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`.
public struct TimePeriodPayload: Codable, Hashable, Sendable {
/// The year for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/year`.
public var year: Swift.Int
/// The month for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/month`.
public var month: Swift.Int?
/// The day for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod/day`.
public var day: Swift.Int?
/// Creates a new `TimePeriodPayload`.
///
/// - Parameters:
/// - year: The year for the usage report.
/// - month: The month for the usage report.
/// - day: The day for the usage report.
public init(
year: Swift.Int,
month: Swift.Int? = nil,
day: Swift.Int? = nil
) {
self.year = year
self.month = month
self.day = day
}
public enum CodingKeys: String, CodingKey {
case year
case month
case day
}
}
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/timePeriod`.
public var timePeriod: Components.Schemas.BillingPremiumRequestUsageReportOrg.TimePeriodPayload
/// The unique identifier of the organization.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/organization`.
public var organization: Swift.String
/// The name of the user for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/user`.
public var user: Swift.String?
/// The product for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/product`.
public var product: Swift.String?
/// The model for the usage report.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/model`.
public var model: Swift.String?
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload`.
public struct UsageItemsPayloadPayload: Codable, Hashable, Sendable {
/// Product name.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/product`.
public var product: Swift.String
/// SKU name.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/sku`.
public var sku: Swift.String
/// Model name.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/model`.
public var model: Swift.String
/// Unit type of the usage line item.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/unitType`.
public var unitType: Swift.String
/// Price per unit of the usage line item.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/pricePerUnit`.
public var pricePerUnit: Swift.Double
/// Gross quantity of the usage line item.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossQuantity`.
public var grossQuantity: Swift.Double
/// Gross amount of the usage line item.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/grossAmount`.
public var grossAmount: Swift.Double
/// Discount quantity of the usage line item.
///
/// - Remark: Generated from `#/components/schemas/billing-premium-request-usage-report-org/UsageItemsPayload/discountQuantity`.