Skip to content

Commit 1b9fecc

Browse files
ggalmazorclaude
andauthored
Add domain push identifier support and account name (#497)
* Add domain push identifier support and account name - Add `new_domain_push_identifier` parameter to `DomainPushInput` - Deprecate `new_account_email` in favor of `new_domain_push_identifier` - Add `name` attribute to `Account` - Update fixtures and tests Closes dnsimple/dnsimple-app#32668 * Fix domain push parameter name to match API spec Rename new_domain_push_identifier to new_account_identifier to align with the official API parameter name documented in the developer portal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add CHANGELOG entry for domain push identifier and account name Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d7ecf81 commit 1b9fecc

5 files changed

Lines changed: 30 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
This project uses [Semantic Versioning 2.0.0](http://semver.org/), the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
44

5+
## Unreleased
6+
7+
### Added
8+
9+
- Added `new_account_identifier` to `DomainPushInput` for initiating domain pushes by account identifier.
10+
- Added `name` to `Account`.
11+
12+
### Deprecated
13+
14+
- Deprecated `new_account_email` in `DomainPushInput`. Use `new_account_identifier` instead.
15+
516
## 7.2.0 - 2026-03-23
617

718
### Added

dnsimple/struct/account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Account(Struct):
1515
"""The account ID in DNSimple"""
1616
email = None
1717
"""The account email"""
18+
name = None
19+
"""The account name"""
1820
plan_identifier = None
1921
"""The identifier of the plan the account is subscribed to"""
2022
created_at = None

dnsimple/struct/domain_push.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@
1010
class DomainPushInput(dict):
1111
"""Represents the data to send to the DNSimple API to initiate a push"""
1212

13-
def __init__(self, new_account_email=None, contact_id=None):
13+
def __init__(self, new_account_email=None, new_account_identifier=None, contact_id=None):
1414
"""
1515
Creates a new DomainPushInput
1616
1717
:param new_account_email: str
18-
The target account email address (Required when initiating a push)
18+
Deprecated: Use new_account_identifier instead.
19+
The target account email address
20+
:param new_account_identifier: str
21+
The target domain push identifier (Required when initiating a push)
1922
:param contact_id: int
2023
A contact that belongs to the target DNSimple account. The contact will be used as new registrant for the
2124
domain, if the domain is registered with DNSimple (Required when accepting a push)
2225
"""
23-
dict.__init__(self, new_account_email=new_account_email, contact_id=contact_id)
26+
dict.__init__(self, new_account_email=new_account_email, new_account_identifier=new_account_identifier, contact_id=contact_id)
2427

2528
def to_json(self):
2629
return json.dumps(omitempty(self))

tests/service/accounts_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def test_list_accounts(self):
1616
accounts = self.accounts.list_accounts().data
1717
self.assertEqual(1, len(accounts))
1818
self.assertIsInstance(accounts[0], Account)
19+
self.assertEqual('John', accounts[0].name)
1920

2021
@responses.activate
2122
def test_list_users(self):

tests/service/domains_pushes_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ def test_initiate_push(self):
2222
self.assertEqual('2016-08-11T10:16:03Z', push.updated_at)
2323
self.assertIsNone(push.accepted_at)
2424

25+
@responses.activate
26+
def test_initiate_push_with_account_identifier(self):
27+
responses.add(DNSimpleMockResponse(method=responses.POST,
28+
path='/2020/domains/1/pushes',
29+
fixture_name='initiatePush/success'))
30+
push = self.domains.initiate_push(2020, 1, DomainPushInput(new_account_identifier='abc123')).data
31+
32+
self.assertEqual(1, push.id)
33+
self.assertEqual(2020, push.account_id)
34+
2535
@responses.activate
2636
def test_list_pushes(self):
2737
responses.add(DNSimpleMockResponse(method=responses.GET,

0 commit comments

Comments
 (0)