Module: Dnsimple::Client::Registrar
- Included in:
- RegistrarService
- Defined in:
- lib/dnsimple/client/registrar.rb
Instance Method Summary collapse
-
#cancel_domain_transfer(account_id, domain_name, domain_transfer_id, options = {}) ⇒ Struct::DomainTransfer
Cancels an in progress domain transfer.
-
#check_domain(account_id, domain_name, options = {}) ⇒ Struct::DomainCheck
Checks whether a domain is available to be registered.
-
#get_domain_prices(account_id, domain_name, options = {}) ⇒ Struct::DomainPrice
Get prices for a domain.
-
#get_domain_registration(account_id, domain_name, domain_registration_id, options = {}) ⇒ Struct::DomainRegistration
Retrieves the details of an existing domain registration.
-
#get_domain_renewal(account_id, domain_name, domain_renewal_id, options = {}) ⇒ Struct::DomainRenewal
Retrieve the details of an existing domain renewal.
-
#get_domain_restore(account_id, domain_name, domain_restore_id, options = {}) ⇒ Struct::DomainRestore
Retrieve the details of an existing domain restore.
-
#get_domain_transfer(account_id, domain_name, domain_transfer_id, options = {}) ⇒ Struct::DomainTransfer
Retrieves the details of an existing domain transfer.
-
#register_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::DomainRegistration
Registers a domain.
-
#renew_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::DomainRenewal
Renews a domain.
-
#restore_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::DomainRestore
Restores a domain.
-
#transfer_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::DomainTransfer
Starts the transfer of a domain to DNSimple.
-
#transfer_domain_out(account_id, domain_name, options = {}) ⇒ Dnsimple::Response<nil>
Requests the transfer of a domain out of DNSimple.
Instance Method Details
#cancel_domain_transfer(account_id, domain_name, domain_transfer_id, options = {}) ⇒ Struct::DomainTransfer
Cancels an in progress domain transfer.
193 194 195 196 197 198 |
# File 'lib/dnsimple/client/registrar.rb', line 193 def cancel_domain_transfer(account_id, domain_name, domain_transfer_id, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/transfers/%s" % [account_id, domain_name, domain_transfer_id]) response = client.delete(endpoint, ) Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"])) end |
#check_domain(account_id, domain_name, options = {}) ⇒ Struct::DomainCheck
Checks whether a domain is available to be registered.
19 20 21 22 23 24 |
# File 'lib/dnsimple/client/registrar.rb', line 19 def check_domain(account_id, domain_name, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/check" % [account_id, domain_name]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainCheck.new(response["data"])) end |
#get_domain_prices(account_id, domain_name, options = {}) ⇒ Struct::DomainPrice
Get prices for a domain.
39 40 41 42 43 44 |
# File 'lib/dnsimple/client/registrar.rb', line 39 def get_domain_prices(account_id, domain_name, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/prices" % [account_id, domain_name]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainPrice.new(response["data"])) end |
#get_domain_registration(account_id, domain_name, domain_registration_id, options = {}) ⇒ Struct::DomainRegistration
Retrieves the details of an existing domain registration.
84 85 86 87 88 89 |
# File 'lib/dnsimple/client/registrar.rb', line 84 def get_domain_registration(account_id, domain_name, domain_registration_id, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/registrations/%s" % [account_id, domain_name, domain_registration_id]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainRegistration.new(response["data"])) end |
#get_domain_renewal(account_id, domain_name, domain_renewal_id, options = {}) ⇒ Struct::DomainRenewal
Retrieve the details of an existing domain renewal.
127 128 129 130 131 132 |
# File 'lib/dnsimple/client/registrar.rb', line 127 def get_domain_renewal(account_id, domain_name, domain_renewal_id, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/renewals/%s" % [account_id, domain_name, domain_renewal_id]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainRenewal.new(response["data"])) end |
#get_domain_restore(account_id, domain_name, domain_restore_id, options = {}) ⇒ Struct::DomainRestore
Retrieve the details of an existing domain restore.
256 257 258 259 260 261 |
# File 'lib/dnsimple/client/registrar.rb', line 256 def get_domain_restore(account_id, domain_name, domain_restore_id, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/restores/%s" % [account_id, domain_name, domain_restore_id]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainRestore.new(response["data"])) end |
#get_domain_transfer(account_id, domain_name, domain_transfer_id, options = {}) ⇒ Struct::DomainTransfer
Retrieves the details of an existing domain transfer.
171 172 173 174 175 176 |
# File 'lib/dnsimple/client/registrar.rb', line 171 def get_domain_transfer(account_id, domain_name, domain_transfer_id, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/transfers/%s" % [account_id, domain_name, domain_transfer_id]) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"])) end |
#register_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::DomainRegistration
Registers a domain.
61 62 63 64 65 66 67 |
# File 'lib/dnsimple/client/registrar.rb', line 61 def register_domain(account_id, domain_name, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:registrant_id]) endpoint = Client.versioned("/%s/registrar/domains/%s/registrations" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::DomainRegistration.new(response["data"])) end |
#renew_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::DomainRenewal
Renews a domain.
105 106 107 108 109 110 |
# File 'lib/dnsimple/client/registrar.rb', line 105 def renew_domain(account_id, domain_name, attributes = nil, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/renewals" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::DomainRenewal.new(response["data"])) end |
#restore_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::DomainRestore
Restores a domain.
234 235 236 237 238 239 |
# File 'lib/dnsimple/client/registrar.rb', line 234 def restore_domain(account_id, domain_name, attributes = nil, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/restores" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::DomainRestore.new(response["data"])) end |
#transfer_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::DomainTransfer
Starts the transfer of a domain to DNSimple.
148 149 150 151 152 153 154 |
# File 'lib/dnsimple/client/registrar.rb', line 148 def transfer_domain(account_id, domain_name, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:registrant_id]) endpoint = Client.versioned("/%s/registrar/domains/%s/transfers" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::DomainTransfer.new(response["data"])) end |
#transfer_domain_out(account_id, domain_name, options = {}) ⇒ Dnsimple::Response<nil>
Requests the transfer of a domain out of DNSimple.
213 214 215 216 217 218 |
# File 'lib/dnsimple/client/registrar.rb', line 213 def transfer_domain_out(account_id, domain_name, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/authorize_transfer_out" % [account_id, domain_name]) response = client.post(endpoint, nil, ) Dnsimple::Response.new(response, nil) end |