Skip to content

Commit 1dc5eaa

Browse files
authored
feat: adds support for record comments (#10)
1 parent 3ad722e commit 1dc5eaa

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

hostingde/model/record.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class Record(Model):
4545
record_template_id: Optional[str]
4646
name: Optional[str]
4747
content: Optional[str]
48+
comments: Optional[str]
4849
ttl: Optional[int]
4950
priority: Optional[int]
5051
last_change_date: Optional[str]
@@ -61,6 +62,7 @@ def __init__(
6162
ttl: Optional[int] = None,
6263
priority: Optional[int] = None,
6364
last_change_date: Optional[str] = None,
65+
comments: Optional[str] = None,
6466
**kwargs: Any,
6567
):
6668
"""
@@ -87,6 +89,8 @@ def __init__(
8789
:param content: Content of the record. Always required in create requests and in all other requests
8890
if no id is provided.
8991
92+
:param comments: Comments for the record. Optional field that you can set for documentation purposes.
93+
9094
:param ttl: TTL of the record in seconds. Minimum value: 60. Maximum value: 31556926 (one year).
9195
Exceeding the maximum or undercutting the minimum value will abort the request and
9296
result in an error.
@@ -102,6 +106,7 @@ def __init__(
102106
self.name = name
103107
self.type = type
104108
self.content = content
109+
self.comments = comments
105110
self.ttl = ttl
106111
self.priority = priority
107112
self.last_change_date = last_change_date

tests/unit/model/test_record.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def test_record_constructor():
1212
content="127.0.0.1",
1313
priority=0,
1414
ttl=0,
15+
comments="Some comment",
1516
)
1617

1718
assert record.id == '234987fds'
@@ -25,6 +26,7 @@ def test_record_constructor():
2526
assert record.content == "127.0.0.1"
2627
assert record.priority == 0
2728
assert record.ttl == 0
29+
assert record.comments == "Some comment"
2830

2931

3032
def test_parse_record():

0 commit comments

Comments
 (0)