Module: Dnsimple::Client::Registrar
- Included in:
- RegistrarService
- Defined in:
- lib/dnsimple/client/registrar.rb
Instance Method Summary collapse
-
#check_domain(account_id, domain_name, options = {}) ⇒ Struct::DomainCheck
Checks whether a domain is available to be registered.
-
#register_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::Domain
Registers a domain.
-
#renew_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::Domain
Renews a domain.
-
#transfer_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::Domain
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
#check_domain(account_id, domain_name, options = {}) ⇒ Struct::DomainCheck
Checks whether a domain is available to be registered.
18 19 20 21 22 23 |
# File 'lib/dnsimple/client/registrar.rb', line 18 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 |
#register_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::Domain
Registers a domain.
40 41 42 43 44 45 46 |
# File 'lib/dnsimple/client/registrar.rb', line 40 def register_domain(account_id, domain_name, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:registrant_id]) endpoint = Client.versioned("/%s/registrar/domains/%s/registration" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::Domain.new(response["data"])) end |
#renew_domain(account_id, domain_name, attributes = nil, options = {}) ⇒ Struct::Domain
Renews a domain.
62 63 64 65 66 67 |
# File 'lib/dnsimple/client/registrar.rb', line 62 def renew_domain(account_id, domain_name, attributes = nil, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/renewal" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::Domain.new(response["data"])) end |
#transfer_domain(account_id, domain_name, attributes, options = {}) ⇒ Struct::Domain
Starts the transfer of a domain to DNSimple.
83 84 85 86 87 88 89 |
# File 'lib/dnsimple/client/registrar.rb', line 83 def transfer_domain(account_id, domain_name, attributes, = {}) Extra.validate_mandatory_attributes(attributes, [:registrant_id]) endpoint = Client.versioned("/%s/registrar/domains/%s/transfer" % [account_id, domain_name]) response = client.post(endpoint, attributes, ) Dnsimple::Response.new(response, Struct::Domain.new(response["data"])) end |
#transfer_domain_out(account_id, domain_name, options = {}) ⇒ Dnsimple::Response<nil>
Requests the transfer of a domain out of DNSimple.
104 105 106 107 108 109 |
# File 'lib/dnsimple/client/registrar.rb', line 104 def transfer_domain_out(account_id, domain_name, = {}) endpoint = Client.versioned("/%s/registrar/domains/%s/transfer_out" % [account_id, domain_name]) response = client.post(endpoint, nil, ) Dnsimple::Response.new(response, nil) end |