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 | (ns ird.registrations
"Register, renew, transfer, trade and manage .ro domains. Registrations
charge credits up front (refunded on failure); see GET /credits/prices for
current amounts. Mutations are subject to the client's domain gate
(ird.gate) when configured."
(:require
[ird.gate :as gate]
[ird.transport :as transport]))
(defn list-registrations
"GET /domains/registrations — List your domains.
Optional QUERY keys include :cursor, :limit.
Returns the parsed response map."
([client] (list-registrations client nil))
([client query]
(transport/request client :get "/domains/registrations" {:query query})))
(defn list-all-registrations
"List all registrations under :registrations by following cursor
pagination. QUERY may include filters; :cursor is managed automatically."
([client] (list-all-registrations client nil))
([client query]
(transport/paginate client :get "/domains/registrations" :registrations query)))
(defn register
"POST /domains/registrations — Register a .ro domain (202; charges
credits). BODY keys include :domain, :years, :auto_renew, :nameservers,
:use_our_dns.
Returns the parsed response map."
[client body]
(gate/check! client "POST /domains/registrations" {:domain (:domain body)})
(transport/request client :post "/domains/registrations" {:body body}))
(defn get-registration
"GET /domains/registrations/{id} — Get a domain.
Returns the parsed response map."
[client id]
(transport/request client :get (str "/domains/registrations/" id)))
(defn renew
"POST /domains/registrations/{id}/renew — Renew a domain (202; charges
credits). BODY keys include :years, :totp_code.
Returns the parsed response map."
([client id] (renew client id nil))
([client id body]
(gate/check! client "POST /domains/registrations/{id}/renew" {:registration-id id})
(transport/request client :post (str "/domains/registrations/" id "/renew")
(when body {:body body}))))
(defn set-auto-renew
"PUT /domains/registrations/{id}/auto-renew — Toggle auto-renew.
BODY is a plain map with :enabled and optional :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "PUT /domains/registrations/{id}/auto-renew" {:registration-id id})
(transport/request client :put (str "/domains/registrations/" id "/auto-renew")
{:body body}))
(defn set-sensitive
"PUT /domains/registrations/{id}/sensitive — Toggle the sensitive-domain
protection. BODY is a plain map with :enabled and optional :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "PUT /domains/registrations/{id}/sensitive" {:registration-id id})
(transport/request client :put (str "/domains/registrations/" id "/sensitive")
{:body body}))
(defn set-nameservers
"PUT /domains/registrations/{id}/nameservers — Replace nameservers (202).
BODY is a plain map with :nameservers and optional :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "PUT /domains/registrations/{id}/nameservers" {:registration-id id})
(transport/request client :put (str "/domains/registrations/" id "/nameservers")
{:body body}))
(defn list-hosts
"GET /domains/registrations/{id}/hosts — List the domain's hosts (glue
records). Optional QUERY keys include :refresh.
Returns the parsed response map."
([client id] (list-hosts client id nil))
([client id query]
(transport/request client :get (str "/domains/registrations/" id "/hosts")
{:query query})))
(defn create-host
"POST /domains/registrations/{id}/hosts — Create a host (glue record,
202). BODY keys include :host, :ips, :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "POST /domains/registrations/{id}/hosts" {:registration-id id})
(transport/request client :post (str "/domains/registrations/" id "/hosts")
{:body body}))
(defn set-host-ips
"PUT /domains/registrations/{id}/hosts/{host} — Replace a host's IPs
(202). BODY is a plain map with :ips and optional :totp_code.
Returns the parsed response map."
[client id host body]
(gate/check! client "PUT /domains/registrations/{id}/hosts/{host}" {:registration-id id})
(transport/request client :put (str "/domains/registrations/" id "/hosts/" host)
{:body body}))
(defn delete-host
"DELETE /domains/registrations/{id}/hosts/{host} — Delete a host (glue
record, 202). Optional BODY carries :totp_code.
Returns the parsed response map."
([client id host] (delete-host client id host nil))
([client id host body]
(gate/check! client "DELETE /domains/registrations/{id}/hosts/{host}" {:registration-id id})
(transport/request client :delete (str "/domains/registrations/" id "/hosts/" host)
(when body {:body body}))))
(defn list-dsdata
"GET /domains/registrations/{id}/dsdata — List the domain's DS records.
Optional QUERY keys include :refresh.
Returns the parsed response map."
([client id] (list-dsdata client id nil))
([client id query]
(transport/request client :get (str "/domains/registrations/" id "/dsdata")
{:query query})))
(defn publish-dsdata
"POST /domains/registrations/{id}/dsdata — Publish a DS record (202).
BODY keys include :keytag, :alg, :digest_type, :digest, :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "POST /domains/registrations/{id}/dsdata" {:registration-id id})
(transport/request client :post (str "/domains/registrations/" id "/dsdata")
{:body body}))
(defn withdraw-dsdata
"DELETE /domains/registrations/{id}/dsdata — Withdraw a DS record (202).
BODY keys include :keytag, :alg, :digest_type, :digest, :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "DELETE /domains/registrations/{id}/dsdata" {:registration-id id})
(transport/request client :delete (str "/domains/registrations/" id "/dsdata")
{:body body}))
(defn transfer-out
"POST /domains/registrations/{id}/transfer-out — Start moving a domain
away. Optional BODY carries :totp_code.
Returns the parsed response map."
([client id] (transfer-out client id nil))
([client id body]
(gate/check! client "POST /domains/registrations/{id}/transfer-out" {:registration-id id})
(transport/request client :post (str "/domains/registrations/" id "/transfer-out")
(when body {:body body}))))
(defn update-registrant
"PUT /domains/registrations/{id}/registrant — Update the registrant's
contact details (202). BODY keys include :email, :phone, :address1,
:address2, :address3, :city, :state_province, :postal_code, :country_code,
:fax, :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "PUT /domains/registrations/{id}/registrant" {:registration-id id})
(transport/request client :put (str "/domains/registrations/" id "/registrant")
{:body body}))
(defn start-registrant-email-verification
"POST /domains/registrations/{id}/registrant-email/start — Start
registrant-email ownership verification.
Returns the parsed response map."
[client id]
(gate/check! client "POST /domains/registrations/{id}/registrant-email/start" {:registration-id id})
(transport/request client :post
(str "/domains/registrations/" id "/registrant-email/start")))
(defn confirm-registrant-email
"POST /domains/registrations/{id}/registrant-email/confirm — Confirm the
registrant-email code. BODY is a plain map with :token and :code.
Returns the parsed response map."
[client id body]
(gate/check! client "POST /domains/registrations/{id}/registrant-email/confirm" {:registration-id id})
(transport/request client :post
(str "/domains/registrations/" id "/registrant-email/confirm")
{:body body}))
(defn adopt-registrant-email
"POST /domains/registrations/{id}/registrant-email/adopt — Adopt the
registrant contact email (transferred-in domains, 202). BODY is a plain
map with :email and optional :totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "POST /domains/registrations/{id}/registrant-email/adopt" {:registration-id id})
(transport/request client :post
(str "/domains/registrations/" id "/registrant-email/adopt")
{:body body}))
(defn quote-trade
"GET /domains/registrations/{id}/trade — Quote a registrant change
(trade).
Returns the parsed response map."
[client id]
(transport/request client :get (str "/domains/registrations/" id "/trade")))
(defn trade
"POST /domains/registrations/{id}/trade — Change a domain's registrant
(trade, 202; charges credits). BODY keys include :auth_key, :years,
:totp_code.
Returns the parsed response map."
[client id body]
(gate/check! client "POST /domains/registrations/{id}/trade" {:registration-id id})
(transport/request client :post (str "/domains/registrations/" id "/trade")
{:body body}))
(defn transfer-in
"POST /domains/transfers-in — Transfer a .ro domain to ird (202).
BODY keys include :domain, :auth_key, :keep_nameservers, :copy_dns,
:use_ird_dns, :then_trade.
Returns the parsed response map."
[client body]
(gate/check! client "POST /domains/transfers-in" {:domain (:domain body)})
(transport/request client :post "/domains/transfers-in" {:body body}))
(defn trade-in
"POST /domains/trades-in — Trade a .ro domain into ird (become the
holder, 202; charges credits). BODY keys include :domain, :auth_key,
:years, :keep_nameservers, :copy_dns, :use_ird_dns.
Returns the parsed response map."
[client body]
(gate/check! client "POST /domains/trades-in" {:domain (:domain body)})
(transport/request client :post "/domains/trades-in" {:body body}))
(defn adopt
"POST /domains/adoptions — Adopt an ird-sponsored domain you already own.
BODY is a plain map with :domain.
Returns the parsed response map."
[client body]
(gate/check! client "POST /domains/adoptions" {:domain (:domain body)})
(transport/request client :post "/domains/adoptions" {:body body}))
(defn list-actions
"GET /domains/actions — List your registry actions.
Optional QUERY keys include :state, :cursor, :limit.
Returns the parsed response map."
([client] (list-actions client nil))
([client query]
(transport/request client :get "/domains/actions" {:query query})))
(defn list-all-actions
"List all registry actions under :actions by following cursor pagination.
QUERY may include filters; :cursor is managed automatically."
([client] (list-all-actions client nil))
([client query]
(transport/paginate client :get "/domains/actions" :actions query)))
(defn get-action
"GET /domains/actions/{id} — Poll a registry action.
Returns the parsed response map."
[client id]
(transport/request client :get (str "/domains/actions/" id)))
(defn cancel-action
"POST /domains/actions/{id}/cancel — Cancel a queued action.
Optional BODY carries :totp_code. Subject to the client's domain gate on
the action's registration (resolved via `get-action` when a gate is set).
Returns the parsed response map."
([client id] (cancel-action client id nil))
([client id body]
(when (:gate client)
(gate/check! client "POST /domains/actions/{id}/cancel"
{:registration-id (get-in (get-action client id)
[:action :registration_id])}))
(transport/request client :post (str "/domains/actions/" id "/cancel")
(when body {:body body}))))
|