sjkingo / python-freshdesk

An API for the Freshdesk helpdesk
BSD 2-Clause "Simplified" License
86 stars 67 forks source link

TimeEntry is not included #63

Closed majorcs closed 4 years ago

majorcs commented 4 years ago

Hi,

I tried to use the TimeEntry API but it seems it's not included in the man API class. I may be wrong, but with this simple one line patch I was able to use it as any other APIs:

diff --git a/freshdesk/v2/api.py b/freshdesk/v2/api.py
index 50cfed0..edefb3b 100644
--- a/freshdesk/v2/api.py
+++ b/freshdesk/v2/api.py
@@ -538,6 +538,7 @@ class API(object):
         self.agents = AgentAPI(self)
         self.roles = RoleAPI(self)
         self.ticket_fields = TicketFieldAPI(self)
+        self.time_entry = TimeEntryAPI(self)

         if domain.find("freshdesk.com") < 0:
             raise AttributeError("Freshdesk v2 API works only via Freshdesk" "domains and not via custom CNAMEs")

Could you please let me know if this is the correct way to use the TimeEntry calls? If not then I would like to know the correct method :)

Thanks a lot, Csaba

sjkingo commented 4 years ago

Nice catch! That definitely should be in there per your patch. Could you please PR it and I'll merge in. Thanks