public class LimitCall extends AbstractCall<LimitDataType>
Constructor and Description |
---|
LimitCall(ClearCheckBookConnection connection) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete(ParsedNameValuePair input)
Delete a specific limit for the current user.
|
boolean |
edit(LimitDataType dataType)
Edit a specific limit for the current user.
|
LimitDataType |
get(ParsedNameValuePair id)
Returns information about a specific limit.
|
List<LimitDataType> |
getAll()
Returns an array of limits for the current user
Method: get Call: limits |
protected String |
getUrlSuffix() |
String |
insert(LimitDataType input)
Inserts a limit for the current user
Method: post Call: limit |
bulkProcess, get, getAll, getConnection, getPluralUrl, process
public static final String TYPE
public LimitCall(ClearCheckBookConnection connection)
protected String getUrlSuffix()
getUrlSuffix
in class AbstractCall<LimitDataType>
public List<LimitDataType> getAll() throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/limits/
Parameters:
Parameter Required Description
None
Returned Values:
Value Description
id The id of the limit
name The Account or Category name this limit is assigned to.
limit_amount The amount this limit is set to.
account_id If this is a limit for an account, this will be the id of that
account (0 if it's not set for an account)
category_id If this is a limit for a category, this is the id of that
category (0 if it's not set for a category)
spent The amount spent so far for this transaction.
rollover Whether or not this limit rolls over on its reset day
reset_day The day of the month this limit is set to reset.
transfer Whether or not this limit includes transfers in the amount
spent.
deposit Whether or not this limit uses deposits to reduce the amount
spent.
duration The duration of this budget based on when it resets. (0=Weekly;
1=Bi-Weekly; 2=Monthly; 3=Quarterly; 4=Semi-Annually; 5=Annually)
start_date If the duration is not 2, this will be when the budget
originally started.
this_start_date This is when the budget for the current time period
started.
this_end_date This is when the budget for the current time period ends.
original_limit The original amount of the limit (in case rollover is set
to true).
getAll
in class AbstractCall<LimitDataType>
List
<extends AbstractDataType
>ClearcheckbookException
public LimitDataType get(ParsedNameValuePair id) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/limit/
Parameters:
Parameter Required Description
id Required The id of the limit you want
Returned Values:
Value Description
id The id of the limit
amount The amount this limit is set for
reset_day The day of the month this limit is going to reset.
rollover TRUE or FALSE for whether or not this limit rollsover
transfer TRUE or FALSE for whether or not this limit includes transfers
in the amount spent.
deposit TRUE or FALSE for whether or not this limit uses deposits to
reduce the amount spent.
duration The duration of this budget based on when it resets. (0=Weekly;
1=Bi-Weekly; 2=Monthly; 3=Quarterly; 4=Semi-Annually; 5=Annually)
start_date If the duration is not 2, this will be when the budget
originally started.
this_start_date This is when the budget for the current time period
started.
this_end_date This is when the budget for the current time period ends.
original_limit The original amount of the limit (in case rollover is set
to true).
get
in class AbstractCall<LimitDataType>
extends AbstractDataType
ClearcheckbookException
public String insert(LimitDataType input) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/limit/
Parameters:
Parameter Required Description
account_id Required If the limit is for an account, the id of the
account. Default is 0.
category_id Required If the limit is for a category, the id of the
category. Default is 0.
amount Required The amount this limit should be for (eg: 300)
duration Required The duration of this budget based on when it resets.
(0=Weekly; 1=Bi-Weekly; 2=Monthly; 3=Quarterly; 4=Semi-Annually;
5=Annually)
reset_day Required Integer 1-31 for the day this limit should reset on.
If this number is higher than the last day of the month, the limit will
reset on the last day of the month.
start_date Required If the duration is not 2, this will be when the
budget originally starts (formatted as yyyy-mm-dd).
rollover Required Whether or not this limit rolls over any unused money
to the next month. 0=false, 1=true
transfer Required Whether or not this limit includes transfers in the
amount spent. 0=false, 1=true
deposit Required Whether or not this limit uses deposits to reduce the
amount spent. 0=false, 1=true
Returned Values:
Value Description
id / false Returns the id of the newly created limit on success or
false/null on fail
insert
in class AbstractCall<LimitDataType>
ClearcheckbookException
public boolean edit(LimitDataType dataType) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/limit/
Parameters:
Parameter Required Description
id Required The id of the limit being edited.
amount Required The amount this limit should be for (eg: 300)
duration Required The duration of this budget based on when it resets.
(0=Weekly; 1=Bi-Weekly; 2=Monthly; 3=Quarterly; 4=Semi-Annually;
5=Annually)
reset_day Required Integer 1-31 for the day this limit should reset on.
If this number is higher than the last day of the month, the limit will
reset on the last day of the month.
start_date Required If the duration is not 2, this will be when the
budget originally starts (formatted as yyyy-mm-dd).
rollover Required Whether or not this limit rolls over any unused money
to the next month. 0=false, 1=true
transfer Required Whether or not this limit includes transfers in the
amount spent. 0=false, 1=true
deposit Required Whether or not this limit uses deposits to reduce the
amount spent. 0=false, 1=true
Returned Values:
Value Description
true / false Returns true on a successful edit or false/null on fail.
ACTUALLY - it returns "null" on success and "" on fail
edit
in class AbstractCall<LimitDataType>
ClearcheckbookException
public boolean delete(ParsedNameValuePair input) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/limit/
Parameters:
Parameter Required Description
id Required The id of the limit to delete
Returned Values:
Value Description
true / false Returns true on a successful delete or false/null on fail
delete
in class AbstractCall<LimitDataType>
ClearcheckbookException
Copyright © 2014 Leonard UK Ltd. All rights reserved.