Skip to content

Commit 299d5af

Browse files
authored
Removed deprecated GetWhoisPrivacy and RenewWhoisPrivacy (#237)
See dnsimple/dnsimple-developer#919
1 parent df0ff55 commit 299d5af

File tree

7 files changed

+4
-173
lines changed

7 files changed

+4
-173
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
### Removed
1111

12-
- Deprecated `GetDomainPremiumPrice`. Use `GetDomainPrices` instead.
12+
- Removed deprecated `GetDomainPremiumPrice`. Use `GetDomainPrices` instead.
13+
- Removed deprecated `GetDomainPremiumPrice`. Use `GetDomainPrices` instead.
14+
- Removed deprecated `GetWhoisPrivacy` (dnsimple/dnsimple-developer#919)
15+
- Removed deprecated `RenewWhoisPrivacy` (dnsimple/dnsimple-developer#919)
1316

1417
## 7.0.1 - 2025-10-22
1518

dnsimple/registrar_whois_privacy.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,12 @@ type WhoisPrivacy struct {
1515
UpdatedAt string `json:"updated_at,omitempty"`
1616
}
1717

18-
// WhoisPrivacyRenewal represents a whois privacy renewal in DNSimple.
19-
type WhoisPrivacyRenewal struct {
20-
ID int64 `json:"id,omitempty"`
21-
DomainID int64 `json:"domain_id,omitempty"`
22-
WhoisPrivacyID int64 `json:"whois_privacy_id,omitempty"`
23-
State string `json:"string,omitempty"`
24-
Enabled bool `json:"enabled,omitempty"`
25-
ExpiresOn string `json:"expires_on,omitempty"`
26-
CreatedAt string `json:"created_at,omitempty"`
27-
UpdatedAt string `json:"updated_at,omitempty"`
28-
}
29-
3018
// WhoisPrivacyResponse represents a response from an API method that returns a WhoisPrivacy struct.
3119
type WhoisPrivacyResponse struct {
3220
Response
3321
Data *WhoisPrivacy `json:"data"`
3422
}
3523

36-
// WhoisPrivacyRenewalResponse represents a response from an API method that returns a WhoisPrivacyRenewal struct.
37-
type WhoisPrivacyRenewalResponse struct {
38-
Response
39-
Data *WhoisPrivacyRenewal `json:"data"`
40-
}
41-
42-
// GetWhoisPrivacy gets the whois privacy for the domain.
43-
//
44-
// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#get
45-
func (s *RegistrarService) GetWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyResponse, error) {
46-
path := versioned(fmt.Sprintf("/%v/registrar/domains/%v/whois_privacy", accountID, domainName))
47-
privacyResponse := &WhoisPrivacyResponse{}
48-
49-
resp, err := s.client.get(ctx, path, privacyResponse)
50-
if err != nil {
51-
return nil, err
52-
}
53-
54-
privacyResponse.HTTPResponse = resp
55-
return privacyResponse, nil
56-
}
57-
5824
// EnableWhoisPrivacy enables the whois privacy for the domain.
5925
//
6026
// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#enable
@@ -86,19 +52,3 @@ func (s *RegistrarService) DisableWhoisPrivacy(ctx context.Context, accountID st
8652
privacyResponse.HTTPResponse = resp
8753
return privacyResponse, nil
8854
}
89-
90-
// RenewWhoisPrivacy renews the whois privacy for the domain.
91-
//
92-
// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#renew
93-
func (s *RegistrarService) RenewWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyRenewalResponse, error) {
94-
path := versioned(fmt.Sprintf("/%v/registrar/domains/%v/whois_privacy/renewals", accountID, domainName))
95-
privacyRenewalResponse := &WhoisPrivacyRenewalResponse{}
96-
97-
resp, err := s.client.post(ctx, path, nil, privacyRenewalResponse)
98-
if err != nil {
99-
return nil, err
100-
}
101-
102-
privacyRenewalResponse.HTTPResponse = resp
103-
return privacyRenewalResponse, nil
104-
}

dnsimple/registrar_whois_privacy_test.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,6 @@ import (
99
"github.com/stretchr/testify/assert"
1010
)
1111

12-
func TestRegistrarService_GetWhoisPrivacy(t *testing.T) {
13-
setupMockServer()
14-
defer teardownMockServer()
15-
16-
mux.HandleFunc("/v2/1010/registrar/domains/example.com/whois_privacy", func(w http.ResponseWriter, r *http.Request) {
17-
httpResponse := httpResponseFixture(t, "/api/getWhoisPrivacy/success.http")
18-
19-
testMethod(t, r, "GET")
20-
testHeaders(t, r)
21-
22-
w.WriteHeader(httpResponse.StatusCode)
23-
_, _ = io.Copy(w, httpResponse.Body)
24-
})
25-
26-
privacyResponse, err := client.Registrar.GetWhoisPrivacy(context.Background(), "1010", "example.com")
27-
28-
assert.NoError(t, err)
29-
privacy := privacyResponse.Data
30-
wantSingle := &WhoisPrivacy{
31-
ID: 1,
32-
DomainID: 2,
33-
Enabled: true,
34-
ExpiresOn: "2017-02-13",
35-
CreatedAt: "2016-02-13T14:34:50Z",
36-
UpdatedAt: "2016-02-13T14:34:52Z",
37-
}
38-
assert.Equal(t, wantSingle, privacy)
39-
}
40-
4112
func TestRegistrarService_EnableWhoisPrivacy(t *testing.T) {
4213
setupMockServer()
4314
defer teardownMockServer()
@@ -85,24 +56,3 @@ func TestRegistrarService_DisableWhoisPrivacy(t *testing.T) {
8556
privacy := privacyResponse.Data
8657
assert.Equal(t, int64(1), privacy.ID)
8758
}
88-
89-
func TestRegistrarService_RenewWhoisPrivacy(t *testing.T) {
90-
setupMockServer()
91-
defer teardownMockServer()
92-
93-
mux.HandleFunc("/v2/1010/registrar/domains/example.com/whois_privacy/renewals", func(w http.ResponseWriter, r *http.Request) {
94-
httpResponse := httpResponseFixture(t, "/api/renewWhoisPrivacy/success.http")
95-
96-
testMethod(t, r, "POST")
97-
testHeaders(t, r)
98-
99-
w.WriteHeader(httpResponse.StatusCode)
100-
_, _ = io.Copy(w, httpResponse.Body)
101-
})
102-
103-
privacyRenewalResponse, err := client.Registrar.RenewWhoisPrivacy(context.Background(), "1010", "example.com")
104-
105-
assert.NoError(t, err)
106-
privacyRenewal := privacyRenewalResponse.Data
107-
assert.Equal(t, int64(1), privacyRenewal.ID)
108-
}

fixtures.http/api/getWhoisPrivacy/success.http

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

fixtures.http/api/renewWhoisPrivacy/success.http

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

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

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

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

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

0 commit comments

Comments
 (0)