Use the System.OrgLimits getAll and getMap methods to obtain either a list or a map of all your org limits. To get details on each limit, use instance methods from System.OrgLimit.
For comparison, the Limits Class returns Apex governor limits and not Salesforce API limits.
The following are methods for OrgLimit.
public Integer getLimit()
Type: Integer
List<System.OrgLimit> limits = OrgLimits.getAll(); for (System.OrgLimit aLimit: limits) { System.debug('Limit: ' + aLimit.getName()); System.debug('Max Limit is: ' + aLimit.getLimit()); }
public String getName()
Type: String
List<System.OrgLimit> limits = OrgLimits.getAll(); for (System.OrgLimit aLimit: limits) { System.debug('Limit: ' + aLimit.getName()); System.debug('Max Limit is: ' + aLimit.getLimit()); }
public Integer getValue()
Type: Integer
List<System.OrgLimit> limits = OrgLimits.getAll(); for (System.OrgLimit aLimit: limits) { System.debug('Limit: ' + aLimit.getName()); System.debug('Usage Value is: ' + aLimit.getValue()); }