class Projects::Api::MilestonesAPI
-
MilestonesAPI
is used to: -
Get list of milestones.
-
Get the details of a milestone.
-
Create a new milestone.
-
Update the details of a milestone.
-
Update the status of a milestone.
-
Delete an existing milestone.
Public Class Methods
-
Construct a new
MilestonesAPI
using User's authToken and portalId.
Parameters¶ ↑
- authToken
-
User's authToken.
-
- portalId
-
User's portalId.
-
Projects::Api::API::new
# File lib/projects/api/MilestonesAPI.rb, line 40 def initialize(authToken,portalId) super(authToken,portalId) end
Public Instance Methods
-
Create a milestone for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- milestone
-
Milestone object.
-
Returns¶ ↑
-
Milestone object.
# File lib/projects/api/MilestonesAPI.rb, line 95 def create(projectId,milestone) url = getBaseURL+"projects/"+String(projectId)+"/milestones/" response = ZohoHTTPClient.post(url, getQueryMap, milestone.toParamMAP()) return $milestonesParser.getMilestone(response) end
-
Delete an existing milestone for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- milestoneId
-
ID of the milestone.
-
Returns¶ ↑
-
String object.
# File lib/projects/api/MilestonesAPI.rb, line 152 def delete(projectId,milestoneId) url = getBaseURL+"projects/"+String(projectId)+"/milestones/"+String(milestoneId)+"/" response = ZohoHTTPClient.delete(url, getQueryMap) return $milestonesParser.getResult(response) end
-
Get the details of a milestone.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- milestoneId
-
ID of the milestone.
-
==== Returns
-
Milestone object.
# File lib/projects/api/MilestonesAPI.rb, line 78 def get(projectId,milestoneId) url = getBaseURL+"projects/"+String(projectId)+"/milestones/"+String(milestoneId)+"/" response = ZohoHTTPClient.get(url, getQueryMap) return $milestonesParser.getMilestone(response) end
-
Get list of milestones for the project.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- queryMap
-
This queryMap contains the filters in the form of key-value pair.
-
Returns¶ ↑
-
List of Milestone object.
# File lib/projects/api/MilestonesAPI.rb, line 56 def getMilestones(projectId, * queryMap) url = getBaseURL+"projects/"+String(projectId)+"/milestones/" if queryMap.length == 0 response = ZohoHTTPClient.get(url, getQueryMap) else response = ZohoHTTPClient.get(url, getQueryMap(queryMap)) end return $milestonesParser.getMilestones(response) end
-
Update the details of a milestone.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- milestone
-
Milestone object.
-
Returns¶ ↑
-
Milestone object.
# File lib/projects/api/MilestonesAPI.rb, line 112 def update(projectId,milestone) url = getBaseURL+"projects/"+String(projectId)+"/milestones/"+String(milestone.getId)+"/" response = ZohoHTTPClient.post(url, getQueryMap, milestone.toParamMAP()) return $milestonesParser.getMilestone(response) end
-
Update the status of a milestone.
Parameters¶ ↑
- projectId
-
ID of the project.
-
- milestoneId
-
ID of the milestone.
-
- status
-
Status of the milestone.
-
Returns¶ ↑
-
Milestone object.
# File lib/projects/api/MilestonesAPI.rb, line 132 def updateStatus(projectId,milestoneId,status) url = getBaseURL+"projects/"+String(projectId)+"/milestones/"+String(milestoneId)+"/status/" requestBody = Hash.new() requestBody["status"] = status response = ZohoHTTPClient.post(url, getQueryMap, requestBody) return $milestonesParser.getMilestone(response) end