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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380 | // Generated by scripts/gen-api.py from spec/openapi.json — do not edit.
import Foundation
// MARK: - Types
/// Values this build does not know decode as `.unrecognized`.
public enum RegistrationState: RawRepresentable, Codable, Sendable, Hashable {
case pending
case reserved
case active
case pendingTransferIn
case transferredOut
case failed
case closed
/// A value the server sent that this version of the package does not list.
case unrecognized(String)
/// Every value the spec listed when this file was generated.
public static let known: [RegistrationState] = [.pending, .reserved, .active, .pendingTransferIn, .transferredOut, .failed, .closed]
public init(rawValue: String) {
switch rawValue {
case "pending": self = .pending
case "reserved": self = .reserved
case "active": self = .active
case "pending-transfer-in": self = .pendingTransferIn
case "transferred-out": self = .transferredOut
case "failed": self = .failed
case "closed": self = .closed
default: self = .unrecognized(rawValue)
}
}
public var rawValue: String {
switch self {
case .pending: return "pending"
case .reserved: return "reserved"
case .active: return "active"
case .pendingTransferIn: return "pending-transfer-in"
case .transferredOut: return "transferred-out"
case .failed: return "failed"
case .closed: return "closed"
case .unrecognized(let raw): return raw
}
}
public init(from decoder: any Decoder) throws {
self.init(rawValue: try decoder.singleValueContainer().decode(String.self))
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(rawValue)
}
}
/// Shared by 9 operations.
public struct RegistrationHost: Codable, Sendable, Hashable {
public var host: String
public var ips: [String]
public init(host: String, ips: [String]) {
self.host = host
self.ips = ips
}
enum CodingKeys: String, CodingKey {
case host
case ips
}
}
/// Values this build does not know decode as `.unrecognized`.
public enum RegistrantOrigin: RawRepresentable, Codable, Sendable, Hashable {
case profile
case registry
/// A value the server sent that this version of the package does not list.
case unrecognized(String)
/// Every value the spec listed when this file was generated.
public static let known: [RegistrantOrigin] = [.profile, .registry]
public init(rawValue: String) {
switch rawValue {
case "profile": self = .profile
case "registry": self = .registry
default: self = .unrecognized(rawValue)
}
}
public var rawValue: String {
switch self {
case .profile: return "profile"
case .registry: return "registry"
case .unrecognized(let raw): return raw
}
}
public init(from decoder: any Decoder) throws {
self.init(rawValue: try decoder.singleValueContainer().decode(String.self))
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(rawValue)
}
}
/// Shared by 9 operations.
public struct Registrant: Codable, Sendable, Hashable {
public var origin: RegistrantOrigin
public var accessDenied: Bool
public var name: String?
public var email: String?
public var phone: String?
public var fax: String?
public var address: String?
public var address1: String?
public var address2: String?
public var address3: String?
public var city: String?
public var stateProvince: String?
public var postalCode: String?
public var countryCode: String?
public var personType: String?
public var fetchedAt: String?
public init(origin: RegistrantOrigin, accessDenied: Bool, name: String? = nil, email: String? = nil, phone: String? = nil, fax: String? = nil, address: String? = nil, address1: String? = nil, address2: String? = nil, address3: String? = nil, city: String? = nil, stateProvince: String? = nil, postalCode: String? = nil, countryCode: String? = nil, personType: String? = nil, fetchedAt: String? = nil) {
self.origin = origin
self.accessDenied = accessDenied
self.name = name
self.email = email
self.phone = phone
self.fax = fax
self.address = address
self.address1 = address1
self.address2 = address2
self.address3 = address3
self.city = city
self.stateProvince = stateProvince
self.postalCode = postalCode
self.countryCode = countryCode
self.personType = personType
self.fetchedAt = fetchedAt
}
enum CodingKeys: String, CodingKey {
case origin
case accessDenied = "access_denied"
case name
case email
case phone
case fax
case address
case address1
case address2
case address3
case city
case stateProvince = "state_province"
case postalCode = "postal_code"
case countryCode = "country_code"
case personType = "person_type"
case fetchedAt = "fetched_at"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(origin, forKey: .origin)
try container.encode(accessDenied, forKey: .accessDenied)
try container.encode(name, forKey: .name)
try container.encode(email, forKey: .email)
try container.encode(phone, forKey: .phone)
try container.encode(fax, forKey: .fax)
try container.encode(address, forKey: .address)
try container.encode(address1, forKey: .address1)
try container.encode(address2, forKey: .address2)
try container.encode(address3, forKey: .address3)
try container.encode(city, forKey: .city)
try container.encode(stateProvince, forKey: .stateProvince)
try container.encode(postalCode, forKey: .postalCode)
try container.encode(countryCode, forKey: .countryCode)
try container.encode(personType, forKey: .personType)
try container.encode(fetchedAt, forKey: .fetchedAt)
}
}
/// Shared by 9 operations.
public struct Registration: Codable, Sendable, Hashable, Identifiable {
public var id: String
public var domain: String
public var tld: String
public var state: RegistrationState
public var periodYears: Int
public var registeredAt: String?
public var expiresAt: String?
public var expired: Bool
public var autoRenew: Bool
public var sensitive: Bool
public var nameservers: [String]
public var hosts: [RegistrationHost]
public var dsdata: [DsRecord]
public var transferOutRequestedAt: String?
public var createdAt: String
public var spentTotal: String?
public var nextMonthEstimate: String?
public var transferredIn: Bool?
public var registrant: Registrant?
public var ownershipVerificationRequired: Bool?
public var registrantEmailHint: String?
public init(id: String, domain: String, tld: String, state: RegistrationState, periodYears: Int, registeredAt: String? = nil, expiresAt: String? = nil, expired: Bool, autoRenew: Bool, sensitive: Bool, nameservers: [String], hosts: [RegistrationHost], dsdata: [DsRecord], transferOutRequestedAt: String? = nil, createdAt: String, spentTotal: String? = nil, nextMonthEstimate: String? = nil, transferredIn: Bool? = nil, registrant: Registrant? = nil, ownershipVerificationRequired: Bool? = nil, registrantEmailHint: String? = nil) {
self.id = id
self.domain = domain
self.tld = tld
self.state = state
self.periodYears = periodYears
self.registeredAt = registeredAt
self.expiresAt = expiresAt
self.expired = expired
self.autoRenew = autoRenew
self.sensitive = sensitive
self.nameservers = nameservers
self.hosts = hosts
self.dsdata = dsdata
self.transferOutRequestedAt = transferOutRequestedAt
self.createdAt = createdAt
self.spentTotal = spentTotal
self.nextMonthEstimate = nextMonthEstimate
self.transferredIn = transferredIn
self.registrant = registrant
self.ownershipVerificationRequired = ownershipVerificationRequired
self.registrantEmailHint = registrantEmailHint
}
enum CodingKeys: String, CodingKey {
case id
case domain
case tld
case state
case periodYears = "period_years"
case registeredAt = "registered_at"
case expiresAt = "expires_at"
case expired
case autoRenew = "auto_renew"
case sensitive
case nameservers
case hosts
case dsdata
case transferOutRequestedAt = "transfer_out_requested_at"
case createdAt = "created_at"
case spentTotal = "spent_total"
case nextMonthEstimate = "next_month_estimate"
case transferredIn = "transferred_in"
case registrant
case ownershipVerificationRequired = "ownership_verification_required"
case registrantEmailHint = "registrant_email_hint"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(domain, forKey: .domain)
try container.encode(tld, forKey: .tld)
try container.encode(state, forKey: .state)
try container.encode(periodYears, forKey: .periodYears)
try container.encode(registeredAt, forKey: .registeredAt)
try container.encode(expiresAt, forKey: .expiresAt)
try container.encode(expired, forKey: .expired)
try container.encode(autoRenew, forKey: .autoRenew)
try container.encode(sensitive, forKey: .sensitive)
try container.encode(nameservers, forKey: .nameservers)
try container.encode(hosts, forKey: .hosts)
try container.encode(dsdata, forKey: .dsdata)
try container.encode(transferOutRequestedAt, forKey: .transferOutRequestedAt)
try container.encode(createdAt, forKey: .createdAt)
try container.encodeIfPresent(spentTotal, forKey: .spentTotal)
try container.encodeIfPresent(nextMonthEstimate, forKey: .nextMonthEstimate)
try container.encodeIfPresent(transferredIn, forKey: .transferredIn)
try container.encodeIfPresent(registrant, forKey: .registrant)
try container.encodeIfPresent(ownershipVerificationRequired, forKey: .ownershipVerificationRequired)
try container.encodeIfPresent(registrantEmailHint, forKey: .registrantEmailHint)
}
}
/// Used by GET /domains/registrations.
public struct RegistrationListResponse: Codable, Sendable, Hashable {
public var registrations: [Registration]
public var nextCursor: String?
public init(registrations: [Registration], nextCursor: String? = nil) {
self.registrations = registrations
self.nextCursor = nextCursor
}
enum CodingKeys: String, CodingKey {
case registrations
case nextCursor = "next_cursor"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(registrations, forKey: .registrations)
try container.encode(nextCursor, forKey: .nextCursor)
}
}
/// Used by POST /domains/registrations.
public struct RegisterBody: Codable, Sendable, Hashable {
public var domain: String
public var years: Int
public var nameservers: [String]?
public var useOurDns: Bool?
public var autoRenew: Bool?
public init(domain: String, years: Int, nameservers: [String]? = nil, useOurDns: Bool? = nil, autoRenew: Bool? = nil) {
self.domain = domain
self.years = years
self.nameservers = nameservers
self.useOurDns = useOurDns
self.autoRenew = autoRenew
}
enum CodingKeys: String, CodingKey {
case domain
case years
case nameservers
case useOurDns = "use_our_dns"
case autoRenew = "auto_renew"
}
}
/// Values this build does not know decode as `.unrecognized`.
public enum RegistrationActionType: RawRepresentable, Codable, Sendable, Hashable {
case register
case activate
case renew
case transferIn
case transferOut
case resetNs
case trade
case tradeIn
case hostCreate
case hostUpdate
case hostDelete
case dsdataAdd
case dsdataRemove
case contactUpdate
case syncInfo
case syncContact
/// A value the server sent that this version of the package does not list.
case unrecognized(String)
/// Every value the spec listed when this file was generated.
public static let known: [RegistrationActionType] = [.register, .activate, .renew, .transferIn, .transferOut, .resetNs, .trade, .tradeIn, .hostCreate, .hostUpdate, .hostDelete, .dsdataAdd, .dsdataRemove, .contactUpdate, .syncInfo, .syncContact]
public init(rawValue: String) {
switch rawValue {
case "register": self = .register
case "activate": self = .activate
case "renew": self = .renew
case "transfer-in": self = .transferIn
case "transfer-out": self = .transferOut
case "reset-ns": self = .resetNs
case "trade": self = .trade
case "trade-in": self = .tradeIn
case "host-create": self = .hostCreate
case "host-update": self = .hostUpdate
case "host-delete": self = .hostDelete
case "dsdata-add": self = .dsdataAdd
case "dsdata-remove": self = .dsdataRemove
case "contact-update": self = .contactUpdate
case "sync-info": self = .syncInfo
case "sync-contact": self = .syncContact
default: self = .unrecognized(rawValue)
}
}
public var rawValue: String {
switch self {
case .register: return "register"
case .activate: return "activate"
case .renew: return "renew"
case .transferIn: return "transfer-in"
case .transferOut: return "transfer-out"
case .resetNs: return "reset-ns"
case .trade: return "trade"
case .tradeIn: return "trade-in"
case .hostCreate: return "host-create"
case .hostUpdate: return "host-update"
case .hostDelete: return "host-delete"
case .dsdataAdd: return "dsdata-add"
case .dsdataRemove: return "dsdata-remove"
case .contactUpdate: return "contact-update"
case .syncInfo: return "sync-info"
case .syncContact: return "sync-contact"
case .unrecognized(let raw): return raw
}
}
public init(from decoder: any Decoder) throws {
self.init(rawValue: try decoder.singleValueContainer().decode(String.self))
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(rawValue)
}
}
/// Values this build does not know decode as `.unrecognized`.
public enum RegistrationActionState: RawRepresentable, Codable, Sendable, Hashable {
case pendingCharge
case queued
case claimed
case submitted
case awaitingRegistry
case reconciling
case succeeded
case failed
case cancelled
/// A value the server sent that this version of the package does not list.
case unrecognized(String)
/// Every value the spec listed when this file was generated.
public static let known: [RegistrationActionState] = [.pendingCharge, .queued, .claimed, .submitted, .awaitingRegistry, .reconciling, .succeeded, .failed, .cancelled]
public init(rawValue: String) {
switch rawValue {
case "pending-charge": self = .pendingCharge
case "queued": self = .queued
case "claimed": self = .claimed
case "submitted": self = .submitted
case "awaiting-registry": self = .awaitingRegistry
case "reconciling": self = .reconciling
case "succeeded": self = .succeeded
case "failed": self = .failed
case "cancelled": self = .cancelled
default: self = .unrecognized(rawValue)
}
}
public var rawValue: String {
switch self {
case .pendingCharge: return "pending-charge"
case .queued: return "queued"
case .claimed: return "claimed"
case .submitted: return "submitted"
case .awaitingRegistry: return "awaiting-registry"
case .reconciling: return "reconciling"
case .succeeded: return "succeeded"
case .failed: return "failed"
case .cancelled: return "cancelled"
case .unrecognized(let raw): return raw
}
}
public init(from decoder: any Decoder) throws {
self.init(rawValue: try decoder.singleValueContainer().decode(String.self))
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(rawValue)
}
}
/// Values this build does not know decode as `.unrecognized`.
public enum RegistrationActionErrorHint: RawRepresentable, Codable, Sendable, Hashable {
case transferProhibited
case invalidAuthKey
case domainNotFound
case otherRegistrar
/// A value the server sent that this version of the package does not list.
case unrecognized(String)
/// Every value the spec listed when this file was generated.
public static let known: [RegistrationActionErrorHint] = [.transferProhibited, .invalidAuthKey, .domainNotFound, .otherRegistrar]
public init(rawValue: String) {
switch rawValue {
case "transfer-prohibited": self = .transferProhibited
case "invalid-auth-key": self = .invalidAuthKey
case "domain-not-found": self = .domainNotFound
case "other-registrar": self = .otherRegistrar
default: self = .unrecognized(rawValue)
}
}
public var rawValue: String {
switch self {
case .transferProhibited: return "transfer-prohibited"
case .invalidAuthKey: return "invalid-auth-key"
case .domainNotFound: return "domain-not-found"
case .otherRegistrar: return "other-registrar"
case .unrecognized(let raw): return raw
}
}
public init(from decoder: any Decoder) throws {
self.init(rawValue: try decoder.singleValueContainer().decode(String.self))
}
public func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(rawValue)
}
}
/// Shared by 17 operations.
public struct RegistrationAction: Codable, Sendable, Hashable, Identifiable {
public var id: String
public var seq: Int
public var type: RegistrationActionType
public var state: RegistrationActionState
public var registrationId: String?
public var charged: String?
public var refunded: Bool
public var error: String?
public var errorCode: String?
public var errorHint: RegistrationActionErrorHint?
public var result: [String: JSONValue]?
public var createdAt: String
public var submittedAt: String?
public var finishedAt: String?
public init(id: String, seq: Int, type: RegistrationActionType, state: RegistrationActionState, registrationId: String? = nil, charged: String? = nil, refunded: Bool, error: String? = nil, errorCode: String? = nil, errorHint: RegistrationActionErrorHint? = nil, result: [String: JSONValue]? = nil, createdAt: String, submittedAt: String? = nil, finishedAt: String? = nil) {
self.id = id
self.seq = seq
self.type = type
self.state = state
self.registrationId = registrationId
self.charged = charged
self.refunded = refunded
self.error = error
self.errorCode = errorCode
self.errorHint = errorHint
self.result = result
self.createdAt = createdAt
self.submittedAt = submittedAt
self.finishedAt = finishedAt
}
enum CodingKeys: String, CodingKey {
case id
case seq
case type
case state
case registrationId = "registration_id"
case charged
case refunded
case error
case errorCode = "error_code"
case errorHint = "error_hint"
case result
case createdAt = "created_at"
case submittedAt = "submitted_at"
case finishedAt = "finished_at"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(seq, forKey: .seq)
try container.encode(type, forKey: .type)
try container.encode(state, forKey: .state)
try container.encode(registrationId, forKey: .registrationId)
try container.encode(charged, forKey: .charged)
try container.encode(refunded, forKey: .refunded)
try container.encode(error, forKey: .error)
try container.encode(errorCode, forKey: .errorCode)
try container.encode(errorHint, forKey: .errorHint)
try container.encode(result, forKey: .result)
try container.encode(createdAt, forKey: .createdAt)
try container.encode(submittedAt, forKey: .submittedAt)
try container.encode(finishedAt, forKey: .finishedAt)
}
}
/// Shared by 3 operations.
public struct RegistrationActionResponse: Codable, Sendable, Hashable {
public var registration: Registration
public var action: RegistrationAction
public init(registration: Registration, action: RegistrationAction) {
self.registration = registration
self.action = action
}
enum CodingKeys: String, CodingKey {
case registration
case action
}
}
/// Used by GET /domains/registrations/{id}.
public struct RegistrationGetResponse: Codable, Sendable, Hashable {
public var registration: Registration
public var actions: [RegistrationAction]
public init(registration: Registration, actions: [RegistrationAction]) {
self.registration = registration
self.actions = actions
}
enum CodingKeys: String, CodingKey {
case registration
case actions
}
}
/// Used by POST /domains/registrations/{id}/renew.
public struct RenewBody: Codable, Sendable, Hashable {
public var years: Int
public var totpCode: String?
public init(years: Int, totpCode: String? = nil) {
self.years = years
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case years
case totpCode = "totp_code"
}
}
/// Shared by 12 operations.
public struct ActionResponse: Codable, Sendable, Hashable {
public var action: RegistrationAction
public init(action: RegistrationAction) {
self.action = action
}
enum CodingKeys: String, CodingKey {
case action
}
}
/// Shared by 2 operations.
public struct EnabledBody: Codable, Sendable, Hashable {
public var enabled: Bool
public var totpCode: String?
public init(enabled: Bool, totpCode: String? = nil) {
self.enabled = enabled
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case enabled
case totpCode = "totp_code"
}
}
/// Shared by 3 operations.
public struct RegistrationResponse: Codable, Sendable, Hashable {
public var registration: Registration
public init(registration: Registration) {
self.registration = registration
}
enum CodingKeys: String, CodingKey {
case registration
}
}
/// Used by PUT /domains/registrations/{id}/nameservers.
public struct SetNameserversBody: Codable, Sendable, Hashable {
public var nameservers: [String]
public var totpCode: String?
public init(nameservers: [String], totpCode: String? = nil) {
self.nameservers = nameservers
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case nameservers
case totpCode = "totp_code"
}
}
/// Used by GET /domains/registrations/{id}/hosts.
public struct HostDetail: Codable, Sendable, Hashable {
public var host: String
public var ips: [String]
public var usageCount: Int?
public var statuses: [String]?
public init(host: String, ips: [String], usageCount: Int? = nil, statuses: [String]? = nil) {
self.host = host
self.ips = ips
self.usageCount = usageCount
self.statuses = statuses
}
enum CodingKeys: String, CodingKey {
case host
case ips
case usageCount = "usage_count"
case statuses
}
}
/// Used by GET /domains/registrations/{id}/hosts.
public struct ListHostsResponse: Codable, Sendable, Hashable {
public var hosts: [HostDetail]
public init(hosts: [HostDetail]) {
self.hosts = hosts
}
enum CodingKeys: String, CodingKey {
case hosts
}
}
/// Used by POST /domains/registrations/{id}/hosts.
public struct CreateHostBody: Codable, Sendable, Hashable {
public var host: String
public var ips: [String]
public var totpCode: String?
public init(host: String, ips: [String], totpCode: String? = nil) {
self.host = host
self.ips = ips
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case host
case ips
case totpCode = "totp_code"
}
}
/// Used by PUT /domains/registrations/{id}/hosts/{host}.
public struct SetHostIpsBody: Codable, Sendable, Hashable {
public var ips: [String]
public var totpCode: String?
public init(ips: [String], totpCode: String? = nil) {
self.ips = ips
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case ips
case totpCode = "totp_code"
}
}
/// Used by GET /domains/registrations/{id}/dsdata.
public struct ListDsDataResponse: Codable, Sendable, Hashable {
public var dsdata: [DsRecord]
public init(dsdata: [DsRecord]) {
self.dsdata = dsdata
}
enum CodingKeys: String, CodingKey {
case dsdata
}
}
/// Shared by 2 operations.
public struct PublishDsDataBody: Codable, Sendable, Hashable {
public var keytag: Int
public var alg: Int
public var digestType: Int
public var digest: String
public var totpCode: String?
public init(keytag: Int, alg: Int, digestType: Int, digest: String, totpCode: String? = nil) {
self.keytag = keytag
self.alg = alg
self.digestType = digestType
self.digest = digest
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case keytag
case alg
case digestType = "digest_type"
case digest
case totpCode = "totp_code"
}
}
/// Used by POST /domains/registrations/{id}/transfer-out.
public struct TransferOutResponse: Codable, Sendable, Hashable {
public var registration: Registration
public var instructions: String
public init(registration: Registration, instructions: String) {
self.registration = registration
self.instructions = instructions
}
enum CodingKeys: String, CodingKey {
case registration
case instructions
}
}
/// Used by PUT /domains/registrations/{id}/registrant.
public struct UpdateRegistrantBody: Codable, Sendable, Hashable {
public var address1: String
public var address2: String?
public var address3: String?
public var city: String
public var stateProvince: String?
public var postalCode: String?
public var countryCode: String
public var phone: String
public var email: String
public var fax: String?
public var totpCode: String
public init(address1: String, address2: String? = nil, address3: String? = nil, city: String, stateProvince: String? = nil, postalCode: String? = nil, countryCode: String, phone: String, email: String, fax: String? = nil, totpCode: String) {
self.address1 = address1
self.address2 = address2
self.address3 = address3
self.city = city
self.stateProvince = stateProvince
self.postalCode = postalCode
self.countryCode = countryCode
self.phone = phone
self.email = email
self.fax = fax
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case address1
case address2
case address3
case city
case stateProvince = "state_province"
case postalCode = "postal_code"
case countryCode = "country_code"
case phone
case email
case fax
case totpCode = "totp_code"
}
}
/// Used by POST /domains/registrations/{id}/registrant-email/start.
public struct StartRegistrantEmailVerificationResponse: Codable, Sendable, Hashable {
public var token: String
public var emailHint: String?
public init(token: String, emailHint: String? = nil) {
self.token = token
self.emailHint = emailHint
}
enum CodingKeys: String, CodingKey {
case token
case emailHint = "email_hint"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(token, forKey: .token)
try container.encode(emailHint, forKey: .emailHint)
}
}
/// Used by POST /domains/registrations/{id}/registrant-email/confirm.
public struct ConfirmRegistrantEmailBody: Codable, Sendable, Hashable {
public var token: String
public var code: String
public init(token: String, code: String) {
self.token = token
self.code = code
}
enum CodingKeys: String, CodingKey {
case token
case code
}
}
/// Used by POST /domains/registrations/{id}/registrant-email/confirm.
public struct ConfirmRegistrantEmailResponse: Codable, Sendable, Hashable {
public var verified: Bool
public init(verified: Bool) {
self.verified = verified
}
enum CodingKeys: String, CodingKey {
case verified
}
}
/// Used by POST /domains/registrations/{id}/registrant-email/adopt.
public struct AdoptRegistrantEmailBody: Codable, Sendable, Hashable {
public var email: String
public var totpCode: String
public init(email: String, totpCode: String) {
self.email = email
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case email
case totpCode = "totp_code"
}
}
/// Used by GET /domains/registrations/{id}/trade.
public struct RenewalEstimate: Codable, Sendable, Hashable {
public var years: Int
public var price: String
public var newExpiresAt: String
public init(years: Int, price: String, newExpiresAt: String) {
self.years = years
self.price = price
self.newExpiresAt = newExpiresAt
}
enum CodingKeys: String, CodingKey {
case years
case price
case newExpiresAt = "new_expires_at"
}
}
/// Used by GET /domains/registrations/{id}/trade.
public struct QuoteTradeResponse: Codable, Sendable, Hashable {
public var discounted: Bool
public var coveredYears: Int
public var maxYears: Int
public var currentExpiresAt: String?
public var estimates: [RenewalEstimate]
public init(discounted: Bool, coveredYears: Int, maxYears: Int, currentExpiresAt: String? = nil, estimates: [RenewalEstimate]) {
self.discounted = discounted
self.coveredYears = coveredYears
self.maxYears = maxYears
self.currentExpiresAt = currentExpiresAt
self.estimates = estimates
}
enum CodingKeys: String, CodingKey {
case discounted
case coveredYears = "covered_years"
case maxYears = "max_years"
case currentExpiresAt = "current_expires_at"
case estimates
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(discounted, forKey: .discounted)
try container.encode(coveredYears, forKey: .coveredYears)
try container.encode(maxYears, forKey: .maxYears)
try container.encode(currentExpiresAt, forKey: .currentExpiresAt)
try container.encode(estimates, forKey: .estimates)
}
}
/// Used by POST /domains/registrations/{id}/trade.
public struct TradeBody: Codable, Sendable, Hashable {
public var authKey: String
public var years: Int
public var totpCode: String?
public init(authKey: String, years: Int, totpCode: String? = nil) {
self.authKey = authKey
self.years = years
self.totpCode = totpCode
}
enum CodingKeys: String, CodingKey {
case authKey = "auth_key"
case years
case totpCode = "totp_code"
}
}
/// Used by POST /domains/transfers-in.
public struct TransferInBody: Codable, Sendable, Hashable {
public var domain: String
public var authKey: String
public var keepNameservers: Bool?
public var useIrdDns: Bool?
public var copyDns: Bool?
public var thenTrade: Bool?
public init(domain: String, authKey: String, keepNameservers: Bool? = nil, useIrdDns: Bool? = nil, copyDns: Bool? = nil, thenTrade: Bool? = nil) {
self.domain = domain
self.authKey = authKey
self.keepNameservers = keepNameservers
self.useIrdDns = useIrdDns
self.copyDns = copyDns
self.thenTrade = thenTrade
}
enum CodingKeys: String, CodingKey {
case domain
case authKey = "auth_key"
case keepNameservers = "keep_nameservers"
case useIrdDns = "use_ird_dns"
case copyDns = "copy_dns"
case thenTrade = "then_trade"
}
}
/// Used by POST /domains/trades-in.
public struct TradeInBody: Codable, Sendable, Hashable {
public var domain: String
public var authKey: String
public var years: Int
public var keepNameservers: Bool?
public var useIrdDns: Bool?
public var copyDns: Bool?
public init(domain: String, authKey: String, years: Int, keepNameservers: Bool? = nil, useIrdDns: Bool? = nil, copyDns: Bool? = nil) {
self.domain = domain
self.authKey = authKey
self.years = years
self.keepNameservers = keepNameservers
self.useIrdDns = useIrdDns
self.copyDns = copyDns
}
enum CodingKeys: String, CodingKey {
case domain
case authKey = "auth_key"
case years
case keepNameservers = "keep_nameservers"
case useIrdDns = "use_ird_dns"
case copyDns = "copy_dns"
}
}
/// Used by GET /domains/actions.
public struct ListActionsResponse: Codable, Sendable, Hashable {
public var actions: [RegistrationAction]
public var nextCursor: Int?
public init(actions: [RegistrationAction], nextCursor: Int? = nil) {
self.actions = actions
self.nextCursor = nextCursor
}
enum CodingKeys: String, CodingKey {
case actions
case nextCursor = "next_cursor"
}
/// Explicit so required-but-nullable fields encode as `null` rather than vanishing.
public func encode(to encoder: any Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(actions, forKey: .actions)
try container.encode(nextCursor, forKey: .nextCursor)
}
}
/// Query parameters of `list`; unset fields are omitted.
public struct RegistrationListQuery: Sendable, Hashable {
public var cursor: String?
public var limit: Int?
public init(cursor: String? = nil, limit: Int? = nil) {
self.cursor = cursor
self.limit = limit
}
/// The items in spec order.
public var queryItems: [QueryItem] {
var items: [QueryItem] = []
if let value = cursor { items.append(QueryItem("cursor", value)) }
if let value = limit { items.append(QueryItem("limit", String(value))) }
return items
}
}
/// Query parameters of `listHosts`; unset fields are omitted.
public struct ListHostsQuery: Sendable, Hashable {
public var refresh: Bool?
public init(refresh: Bool? = nil) {
self.refresh = refresh
}
/// The items in spec order.
public var queryItems: [QueryItem] {
var items: [QueryItem] = []
if let value = refresh { items.append(QueryItem("refresh", value ? "true" : "false")) }
return items
}
}
/// Query parameters of `listDsData`; unset fields are omitted.
public struct ListDsDataQuery: Sendable, Hashable {
public var refresh: Bool?
public init(refresh: Bool? = nil) {
self.refresh = refresh
}
/// The items in spec order.
public var queryItems: [QueryItem] {
var items: [QueryItem] = []
if let value = refresh { items.append(QueryItem("refresh", value ? "true" : "false")) }
return items
}
}
/// Query parameters of `listActions`; unset fields are omitted.
public struct ListActionsQuery: Sendable, Hashable {
public var state: String?
public var cursor: Int?
public var limit: Int?
public init(state: String? = nil, cursor: Int? = nil, limit: Int? = nil) {
self.state = state
self.cursor = cursor
self.limit = limit
}
/// The items in spec order.
public var queryItems: [QueryItem] {
var items: [QueryItem] = []
if let value = state { items.append(QueryItem("state", value)) }
if let value = cursor { items.append(QueryItem("cursor", String(value))) }
if let value = limit { items.append(QueryItem("limit", String(value))) }
return items
}
}
// MARK: - Operations
extension IrdOperation {
public static let registrations_list = IrdOperation(method: .get, pathTemplate: "/domains/registrations", module: "registrations", name: "list", security: .keyOrJwt)
public static let registrations_register = IrdOperation(method: .post, pathTemplate: "/domains/registrations", module: "registrations", name: "register", security: .keyOrJwt)
public static let registrations_get = IrdOperation(method: .get, pathTemplate: "/domains/registrations/{id}", module: "registrations", name: "get", security: .keyOrJwt)
public static let registrations_renew = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/renew", module: "registrations", name: "renew", security: .keyOrJwt)
public static let registrations_setAutoRenew = IrdOperation(method: .put, pathTemplate: "/domains/registrations/{id}/auto-renew", module: "registrations", name: "setAutoRenew", security: .keyOrJwt)
public static let registrations_setSensitive = IrdOperation(method: .put, pathTemplate: "/domains/registrations/{id}/sensitive", module: "registrations", name: "setSensitive", security: .keyOrJwt)
public static let registrations_setNameservers = IrdOperation(method: .put, pathTemplate: "/domains/registrations/{id}/nameservers", module: "registrations", name: "setNameservers", security: .keyOrJwt)
public static let registrations_listHosts = IrdOperation(method: .get, pathTemplate: "/domains/registrations/{id}/hosts", module: "registrations", name: "listHosts", security: .keyOrJwt)
public static let registrations_createHost = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/hosts", module: "registrations", name: "createHost", security: .keyOrJwt)
public static let registrations_setHostIps = IrdOperation(method: .put, pathTemplate: "/domains/registrations/{id}/hosts/{host}", module: "registrations", name: "setHostIps", security: .keyOrJwt)
public static let registrations_deleteHost = IrdOperation(method: .delete, pathTemplate: "/domains/registrations/{id}/hosts/{host}", module: "registrations", name: "deleteHost", security: .keyOrJwt)
public static let registrations_listDsData = IrdOperation(method: .get, pathTemplate: "/domains/registrations/{id}/dsdata", module: "registrations", name: "listDsData", security: .keyOrJwt)
public static let registrations_publishDsData = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/dsdata", module: "registrations", name: "publishDsData", security: .keyOrJwt)
public static let registrations_withdrawDsData = IrdOperation(method: .delete, pathTemplate: "/domains/registrations/{id}/dsdata", module: "registrations", name: "withdrawDsData", security: .keyOrJwt)
public static let registrations_transferOut = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/transfer-out", module: "registrations", name: "transferOut", security: .keyOrJwt)
public static let registrations_updateRegistrant = IrdOperation(method: .put, pathTemplate: "/domains/registrations/{id}/registrant", module: "registrations", name: "updateRegistrant", security: .keyOrJwt)
public static let registrations_startRegistrantEmailVerification = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/registrant-email/start", module: "registrations", name: "startRegistrantEmailVerification", security: .keyOrJwt)
public static let registrations_confirmRegistrantEmail = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/registrant-email/confirm", module: "registrations", name: "confirmRegistrantEmail", security: .keyOrJwt)
public static let registrations_adoptRegistrantEmail = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/registrant-email/adopt", module: "registrations", name: "adoptRegistrantEmail", security: .keyOrJwt)
public static let registrations_quoteTrade = IrdOperation(method: .get, pathTemplate: "/domains/registrations/{id}/trade", module: "registrations", name: "quoteTrade", security: .keyOrJwt)
public static let registrations_trade = IrdOperation(method: .post, pathTemplate: "/domains/registrations/{id}/trade", module: "registrations", name: "trade", security: .keyOrJwt)
public static let registrations_transferIn = IrdOperation(method: .post, pathTemplate: "/domains/transfers-in", module: "registrations", name: "transferIn", security: .keyOrJwt)
public static let registrations_tradeIn = IrdOperation(method: .post, pathTemplate: "/domains/trades-in", module: "registrations", name: "tradeIn", security: .keyOrJwt)
public static let registrations_adopt = IrdOperation(method: .post, pathTemplate: "/domains/adoptions", module: "registrations", name: "adopt", security: .keyOrJwt)
public static let registrations_listActions = IrdOperation(method: .get, pathTemplate: "/domains/actions", module: "registrations", name: "listActions", security: .keyOrJwt)
public static let registrations_getAction = IrdOperation(method: .get, pathTemplate: "/domains/actions/{id}", module: "registrations", name: "getAction", security: .keyOrJwt)
public static let registrations_cancelAction = IrdOperation(method: .post, pathTemplate: "/domains/actions/{id}/cancel", module: "registrations", name: "cancelAction", security: .keyOrJwt)
static let registrationsOperations: [IrdOperation] = [.registrations_list, .registrations_register, .registrations_get, .registrations_renew, .registrations_setAutoRenew, .registrations_setSensitive, .registrations_setNameservers, .registrations_listHosts, .registrations_createHost, .registrations_setHostIps, .registrations_deleteHost, .registrations_listDsData, .registrations_publishDsData, .registrations_withdrawDsData, .registrations_transferOut, .registrations_updateRegistrant, .registrations_startRegistrantEmailVerification, .registrations_confirmRegistrantEmail, .registrations_adoptRegistrantEmail, .registrations_quoteTrade, .registrations_trade, .registrations_transferIn, .registrations_tradeIn, .registrations_adopt, .registrations_listActions, .registrations_getAction, .registrations_cancelAction]
}
/// The `registrations` operations (27).
public struct RegistrationsAPI: Sendable {
let client: IrdClient
/// List your domains
/// Registrations newest first; paginate with `cursor` (the ISO-8601 `next_cursor` of the previous page). `expired` is derived — a domain past expiry stays renewable through the registry grace window. Charged per request.
/// `GET /domains/registrations` — 200
public func list(query: RegistrationListQuery = RegistrationListQuery()) async throws -> RegistrationListResponse {
try await client.request(.registrations_list, query: query.queryItems)
}
/// Register a .ro domain
/// Enqueue a registration.
/// `POST /domains/registrations` — 202
public func register(body: RegisterBody) async throws -> RegistrationActionResponse {
try await client.request(.registrations_register, body: body)
}
/// Get a domain
/// One registration with its recent registry actions. Charged per request.
/// `GET /domains/registrations/{id}` — 200
public func get(id: String) async throws -> RegistrationGetResponse {
try await client.request(.registrations_get, params: ["id": id])
}
/// Renew a domain
/// Enqueue a renewal (65 credits/year at launch, charged up front, refunded on terminal failure).
/// `POST /domains/registrations/{id}/renew` — 202
public func renew(id: String, body: RenewBody) async throws -> ActionResponse {
try await client.request(.registrations_renew, params: ["id": id], body: body)
}
/// Toggle auto-renew
/// Auto-renew enqueues a 1-year renewal about 30 days before expiry, charged like a manual renewal (you are emailed if credits run short). Synchronous — no registry involvement.
/// `PUT /domains/registrations/{id}/auto-renew` — 200
public func setAutoRenew(id: String, body: EnabledBody) async throws -> RegistrationResponse {
try await client.request(.registrations_setAutoRenew, params: ["id": id], body: body)
}
/// Toggle the sensitive-domain protection
/// Marks the domain sensitive: every mutation touching it — registrar operations, hosted DNS changes, tunnels on its hostnames — then demands a fresh authenticator (or backup) code in `totp_code`, and API-key callers are refused outright.
/// `PUT /domains/registrations/{id}/sensitive` — 200
public func setSensitive(id: String, body: EnabledBody) async throws -> RegistrationResponse {
try await client.request(.registrations_setSensitive, params: ["id": id], body: body)
}
/// Replace nameservers
/// Enqueue a wholesale nameserver replacement (2–6 hostnames). Small per-change fee, charged up front.
/// `PUT /domains/registrations/{id}/nameservers` — 202
public func setNameservers(id: String, body: SetNameserversBody) async throws -> ActionResponse {
try await client.request(.registrations_setNameservers, params: ["id": id], body: body)
}
/// List the domain's hosts (glue records)
/// The host objects registered under this domain at the registry — e.g.
/// `GET /domains/registrations/{id}/hosts` — 200
public func listHosts(id: String, query: ListHostsQuery = ListHostsQuery()) async throws -> ListHostsResponse {
try await client.request(.registrations_listHosts, params: ["id": id], query: query.queryItems)
}
/// Create a host (glue record)
/// Enqueue a host-object creation at the registry: `host` must be a subdomain of the domain itself (e.g.
/// `POST /domains/registrations/{id}/hosts` — 202
public func createHost(id: String, body: CreateHostBody) async throws -> ActionResponse {
try await client.request(.registrations_createHost, params: ["id": id], body: body)
}
/// Replace a host's IPs
/// Enqueue an IP replacement for the host — the registry replaces the IP set wholesale with `ips` (1–2 IPv4/IPv6 literals). Small per-change fee, charged up front and refunded on terminal failure; poll the returned action.
/// `PUT /domains/registrations/{id}/hosts/{host}` — 202
public func setHostIps(id: String, host: String, body: SetHostIpsBody) async throws -> ActionResponse {
try await client.request(.registrations_setHostIps, params: ["id": id, "host": host], body: body)
}
/// Delete a host (glue record)
/// Enqueue a host-object deletion.
/// `DELETE /domains/registrations/{id}/hosts/{host}` — 202
public func deleteHost(id: String, host: String, body: TotpCodeBody? = nil) async throws -> ActionResponse {
try await client.request(.registrations_deleteHost, params: ["id": id, "host": host], body: body)
}
/// List the domain's DS records
/// The DNSSEC delegation signer (DS) records published at the registry for this domain — what makes validating resolvers trust the zone's DNSKEY.
/// `GET /domains/registrations/{id}/dsdata` — 200
public func listDsData(id: String, query: ListDsDataQuery = ListDsDataQuery()) async throws -> ListDsDataResponse {
try await client.request(.registrations_listDsData, params: ["id": id], query: query.queryItems)
}
/// Publish a DS record
/// Enqueue publishing a DNSSEC DS record at the registry: `keytag` (0–65535), `alg` (3, 5–8, 10, 12–14), `digest_type` (1 = SHA-1, 2 = SHA-256) and the hex `digest` (40 or 64 characters).
/// `POST /domains/registrations/{id}/dsdata` — 202
public func publishDsData(id: String, body: PublishDsDataBody) async throws -> ActionResponse {
try await client.request(.registrations_publishDsData, params: ["id": id], body: body)
}
/// Withdraw a DS record
/// Enqueue withdrawing the DS record matching the body's full 4-tuple (`keytag`, `alg`, `digest_type`, `digest`) from the registry.
/// `DELETE /domains/registrations/{id}/dsdata` — 202
public func withdrawDsData(id: String, body: PublishDsDataBody) async throws -> ActionResponse {
try await client.request(.registrations_withdrawDsData, params: ["id": id], body: body)
}
/// Start moving a domain away
/// Records your intent and disables auto-renew.
/// `POST /domains/registrations/{id}/transfer-out` — 200
public func transferOut(id: String, body: TotpCodeBody? = nil) async throws -> TransferOutResponse {
try await client.request(.registrations_transferOut, params: ["id": id], body: body)
}
/// Update the registrant's contact details
/// Enqueue the registry's contact-update for this domain's registrant: address, city, phone, email and the other mutable contact fields.
/// `PUT /domains/registrations/{id}/registrant` — 202
public func updateRegistrant(id: String, body: UpdateRegistrantBody) async throws -> ActionResponse {
try await client.request(.registrations_updateRegistrant, params: ["id": id], body: body)
}
/// Start registrant-email ownership verification
/// Sends a 6-digit code to the domain's registrant email on record (the address itself is never disclosed — the response carries only a masked hint).
/// `POST /domains/registrations/{id}/registrant-email/start` — 200
public func startRegistrantEmailVerification(id: String) async throws -> StartRegistrantEmailVerificationResponse {
try await client.request(.registrations_startRegistrantEmailVerification, params: ["id": id])
}
/// Confirm the registrant-email code
/// Checks the emailed code (5 attempts per session).
/// `POST /domains/registrations/{id}/registrant-email/confirm` — 200
public func confirmRegistrantEmail(id: String, body: ConfirmRegistrantEmailBody) async throws -> ConfirmRegistrantEmailResponse {
try await client.request(.registrations_confirmRegistrantEmail, params: ["id": id], body: body)
}
/// Adopt the registrant contact email (transferred-in domains)
/// The post-transfer choice: point a transferred-in domain's registrant contact email at an address this account controls.
/// `POST /domains/registrations/{id}/registrant-email/adopt` — 202
public func adoptRegistrantEmail(id: String, body: AdoptRegistrantEmailBody) async throws -> ActionResponse {
try await client.request(.registrations_adoptRegistrantEmail, params: ["id": id], body: body)
}
/// Quote a registrant change (trade)
/// Prices a ROTLD trade for this domain per period.
/// `GET /domains/registrations/{id}/trade` — 200
public func quoteTrade(id: String) async throws -> QuoteTradeResponse {
try await client.request(.registrations_quoteTrade, params: ["id": id])
}
/// Change a domain's registrant (trade)
/// Enqueue a ROTLD registrant trade: your saved customer profile becomes the domain's registrant (the registry's paid trade procedure — a registrar transfer never changes the registrant).
/// `POST /domains/registrations/{id}/trade` — 202
public func trade(id: String, body: TradeBody) async throws -> ActionResponse {
try await client.request(.registrations_trade, params: ["id": id], body: body)
}
/// Transfer a .ro domain to ird
/// Enqueue an inbound transfer with the authorization key obtained from your current registrar/the registry.
/// `POST /domains/transfers-in` — 202
public func transferIn(body: TransferInBody) async throws -> RegistrationActionResponse {
try await client.request(.registrations_transferIn, body: body)
}
/// Trade a .ro domain into ird (become the holder)
/// Enqueue an inbound trade: acquire a domain bought outside ird (person-to-person, a marketplace) — the domain may still sit at another registrar.
/// `POST /domains/trades-in` — 202
public func tradeIn(body: TradeInBody) async throws -> RegistrationActionResponse {
try await client.request(.registrations_tradeIn, body: body)
}
/// Adopt an ird-sponsored domain you already own
/// Claim a domain that already sits under ird's registrar account with a registrant email you have proven control of (your login email, or an address verified through the registrant-email flow) but has no registration in any ird account.
/// `POST /domains/adoptions` — 201
public func adopt(body: DomainNameResponse) async throws -> RegistrationResponse {
try await client.request(.registrations_adopt, body: body)
}
/// List your registry actions
/// Every registrar operation you've enqueued, newest first; filter with `state`, paginate with `cursor` (the last `seq` served). Charged per request.
/// `GET /domains/actions` — 200
public func listActions(query: ListActionsQuery = ListActionsQuery()) async throws -> ListActionsResponse {
try await client.request(.registrations_listActions, query: query.queryItems)
}
/// Poll a registry action
/// Terminal states: succeeded, failed (charge refunded), cancelled. submitted/awaiting-registry/reconciling mean the registry is being consulted — keep polling. Charged per request.
/// `GET /domains/actions/{id}` — 200
public func getAction(id: String) async throws -> ActionResponse {
try await client.request(.registrations_getAction, params: ["id": id])
}
/// Cancel a queued action
/// Only while the action has not touched the registry (queued); the up-front charge is refunded immediately.
/// `POST /domains/actions/{id}/cancel` — 200
public func cancelAction(id: String, body: TotpCodeBody? = nil) async throws -> ActionResponse {
try await client.request(.registrations_cancelAction, params: ["id": id], body: body)
}
}
extension IrdClient {
public var registrations: RegistrationsAPI { RegistrationsAPI(client: self) }
}
|