Skip to content

Commit d0f6643

Browse files
doc: Add documentation to objects/support.py (#269)
## 📝 Description This change adds documentation to the `objects/support.py` file.
1 parent 06615de commit d0f6643

1 file changed

Lines changed: 70 additions & 1 deletion

File tree

linode_api4/objects/support.py

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414

1515
class TicketReply(DerivedBase):
16+
"""
17+
A reply to a Support Ticket.
18+
19+
API Documentation: https://www.linode.com/docs/api/support/#replies-list
20+
"""
21+
1622
api_endpoint = "/support/tickets/{ticket_id}/replies"
1723
derived_url_path = "replies"
1824
parent_id_name = "ticket_id"
@@ -28,6 +34,12 @@ class TicketReply(DerivedBase):
2834

2935

3036
class SupportTicket(Base):
37+
"""
38+
An objected representing a Linode Support Ticket.
39+
40+
API Documentation: https://www.linode.com/docs/api/support/#replies-list
41+
"""
42+
3143
api_endpoint = "/support/tickets/{id}"
3244
properties = {
3345
"id": Property(identifier=True),
@@ -48,30 +60,69 @@ class SupportTicket(Base):
4860

4961
@property
5062
def linode(self):
63+
"""
64+
If applicable, the Linode referenced in this ticket.
65+
66+
:returns: The Linode referenced in this ticket.
67+
:rtype: Optional[Instance]
68+
"""
69+
5170
if self.entity and self.entity.type == "linode":
5271
return Instance(self._client, self.entity.id)
5372
return None
5473

5574
@property
5675
def domain(self):
76+
"""
77+
If applicable, the Domain referenced in this ticket.
78+
79+
:returns: The Domain referenced in this ticket.
80+
:rtype: Optional[Domain]
81+
"""
82+
5783
if self.entity and self.entity.type == "domain":
5884
return Domain(self._client, self.entity.id)
5985
return None
6086

6187
@property
6288
def nodebalancer(self):
89+
"""
90+
If applicable, the NodeBalancer referenced in this ticket.
91+
92+
:returns: The NodeBalancer referenced in this ticket.
93+
:rtype: Optional[NodeBalancer]
94+
"""
95+
6396
if self.entity and self.entity.type == "nodebalancer":
6497
return NodeBalancer(self._client, self.entity.id)
6598
return None
6699

67100
@property
68101
def volume(self):
102+
"""
103+
If applicable, the Volume referenced in this ticket.
104+
105+
:returns: The Volume referenced in this ticket.
106+
:rtype: Optional[Volume]
107+
"""
108+
69109
if self.entity and self.entity.type == "volume":
70110
return Volume(self._client, self.entity.id)
71111
return None
72112

73113
def post_reply(self, description):
74-
""" """
114+
"""
115+
Adds a reply to an existing Support Ticket.
116+
117+
API Documentation: https://www.linode.com/docs/api/support/#reply-create
118+
119+
:param description: The content of this Support Ticket Reply.
120+
:type description: str
121+
122+
:returns: The new TicketReply object.
123+
:rtype: Optional[TicketReply]
124+
"""
125+
75126
result = self._client.post(
76127
"{}/replies".format(SupportTicket.api_endpoint),
77128
model=self,
@@ -89,6 +140,18 @@ def post_reply(self, description):
89140
return r
90141

91142
def upload_attachment(self, attachment):
143+
"""
144+
Uploads an attachment to an existing Support Ticket.
145+
146+
API Documentation: https://www.linode.com/docs/api/support/#support-ticket-attachment-create
147+
148+
:param attachment: A path to the file to upload as an attachment.
149+
:type attachment: str
150+
151+
:returns: Whether the upload operation was successful.
152+
:rtype: bool
153+
"""
154+
92155
content = None
93156
with open(attachment) as f:
94157
content = f.read()
@@ -120,4 +183,10 @@ def upload_attachment(self, attachment):
120183
return True
121184

122185
def support_ticket_close(self):
186+
"""
187+
Closes a Support Ticket.
188+
189+
API Documentation: https://www.linode.com/docs/api/support/#support-ticket-close
190+
"""
191+
123192
self._client.post("{}/close".format(self.api_endpoint), model=self)

0 commit comments

Comments
 (0)