public class AssetApi extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
MESSAGE_PATTERN |
protected com.xero.model.ObjectFactory |
objFactory |
protected static DateFormat |
utcFormatter |
| Constructor and Description |
|---|
AssetApi(ApiClient apiClient) |
AssetApi(Config config) |
AssetApi(Config config,
SignerFactory signerFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToMapIfNotNull(Map<String,String> map,
String key,
Object value) |
Asset |
createAsset(Asset asset)
adds a fixed asset
Adds an asset to the system
|
AssetType |
createAssetType(AssetType assetType)
adds a fixed asset type
Adds an fixed asset type to the system
|
protected String |
DATA(String url,
String body,
Map<String,String> params,
String method) |
protected String |
DATA(String url,
String body,
Map<String,String> params,
String method,
org.threeten.bp.OffsetDateTime ifModifiedSince) |
protected String |
DATA(String url,
String body,
Map<String,String> params,
String method,
org.threeten.bp.OffsetDateTime ifModifiedSince,
String contentType) |
protected String |
DATA(String url,
String body,
Map<String,String> params,
String method,
String contentType) |
protected String |
DATA(String url,
String body,
Map<String,String> params,
String method,
String xeroApplicationId,
String xeroTenantId,
String xeroUserId) |
protected ByteArrayInputStream |
FILE(String url,
String body,
Map<String,String> params,
String method) |
protected String |
FILE(String url,
String body,
Map<String,String> params,
String method,
byte[] byteBody) |
protected String |
FILE(String url,
String body,
Map<String,String> params,
String method,
byte[] byteBody,
String contentType) |
protected ByteArrayInputStream |
FILE(String url,
String body,
Map<String,String> params,
String method,
String accept) |
ApiClient |
getApiClient() |
Asset |
getAssetById(UUID id)
retrieves fixed asset by id
By passing in the appropriate asset id, you can search for a specific fixed asset in the system
|
Assets |
getAssets(String status,
Integer page,
Integer pageSize,
String orderBy,
String sortDirection,
String filterBy)
searches fixed asset
By passing in the appropriate options, you can search for available fixed asset in the system
|
Setting |
getAssetSettings()
searches fixed asset settings
By passing in the appropriate options, you can search for available fixed asset types in the system
|
List<AssetType> |
getAssetTypes()
searches fixed asset types
By passing in the appropriate options, you can search for available fixed asset types in the system
|
void |
setApiClient(ApiClient apiClient) |
void |
setOAuthToken(String token,
String tokenSecret) |
protected static final DateFormat utcFormatter
protected static final Pattern MESSAGE_PATTERN
protected final com.xero.model.ObjectFactory objFactory
public AssetApi(Config config)
public AssetApi(Config config, SignerFactory signerFactory)
public AssetApi(ApiClient apiClient)
public ApiClient getApiClient()
public void setApiClient(ApiClient apiClient)
protected String DATA(String url, String body, Map<String,String> params, String method) throws IOException
IOExceptionprotected String DATA(String url, String body, Map<String,String> params, String method, org.threeten.bp.OffsetDateTime ifModifiedSince) throws IOException
IOExceptionprotected String DATA(String url, String body, Map<String,String> params, String method, String contentType) throws IOException
IOExceptionprotected String DATA(String url, String body, Map<String,String> params, String method, org.threeten.bp.OffsetDateTime ifModifiedSince, String contentType) throws IOException
IOExceptionprotected String DATA(String url, String body, Map<String,String> params, String method, String xeroApplicationId, String xeroTenantId, String xeroUserId) throws IOException
IOExceptionprotected ByteArrayInputStream FILE(String url, String body, Map<String,String> params, String method) throws IOException
IOExceptionprotected ByteArrayInputStream FILE(String url, String body, Map<String,String> params, String method, String accept) throws IOException
IOExceptionprotected String FILE(String url, String body, Map<String,String> params, String method, byte[] byteBody) throws IOException
IOExceptionprotected String FILE(String url, String body, Map<String,String> params, String method, byte[] byteBody, String contentType) throws IOException
IOExceptionpublic Asset createAsset(Asset asset) throws IOException
200 - return single object - create new asset
400 - invalid input, object invalid
asset - Fixed asset to addIOException - if an error occurs while attempting to invoke the APIpublic AssetType createAssetType(AssetType assetType) throws IOException
200 - results single object - created fixed type
400 - invalid input, object invalid
409 - a type already exists
assetType - Asset type to addIOException - if an error occurs while attempting to invoke the APIpublic Asset getAssetById(UUID id) throws IOException
200 - search results matching criteria
400 - bad input parameter
id - fixed asset id for single objectIOException - if an error occurs while attempting to invoke the APIpublic Setting getAssetSettings() throws IOException
200 - search results matching criteria
400 - bad input parameter
IOException - if an error occurs while attempting to invoke the APIpublic List<AssetType> getAssetTypes() throws IOException
200 - search results matching criteria
400 - bad input parameter
IOException - if an error occurs while attempting to invoke the APIpublic Assets getAssets(String status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOException
200 - search results matching criteria
400 - bad input parameter
status - Required when retrieving a collection of assets. See Asset Status Codespage - Results are paged. This specifies which page of the results to return. The default page is 1.pageSize - The number of records returned per page. By default the number of records returned is 10.orderBy - Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.sortDirection - ASC or DESCfilterBy - A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.IOException - if an error occurs while attempting to invoke the APICopyright © 2019. All rights reserved.