Package com.xero.api.client
Class AssetApi
java.lang.Object
com.xero.api.client.AssetApi
public class AssetApi extends Object
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description ByteArrayInputStreamconvertInputToByteArray(InputStream is)AssetcreateAsset(String accessToken, String xeroTenantId, Asset asset)adds a fixed asset Adds an asset to the systemcom.google.api.client.http.HttpResponsecreateAssetForHttpResponse(String accessToken, String xeroTenantId, Asset asset)AssetTypecreateAssetType(String accessToken, String xeroTenantId, AssetType assetType)adds a fixed asset type Adds an fixed asset type to the systemcom.google.api.client.http.HttpResponsecreateAssetTypeForHttpResponse(String accessToken, String xeroTenantId, AssetType assetType)ApiClientgetApiClient()AssetgetAssetById(String accessToken, String xeroTenantId, UUID id)retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the systemcom.google.api.client.http.HttpResponsegetAssetByIdForHttpResponse(String accessToken, String xeroTenantId, UUID id)AssetsgetAssets(String accessToken, String xeroTenantId, AssetStatusQueryParam 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 systemSettinggetAssetSettings(String accessToken, String xeroTenantId)searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the systemcom.google.api.client.http.HttpResponsegetAssetSettingsForHttpResponse(String accessToken, String xeroTenantId)com.google.api.client.http.HttpResponsegetAssetsForHttpResponse(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy)List<AssetType>getAssetTypes(String accessToken, String xeroTenantId)searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the systemcom.google.api.client.http.HttpResponsegetAssetTypesForHttpResponse(String accessToken, String xeroTenantId)static AssetApigetInstance(ApiClient apiClient)StringgetUserAgent()voidsetApiClient(ApiClient apiClient)voidsetUserAgent(String userAgent)
-
Constructor Details
-
AssetApi
public AssetApi() -
AssetApi
-
-
Method Details
-
getInstance
-
getApiClient
-
setApiClient
-
setUserAgent
-
getUserAgent
-
createAsset
adds a fixed asset Adds an asset to the system200 - return single object - create new asset
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for Tenantasset- Fixed asset you are creatingaccessToken- Authorization token for user set in header of each request- Returns:
- Asset
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
createAssetForHttpResponse
public com.google.api.client.http.HttpResponse createAssetForHttpResponse(String accessToken, String xeroTenantId, Asset asset) throws IOException- Throws:
IOException
-
createAssetType
public AssetType createAssetType(String accessToken, String xeroTenantId, AssetType assetType) throws IOExceptionadds a fixed asset type Adds an fixed asset type to the system200 - results single object - created fixed type
400 - invalid input, object invalid
409 - a type already exists
- Parameters:
xeroTenantId- Xero identifier for TenantassetType- Asset type to addaccessToken- Authorization token for user set in header of each request- Returns:
- AssetType
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
createAssetTypeForHttpResponse
public com.google.api.client.http.HttpResponse createAssetTypeForHttpResponse(String accessToken, String xeroTenantId, AssetType assetType) throws IOException- Throws:
IOException
-
getAssetById
retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the system200 - search results matching criteria
400 - bad input parameter
- Parameters:
xeroTenantId- Xero identifier for Tenantid- fixed asset id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- Asset
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetByIdForHttpResponse
public com.google.api.client.http.HttpResponse getAssetByIdForHttpResponse(String accessToken, String xeroTenantId, UUID id) throws IOException- Throws:
IOException
-
getAssetSettings
searches fixed asset settings By passing in the appropriate options, you can search for available fixed asset types in the system200 - search results matching criteria
400 - bad input parameter
- Parameters:
xeroTenantId- Xero identifier for TenantaccessToken- Authorization token for user set in header of each request- Returns:
- Setting
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetSettingsForHttpResponse
public com.google.api.client.http.HttpResponse getAssetSettingsForHttpResponse(String accessToken, String xeroTenantId) throws IOException- Throws:
IOException
-
getAssetTypes
searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the system200 - search results matching criteria
400 - bad input parameter
- Parameters:
xeroTenantId- Xero identifier for TenantaccessToken- Authorization token for user set in header of each request- Returns:
- List<AssetType>
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetTypesForHttpResponse
public com.google.api.client.http.HttpResponse getAssetTypesForHttpResponse(String accessToken, String xeroTenantId) throws IOException- Throws:
IOException
-
getAssets
public Assets getAssets(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOExceptionsearches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system200 - search results matching criteria
400 - bad input parameter
- Parameters:
xeroTenantId- Xero identifier for Tenantstatus- 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.accessToken- Authorization token for user set in header of each request- Returns:
- Assets
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetsForHttpResponse
public com.google.api.client.http.HttpResponse getAssetsForHttpResponse(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOException- Throws:
IOException
-
convertInputToByteArray
- Throws:
IOException
-