Class: Projects::Api::TimesheetsAPI
- Defined in:
- lib/projects/api/TimesheetsAPI.rb
Overview
-
TimesheetAPI is used to:
* Get list of time logs.
* Add new task log.
* update the details of a task log.
* Delete an existing task log.
* Add new bug log.
* Update the details of a bug log.
* Delete an existing bug log.
* Add new general log.
* Update the details of a general log.
* Delete an existing general log.
Instance Method Summary collapse
-
#addBuglog(projectId, buglog) ⇒ Object
-
Buglog object.
-
-
#addGenerallog(projectId, generallog) ⇒ Object
-
Add a new general log for the project.
-
-
#addTasklog(projectId, tasklog) ⇒ Object
-
Add a new task log for the project.
-
-
#deleteBuglog(projectId, bugId, logId) ⇒ Object
-
Delete an existing bug log for the project.
-
-
#deleteGenerallog(projectId, logId) ⇒ Object
-
Delete an existing general log for the project.
-
-
#deleteTasklog(projectId, taskId, logId) ⇒ Object
-
Delete an existing task log for the project.
-
-
#getTimeLogs(projectId, queryMap) ⇒ Object
-
Get list of time logs for the project.
-
-
#initialize(authToken, portalId) ⇒ TimesheetsAPI
constructor
-
Construct a new TimesheetsAPI using User’s authToken and portalId.
-
-
#updateBuglog(projectId, buglog) ⇒ Object
-
Update the details of a bug log.
-
-
#updateGenerallog(projectId, generallog) ⇒ Object
-
Update the details of a general log.
-
-
#updateTasklog(projectId, tasklog) ⇒ Object
-
Update the details of a task log.
-
Methods inherited from API
Constructor Details
#initialize(authToken, portalId) ⇒ TimesheetsAPI
-
Construct a new TimesheetsAPI using User’s authToken and portalId.
Parameters
- authToken
-
User’s authToken.
-
- portalId
-
User’s portalId.
-
47 48 49 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 47 def initialize(authToken,portalId) super(authToken,portalId) end |
Instance Method Details
#addBuglog(projectId, buglog) ⇒ Object
-
Buglog object.
137 138 139 140 141 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 137 def addBuglog(projectId, buglog) url = getBaseURL+"projects/"+String(projectId)+"/bugs/"+String(buglog.getBugId)+"/logs/" response = ZohoHTTPClient.post(url, getQueryMap, buglog.toParamMAP) return $timesheetParser.getBuglog(response) end |
#addGenerallog(projectId, generallog) ⇒ Object
-
Add a new general log for the project.
Parameters
- projectId
-
ID of the project.
-
- generallog
-
Generallog object.
-
Returns
-
Generallog object.
193 194 195 196 197 198 199 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 193 def addGenerallog(projectId, generallog) url = getBaseURL+"projects/"+String(projectId)+"/logs/" requestBody = generallog.toParamMAP requestBody["name"] = generallog.getName response = ZohoHTTPClient.post(url, getQueryMap, requestBody) return $timesheetParser.getGenerallog(response) end |
#addTasklog(projectId, tasklog) ⇒ Object
-
Add a new task log for the project.
Parameters
- projectId
-
ID of the project.
-
- tasklog
-
Tasklog object.
-
Returns
-
Tasklog object.
81 82 83 84 85 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 81 def addTasklog(projectId, tasklog) url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(tasklog.getTaskId)+"/logs/" response = ZohoHTTPClient.post(url, getQueryMap, tasklog.toParamMAP) return $timesheetParser.getTasklog(response) end |
#deleteBuglog(projectId, bugId, logId) ⇒ Object
-
Delete an existing bug log for the project.
Parameters
- projectId
-
ID of the project.
-
- bugId
-
ID of the bug.
-
- logId
-
ID of the log.
-
Returns
-
String object.
175 176 177 178 179 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 175 def deleteBuglog(projectId, bugId, logId) url = getBaseURL+"projects/"+String(projectId)+"/bugs/"+String(bugId)+"/logs/"+String(logId)+"/" response = ZohoHTTPClient.delete(url, getQueryMap) return $timesheetParser.getResult(response) end |
#deleteGenerallog(projectId, logId) ⇒ Object
-
Delete an existing general log for the project.
Parameters
- projectId
-
ID of the project.
-
- logId
-
ID of the log.
-
Returns
-
String object.
233 234 235 236 237 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 233 def deleteGenerallog(projectId, logId) url = getBaseURL+"projects/"+String(projectId)+"/logs/"+String(logId)+"/" response = ZohoHTTPClient.delete(url, getQueryMap) return $timesheetParser.getResult(response) end |
#deleteTasklog(projectId, taskId, logId) ⇒ Object
-
Delete an existing task log for the project.
Parameters
- projectId
-
ID of the project.
-
- taskId
-
ID of the task.
-
- logId
-
ID of the log.
-
Returns
-
String object.
119 120 121 122 123 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 119 def deleteTasklog(projectId, taskId, logId) url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(taskId)+"/logs/"+String(logId)+"/" response = ZohoHTTPClient.delete(url, getQueryMap) return $timesheetParser.getResult(response) end |
#getTimeLogs(projectId, queryMap) ⇒ Object
-
Get list of time logs for the project.
Parameters
- projectId
-
ID 0f the project.
-
- queryMap
-
This queryMap contains the filters in the form of key-value pair.
-
Returns
-
TimelogList object.
63 64 65 66 67 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 63 def getTimeLogs(projectId, queryMap) url = getBaseURL+"projects/"+String(projectId)+"/logs/" response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) return $timesheetParser.getTimeLogs(response) end |
#updateBuglog(projectId, buglog) ⇒ Object
-
Update the details of a bug log.
Parameters
- projectId
-
ID of the project.
-
- buglog
-
Buglog object.
-
Returns
-
Buglog object.
155 156 157 158 159 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 155 def updateBuglog(projectId, buglog) url = getBaseURL+"projects/"+String(projectId)+"/bugs/"+String(buglog.getBugId)+"/logs/"+String(buglog.getId)+"/" response = ZohoHTTPClient.post(url, getQueryMap, buglog.toParamMAP) return $timesheetParser.getBuglog(response) end |
#updateGenerallog(projectId, generallog) ⇒ Object
-
Update the details of a general log.
Parameters
- projectId
-
ID of the project.
-
- generallog
-
Generallog object.
-
Returns
-
Generallog object.
213 214 215 216 217 218 219 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 213 def updateGenerallog(projectId, generallog) url = getBaseURL+"projects/"+String(projectId)+"/logs/"+String(generallog.getId)+"/" requestBody = generallog.toParamMAP requestBody["name"] = generallog.getName response = ZohoHTTPClient.post(url, getQueryMap, requestBody) return $timesheetParser.getGenerallog(response) end |
#updateTasklog(projectId, tasklog) ⇒ Object
-
Update the details of a task log.
Parameters
-
projectId ID of the project.
- tasklog
-
Tasklog object.
-
Returns
-
Tasklog object.
99 100 101 102 103 |
# File 'lib/projects/api/TimesheetsAPI.rb', line 99 def updateTasklog(projectId, tasklog) url = getBaseURL+"projects/"+String(projectId)+"/tasks/"+String(tasklog.getTaskId)+"/logs/"+String(tasklog.getId)+"/" response = ZohoHTTPClient.post(url, getQueryMap, tasklog.toParamMAP) return $timesheetParser.getTasklog(response) end |