Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dnsimple/struct/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Domain(Struct):
"""True if the domain is set to auto-renew, false otherwise"""
private_whois = False
"""True if the domain WHOIS privacy is enabled, false otherwise"""
trustee_service = False
"""True if the domain Trustee service is enabled, false otherwise"""
expires_at = None
"""The date the domain will expire"""
created_at = None
Expand Down
6 changes: 4 additions & 2 deletions dnsimple/struct/domain_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ class DomainPrice(Struct):
"""The domain name"""
premium = None
"""If the domain name is premium return True"""
registartion_price = None
"""The domain's registation price"""
registration_price = None
"""The domain's registration price"""
renewal_price = None
"""The domain's renewal price"""
transfer_price = None
"""The domain's transfer price"""
trustee_service_price = None
"""The domain's Trustee service price"""
def __init__(self, data):
super().__init__(data)
24 changes: 20 additions & 4 deletions dnsimple/struct/domain_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,24 @@
class DomainRegistrationRequest(dict):
"""DomainRegisterRequest represents the attributes you can pass to a register API request."""

def __init__(self, registrant_id, whois_privacy=False, auto_renew=False, extended_attributes=None,
premium_price=None):
dict.__init__(self, registrant_id=registrant_id, whois_privacy=whois_privacy, auto_renew=auto_renew,
extended_attributes=extended_attributes, premium_price=premium_price)
def __init__(
self,
registrant_id,
whois_privacy=False,
auto_renew=False,
extended_attributes=None,
premium_price=None,
trustee_service=None,
):
dict.__init__(
self,
registrant_id=registrant_id,
whois_privacy=whois_privacy,
auto_renew=auto_renew,
extended_attributes=extended_attributes,
premium_price=premium_price,
trustee_service=trustee_service,
)

def to_json(self):
return json.dumps(omitempty(self))
Expand All @@ -35,6 +49,8 @@ class DomainRegistration(Struct):
"""True if the domain auto-renew was requested"""
whois_privacy = False
"""True if the domain WHOIS privacy was requested"""
trustee_service = False
"""True if the domain Trustee service was requested"""
created_at = None
"""When the domain renewal was created in DNSimple"""
updated_at = None
Expand Down
4 changes: 4 additions & 0 deletions dnsimple/struct/tld.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Tld(Struct):
"""True if DNSimple supports renewals for this TLD"""
transfer_enabled = None
"""True if DNSimple supports inbound transfers for this TLD"""
trustee_service_enabled = None
"""True if Trustee service is available for this TLD"""
trustee_service_required = None
"""True if Trustee service is required for this TLD"""
dnssec_interface_type = None
"""Type of data interface required for DNSSEC for this TLD"""

Expand Down
1 change: 1 addition & 0 deletions tests/service/domains_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_retrieves_a_domain(self):
domain = self.domains.get_domain(1010, 1).data

self.assertEqual('example-alpha.com', domain.name)
self.assertFalse(domain.trustee_service)

@responses.activate
def test_deletes_a_domain(self):
Expand Down
3 changes: 3 additions & 0 deletions tests/service/registrar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_get_domain_prices(self):
self.assertEqual(20.0, domain_prices.registration_price)
self.assertEqual(20.0, domain_prices.renewal_price)
self.assertEqual(20.0, domain_prices.transfer_price)
self.assertEqual(20.0, domain_prices.trustee_service_price)

@responses.activate
def test_get_domain_prices_for_unsupported_tld(self):
Expand All @@ -57,6 +58,7 @@ def test_get_domain_registration(self):
self.assertEqual(domain_registration.state, "registering")
self.assertEqual(domain_registration.auto_renew, False)
self.assertEqual(domain_registration.whois_privacy, False)
self.assertEqual(domain_registration.trustee_service, False)
self.assertEqual(domain_registration.created_at, "2023-01-27T17:44:32Z")
self.assertEqual(domain_registration.updated_at, "2023-01-27T17:44:40Z")

Expand Down Expand Up @@ -88,6 +90,7 @@ def test_register_domain(self):
self.assertEqual('new', domain_registration.state)
self.assertFalse(domain_registration.auto_renew)
self.assertFalse(domain_registration.whois_privacy)
self.assertFalse(domain_registration.trustee_service)
self.assertEqual('2016-12-09T19:35:31Z', domain_registration.created_at)
self.assertEqual('2016-12-09T19:35:31Z', domain_registration.updated_at)

Expand Down
2 changes: 2 additions & 0 deletions tests/service/tlds_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def test_get_tld(self):
self.assertEqual('com', tld.tld)
self.assertEqual(1, tld.tld_type)
self.assertTrue(tld.whois_privacy)
self.assertFalse(tld.trustee_service_enabled)
self.assertFalse(tld.auto_renew_only)
self.assertFalse(tld.trustee_service_required)
self.assertTrue(tld.idn)
self.assertEqual(1, tld.minimum_registration)
self.assertTrue(tld.registration_enabled)
Expand Down