Skip to content

Commit ad58440

Browse files
Rename trustee JSON fields (#472)
1 parent c7e91c7 commit ad58440

14 files changed

Lines changed: 27 additions & 27 deletions

File tree

lib/dnsimple/struct/domain.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Domain < Base
2727
# @return [Bool] True if the domain WHOIS privacy is enabled, false otherwise.
2828
attr_accessor :private_whois
2929

30-
# @return [Bool] True if the domain Trustee service is enabled, false otherwise.
31-
attr_accessor :trustee_service
30+
# @return [Bool] True if the domain trustee is enabled, false otherwise.
31+
attr_accessor :trustee
3232

3333
# @return [String] The timestamp when domain will expire.
3434
attr_accessor :expires_at

lib/dnsimple/struct/domain_price.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class DomainPrice < Base
1818
# @return [Float] The price for transfer
1919
attr_accessor :transfer_price
2020

21-
# @return [Float] The Trustee service price
22-
attr_accessor :trustee_service_price
21+
# @return [Float] The trustee price
22+
attr_accessor :trustee_price
2323
end
2424
end
2525
end

lib/dnsimple/struct/domain_registration.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class DomainRegistration < Base
2424
# @return [Bool] True if the domain WHOIS privacy was requested.
2525
attr_accessor :whois_privacy
2626

27-
# @return [Bool] True if the domain Trustee service was requested.
28-
attr_accessor :trustee_service
27+
# @return [Bool] True if trustee was requested.
28+
attr_accessor :trustee
2929

3030
# @return [String] When the domain renewal was created in DNSimple.
3131
attr_accessor :created_at

lib/dnsimple/struct/domain_transfer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class DomainTransfer < Base
2121
# @return [Bool] True if the domain WHOIS privacy was requested.
2222
attr_accessor :whois_privacy
2323

24-
# @return [Bool] True if the domain Trustee service was requested.
25-
attr_accessor :trustee_service
24+
# @return [Bool] True if trustee was requested.
25+
attr_accessor :trustee
2626

2727
# @return [String,nil] The reason if transfer failed.
2828
attr_accessor :status_description

test/dnsimple/client/domains_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def setup
172172
assert_equal("registered", result.state)
173173
refute(result.auto_renew)
174174
refute(result.private_whois)
175-
refute(result.trustee_service)
175+
refute(result.trustee)
176176
assert_equal("2021-06-05T02:15:00Z", result.expires_at)
177177
assert_equal("2020-06-04T19:15:14Z", result.created_at)
178178
assert_equal("2020-06-04T19:15:21Z", result.updated_at)

test/dnsimple/client/registrar_test.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ def setup
6262
assert_in_delta(20.0, result.registration_price)
6363
assert_in_delta(20.0, result.renewal_price)
6464
assert_in_delta(20.0, result.transfer_price)
65-
if result.trustee_service_price.nil?
66-
assert_nil result.trustee_service_price
65+
if result.trustee_price.nil?
66+
assert_nil result.trustee_price
6767
else
68-
assert_in_delta(20.0, result.trustee_service_price)
68+
assert_in_delta(20.0, result.trustee_price)
6969
end
7070
end
7171

@@ -83,7 +83,7 @@ def setup
8383
stub_request(:post, %r{/v2/#{@account_id}/registrar/domains/.+/registrations$})
8484
.to_return(read_http_fixture("registerDomain/success.http"))
8585

86-
attributes = { registrant_id: "10", trustee_service: true }
86+
attributes = { registrant_id: "10", trustee: true }
8787
@subject.register_domain(@account_id, domain_name = "example.com", attributes)
8888

8989
assert_requested(:post, "https://api.dnsimple.test/v2/#{@account_id}/registrar/domains/#{domain_name}/registrations",
@@ -105,7 +105,7 @@ def setup
105105
assert_kind_of(Dnsimple::Struct::DomainRegistration, result)
106106
assert_kind_of(Integer, result.id)
107107
assert_kind_of(Integer, result.domain_id)
108-
refute(result.trustee_service)
108+
refute(result.trustee)
109109
end
110110

111111
test "register domain when attributes are incomplete raises argument error" do
@@ -138,7 +138,7 @@ def setup
138138
assert_kind_of(Dnsimple::Struct::DomainRegistration, result)
139139
assert_kind_of(Integer, result.id)
140140
assert_kind_of(Integer, result.domain_id)
141-
refute(result.trustee_service)
141+
refute(result.trustee)
142142
end
143143

144144

@@ -211,7 +211,7 @@ def setup
211211
stub_request(:post, %r{/v2/#{@account_id}/registrar/domains/.+/transfers$})
212212
.to_return(read_http_fixture("transferDomain/success.http"))
213213

214-
attributes = { registrant_id: "10", auth_code: "x1y2z3", trustee_service: true }
214+
attributes = { registrant_id: "10", auth_code: "x1y2z3", trustee: true }
215215
@subject.transfer_domain(@account_id, domain_name = "example.com", attributes)
216216

217217
assert_requested(:post, "https://api.dnsimple.test/v2/#{@account_id}/registrar/domains/#{domain_name}/transfers",
@@ -233,7 +233,7 @@ def setup
233233
assert_kind_of(Dnsimple::Struct::DomainTransfer, result)
234234
assert_kind_of(Integer, result.id)
235235
assert_kind_of(Integer, result.domain_id)
236-
refute(result.trustee_service)
236+
refute(result.trustee)
237237
end
238238

239239
test "transfer domain when attributes are incomplete raises argument error" do
@@ -289,7 +289,7 @@ def setup
289289
assert_equal("cancelled", result.state)
290290
refute(result.auto_renew)
291291
refute(result.whois_privacy)
292-
refute(result.trustee_service)
292+
refute(result.trustee)
293293
assert_equal("Canceled by customer", result.status_description)
294294
assert_equal("2020-06-05T18:08:00Z", result.created_at)
295295
assert_equal("2020-06-05T18:10:01Z", result.updated_at)
@@ -323,7 +323,7 @@ def setup
323323
assert_equal("transferring", result.state)
324324
refute(result.auto_renew)
325325
refute(result.whois_privacy)
326-
refute(result.trustee_service)
326+
refute(result.trustee)
327327
assert_nil(result.status_description)
328328
assert_equal("2020-06-05T18:08:00Z", result.created_at)
329329
assert_equal("2020-06-05T18:08:04Z", result.updated_at)

test/fixtures.http/cancelDomainTransfer/success.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ x-xss-protection: 1; mode=block
1515
x-download-options: noopen
1616
x-permitted-cross-domain-policies: none
1717

18-
{"data":{"id":361,"domain_id":182245,"registrant_id":2715,"state":"transferring","auto_renew":false,"whois_privacy":false,"trustee_service":false,"status_description":null,"created_at":"2020-06-05T18:08:00Z","updated_at":"2020-06-05T18:08:04Z"}}
18+
{"data":{"id":361,"domain_id":182245,"registrant_id":2715,"state":"transferring","auto_renew":false,"whois_privacy":false,"trustee":false,"status_description":null,"created_at":"2020-06-05T18:08:00Z","updated_at":"2020-06-05T18:08:04Z"}}

test/fixtures.http/getDomain/success.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ x-download-options: noopen
1717
x-permitted-cross-domain-policies: none
1818
strict-transport-security: max-age=31536000
1919

20-
{"data":{"id":181984,"account_id":1385,"registrant_id":2715,"name":"example-alpha.com","unicode_name":"example-alpha.com","state":"registered","auto_renew":false,"private_whois":false,"trustee_service":false,"expires_on":"2021-06-05","expires_at":"2021-06-05T02:15:00Z","created_at":"2020-06-04T19:15:14Z","updated_at":"2020-06-04T19:15:21Z"}}
20+
{"data":{"id":181984,"account_id":1385,"registrant_id":2715,"name":"example-alpha.com","unicode_name":"example-alpha.com","state":"registered","auto_renew":false,"private_whois":false,"trustee":false,"expires_on":"2021-06-05","expires_at":"2021-06-05T02:15:00Z","created_at":"2020-06-04T19:15:14Z","updated_at":"2020-06-04T19:15:21Z"}}

test/fixtures.http/getDomainPrices/success.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ x-permitted-cross-domain-policies: none
1818
content-security-policy: frame-ancestors 'none'
1919
strict-transport-security: max-age=31536000
2020

21-
{"data":{"domain":"bingo.pizza","premium":true,"registration_price":20.0,"renewal_price":20.0,"transfer_price":20.0,"restore_price":20.0,"trustee_service_price":20.0}}
21+
{"data":{"domain":"bingo.pizza","premium":true,"registration_price":20.0,"renewal_price":20.0,"transfer_price":20.0,"restore_price":20.0,"trustee_price":20.0}}

test/fixtures.http/getDomainRegistration/success.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ x-download-options: noopen
1717
x-permitted-cross-domain-policies: none
1818
strict-transport-security: max-age=31536000
1919

20-
{"data":{"id":361,"domain_id":104040,"registrant_id":2715,"period":1,"state":"registering","auto_renew":false,"whois_privacy":false,"trustee_service":false,"created_at":"2023-01-27T17:44:32Z","updated_at":"2023-01-27T17:44:40Z"}}
20+
{"data":{"id":361,"domain_id":104040,"registrant_id":2715,"period":1,"state":"registering","auto_renew":false,"whois_privacy":false,"trustee":false,"created_at":"2023-01-27T17:44:32Z","updated_at":"2023-01-27T17:44:40Z"}}

0 commit comments

Comments
 (0)