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.
-
#domain_premium_price(account_id, domain_name, options = {}) ⇒ Struct::DomainPremiumPrice
Checks the premium price for a domain.
-
#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.
-
#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.
156 157 158 159 160 161 |
# File 'lib/dnsimple/client/registrar.rb', line 156 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.
20 21 22 23 24 25 |
# File 'lib/dnsimple/client/registrar.rb', line 20 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 |
#domain_premium_price(account_id, domain_name, options = {}) ⇒ Struct::DomainPremiumPrice
Checks the premium price for a domain
45 46 47 48 49 50 51 |
# File 'lib/dnsimple/client/registrar.rb', line 45 def domain_premium_price(account_id, domain_name, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/premium_price" % [account_id, domain_name]) [:query] = { action: .delete(:action) } if .key?(:action) response = client.get(endpoint, ) Dnsimple::Response.new(response, Struct::DomainPremiumPrice.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.
134 135 136 137 138 139 |
# File 'lib/dnsimple/client/registrar.rb', line 134 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.
68 69 70 71 72 73 74 |
# File 'lib/dnsimple/client/registrar.rb', line 68 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.
90 91 92 93 94 95 |
# File 'lib/dnsimple/client/registrar.rb', line 90 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 |
#transfer_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::DomainTransfer
Starts the transfer of a domain to DNSimple.
111 112 113 114 115 116 117 |
# File 'lib/dnsimple/client/registrar.rb', line 111 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.
176 177 178 179 180 181 |
# File 'lib/dnsimple/client/registrar.rb', line 176 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 |