Class ServiceRates
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.ProjectResource
net.amcintosh.freshbooks.resources.api.CommentSubResource
net.amcintosh.freshbooks.resources.ServiceRates
FreshBooks service rates sub-resource with calls to get, list, create, update
-
Field Summary
Fields inherited from class net.amcintosh.freshbooks.resources.api.Resource
freshBooksClient
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new service rate from the provided data.create
(long businessId, long serviceId, ServiceRate data) Create a new service rate from the provided ServiceRate model.get
(long businessId, long serviceId) Get a single service rate from the service with the corresponding id.protected String
protected String
protected String
list
(long businessId) Get a list of service rates for this business.Update the service rate with the corresponding id.update
(long businessId, long serviceId, ServiceRate data) Update the service rate with the corresponding id.Methods inherited from class net.amcintosh.freshbooks.resources.api.CommentSubResource
getResourceType, getUrl, getUrl, getUrl, getUrl
Methods inherited from class net.amcintosh.freshbooks.resources.api.ProjectResource
getUrl, getUrl, handleListRequest, handleRequest, handleRequest
Methods inherited from class net.amcintosh.freshbooks.resources.api.Resource
buildQueryString
-
Constructor Details
-
ServiceRates
-
-
Method Details
-
getPathForParent
- Specified by:
getPathForParent
in classCommentSubResource
-
getPathForSingle
- Specified by:
getPathForSingle
in classProjectResource
-
getPathForList
- Specified by:
getPathForList
in classProjectResource
-
list
Get a list of service rates for this business.- Parameters:
businessId
- Id of the business- Returns:
- ServiceRateList containing service rates
- Throws:
FreshBooksException
- If the call is not successful
-
get
Get a single service rate from the service with the corresponding id.- Parameters:
businessId
- Id of the businessserviceId
- Id of the resource to return- Returns:
- The ServiceRate
- Throws:
FreshBooksException
- If the call is not successful
-
create
public ServiceRate create(long businessId, long serviceId, ServiceRate data) throws FreshBooksException Create a new service rate from the provided ServiceRate model. Makes a POST call against the service rates resource endpoint. This calls `serviceRate.getContent()` to get a hash map of data.- Parameters:
businessId
- Id of the businessserviceId
- Id of the service to set the rate fordata
- ServiceRate model with create data- Returns:
- The created ServiceRate
- Throws:
FreshBooksException
- If the call is not successful
-
create
public ServiceRate create(long businessId, long serviceId, Map<String, Object> data) throws FreshBooksExceptionCreate a new service rate from the provided data. Makes a POST call against the service rates resource endpoint.- Parameters:
businessId
- Id of the businessserviceId
- Id of the service to set the rate fordata
- Map of create data- Returns:
- The created ServiceRate
- Throws:
FreshBooksException
- If the call is not successful
-
update
public ServiceRate update(long businessId, long serviceId, ServiceRate data) throws FreshBooksException Update the service rate with the corresponding id. Makes a PUT call against the service rate resource endpoint.- Parameters:
businessId
- Id of the businessserviceId
- Id of the service to set the rate fordata
- ServiceRate model with updated data- Returns:
- The updated ServiceRate
- Throws:
FreshBooksException
- If the call is not successful
-
update
public ServiceRate update(long businessId, long serviceId, Map<String, Object> data) throws FreshBooksExceptionUpdate the service rate with the corresponding id. Makes a PUT call against the service rate resource endpoint.- Parameters:
businessId
- Id of the businessserviceId
- Id of the service to set the rate fordata
- Map of data to change- Returns:
- The updated ServiceRate
- Throws:
FreshBooksException
- If the call is not successful
-