Module: Dnsimple::Client::RegistrarWhoisPrivacy

Included in:
RegistrarService
Defined in:
lib/dnsimple/client/registrar_whois_privacy.rb

Instance Method Summary collapse

Instance Method Details

#disable_whois_privacy(account_id, domain_name, options = {}) ⇒ Struct::WhoisPrivacy

Disables whois privacy for the domain.

Examples:

Disable whois privacy for “example.com”:

client.registrar.disable_whois_privacy(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    The domain name

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



60
61
62
63
64
65
# File 'lib/dnsimple/client/registrar_whois_privacy.rb', line 60

def disable_whois_privacy(, domain_name, options = {})
  endpoint = whois_privacy_endpoint(, domain_name)
  response = client.delete(endpoint, nil, options)

  Dnsimple::Response.new(response, Struct::WhoisPrivacy.new(response["data"]))
end

#enable_whois_privacy(account_id, domain_name, options = {}) ⇒ Struct::WhoisPrivacy

Enables whois privacy for the domain.

Examples:

Enable whois privacy for “example.com”:

client.registrar.enable_whois_privacy(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



40
41
42
43
44
45
# File 'lib/dnsimple/client/registrar_whois_privacy.rb', line 40

def enable_whois_privacy(, domain_name, options = {})
  endpoint = whois_privacy_endpoint(, domain_name)
  response = client.put(endpoint, nil, options)

  Dnsimple::Response.new(response, Struct::WhoisPrivacy.new(response["data"]))
end

#renew_whois_privacy(account_id, domain_name, options = {}) ⇒ Struct::WhoisPrivacy

Renews whois privacy for the domain.

Examples:

Renew whois privacy for “example.com”:

client.registrar.renew_whois_privacy(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    The domain name

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



80
81
82
83
84
85
# File 'lib/dnsimple/client/registrar_whois_privacy.rb', line 80

def renew_whois_privacy(, domain_name, options = {})
  endpoint = "#{whois_privacy_endpoint(, domain_name)}/renewals"
  response = client.post(endpoint, nil, options)

  Dnsimple::Response.new(response, Struct::WhoisPrivacyRenewal.new(response["data"]))
end

#whois_privacy(account_id, domain_name, options = {}) ⇒ Struct::WhoisPrivacy

Gets the whois privacy for the domain.

Examples:

Get the whois privacy for “example.com”:

client.registrar.whois_privacy(1010, "example.com")

Parameters:

  • account_id (Integer)

    the account ID

  • domain_name (#to_s)

    the domain name

  • options (Hash) (defaults to: {})

Returns:

Raises:

See Also:



20
21
22
23
24
25
# File 'lib/dnsimple/client/registrar_whois_privacy.rb', line 20

def whois_privacy(, domain_name, options = {})
  endpoint = whois_privacy_endpoint(, domain_name)
  response = client.get(endpoint, options)

  Dnsimple::Response.new(response, Struct::WhoisPrivacy.new(response["data"]))
end