class Projects::Api::MilestonesAPI

Public Class Methods

new(authToken,portalId) click to toggle source
  • Construct a new MilestonesAPI using User's authToken and portalId.

Parameters

  • authToken
    • User's authToken.

  • portalId
    • User's portalId.

Calls superclass method Projects::Api::API::new
# File lib/projects/api/MilestonesAPI.rb, line 40
def initialize(authToken,portalId)
        super(authToken,portalId)
end

Public Instance Methods

create(projectId,milestone) click to toggle source
  • 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(projectId,milestoneId) click to toggle source
  • 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(projectId,milestoneId) click to toggle source
  • 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
getMilestones(projectId, * queryMap) click to toggle source
  • 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(projectId,milestone) click to toggle source
  • 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
updateStatus(projectId,milestoneId,status) click to toggle source
  • 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