Skip to content

Commit ddcc3fc

Browse files
committed
Removed deprecated get_whois_privacy and renew_whois_privacy
See dnsimple/dnsimple-developer#919
1 parent b2fd5d1 commit ddcc3fc

File tree

8 files changed

+2
-186
lines changed

8 files changed

+2
-186
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Removed
1111

1212
- Removed deprecated `get_domain_premium_price`. Use `get_domain_prices` instead.
13+
- Removed deprecated `get_whois_privacy` (dnsimple/dnsimple-developer#919)
14+
- Removed deprecated `renew_whois_privacy` (dnsimple/dnsimple-developer#919)
1315

1416
## 7.0.0
1517

lib/dnsimple/registrar.ex

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ defmodule Dnsimple.Registrar do
2323
alias Dnsimple.TransferLock
2424
alias Dnsimple.VanityNameServer
2525
alias Dnsimple.WhoisPrivacy
26-
alias Dnsimple.WhoisPrivacyRenewal
2726

2827
@doc """
2928
Checks if a domain name is available to be registered and whether premium
@@ -338,27 +337,6 @@ defmodule Dnsimple.Registrar do
338337
|> Response.parse(%{"data" => %TransferLock{}})
339338
end
340339

341-
@doc """
342-
Returns the whois privacy of the domain.
343-
344-
See:
345-
- https://developer.dnsimple.com/v2/registrar/whois-privacy/#getWhoisPrivacy
346-
347-
## Examples:
348-
349-
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
350-
{:ok, response} = Dnsimple.Registrar.get_whois_privacy(client, account_id = 1010, domain_id = "example.com")
351-
352-
"""
353-
@spec get_whois_privacy(Client.t, integer | String.t, String.t, Keyword.t) :: {:ok|:error, Response.t}
354-
def get_whois_privacy(client, account_id, domain_name, options \\ []) do
355-
url = Client.versioned("/#{account_id}/registrar/domains/#{domain_name}/whois_privacy")
356-
357-
Client.get(client, url, options)
358-
|> Response.parse(%{"data" => %WhoisPrivacy{}})
359-
end
360-
361-
362340
@doc """
363341
Enables whois privacy for the domain.
364342
@@ -401,27 +379,6 @@ defmodule Dnsimple.Registrar do
401379
end
402380

403381

404-
@doc """
405-
Renews whois privacy for the domain.
406-
407-
See:
408-
- https://developer.dnsimple.com/v2/registrar/whois-privacy/#renewWhoisPrivacy
409-
410-
## Examples:
411-
412-
client = %Dnsimple.Client{access_token: "a1b2c3d4"}
413-
{:ok, response} = Dnsimple.Registrar.renew_whois_privacy(client, account_id = 1010, domain_id = "example.com")
414-
415-
"""
416-
@spec renew_whois_privacy(Client.t, integer | String.t, String.t, Keyword.t) :: {:ok|:error, Response.t}
417-
def renew_whois_privacy(client, account_id, domain_name, options \\ []) do
418-
url = Client.versioned("/#{account_id}/registrar/domains/#{domain_name}/whois_privacy/renewals")
419-
420-
Client.post(client, url, options)
421-
|> Response.parse(%{"data" => %WhoisPrivacyRenewal{}})
422-
end
423-
424-
425382
@doc """
426383
Returns the name servers the domain is delegating to.
427384

lib/dnsimple/whois_privacy_renewal.ex

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/dnsimple/registrar_test.exs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -331,29 +331,6 @@ defmodule Dnsimple.RegistrarTest do
331331
end
332332

333333

334-
describe ".get_whois_privacy" do
335-
test "returns the whois privacy in a Dnsimple.Response" do
336-
url = "#{@client.base_url}/v2/#{@account_id}/registrar/domains/example.com/whois_privacy"
337-
method = "get"
338-
fixture = "getWhoisPrivacy/success.http"
339-
340-
use_cassette :stub, ExvcrUtils.response_fixture(fixture, method: method, url: url) do
341-
{:ok, response} = @module.get_whois_privacy(@client, @account_id, "example.com")
342-
assert response.__struct__ == Dnsimple.Response
343-
344-
data = response.data
345-
assert data.__struct__ == Dnsimple.WhoisPrivacy
346-
assert data.id == 1
347-
assert data.domain_id == 2
348-
assert data.enabled == true
349-
assert data.expires_on == "2017-02-13"
350-
assert data.created_at == "2016-02-13T14:34:50Z"
351-
assert data.updated_at == "2016-02-13T14:34:52Z"
352-
end
353-
end
354-
end
355-
356-
357334
describe ".enable_whois_privacy" do
358335
test "enables the whois privacy and returns it in a Dnsimple.Response" do
359336
url = "#{@client.base_url}/v2/#{@account_id}/registrar/domains/example.com/whois_privacy"
@@ -400,31 +377,6 @@ defmodule Dnsimple.RegistrarTest do
400377
end
401378

402379

403-
describe ".renew_whois_privacy" do
404-
test "renews the whois privacy and returns it in a Dnsimple.Response" do
405-
url = "#{@client.base_url}/v2/#{@account_id}/registrar/domains/example.com/whois_privacy/renewals"
406-
method = "post"
407-
fixture = "renewWhoisPrivacy/success.http"
408-
409-
use_cassette :stub, ExvcrUtils.response_fixture(fixture, method: method, url: url) do
410-
{:ok, response} = @module.renew_whois_privacy(@client, @account_id, "example.com")
411-
assert response.__struct__ == Dnsimple.Response
412-
413-
data = response.data
414-
assert data.__struct__ == Dnsimple.WhoisPrivacyRenewal
415-
assert data.id == 1
416-
assert data.domain_id == 100
417-
assert data.whois_privacy_id == 999
418-
assert data.state == "new"
419-
assert data.enabled == true
420-
assert data.expires_on == "2020-01-10"
421-
assert data.created_at == "2019-01-10T12:12:48Z"
422-
assert data.updated_at == "2019-01-10T12:12:48Z"
423-
end
424-
end
425-
end
426-
427-
428380
describe ".get_domain_delegation" do
429381
test "returns the name servers in a Dnsimple.Response" do
430382
url = "#{@client.base_url}/v2/#{@account_id}/registrar/domains/#{@domain_id}/delegation"

test/fixtures.http/getWhoisPrivacy/success.http

Lines changed: 0 additions & 16 deletions
This file was deleted.

test/fixtures.http/renewWhoisPrivacy/success.http

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/fixtures.http/renewWhoisPrivacy/whois-privacy-duplicated-order.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

test/fixtures.http/renewWhoisPrivacy/whois-privacy-not-found.http

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)