Class AssetApi
- java.lang.Object
-
- com.xero.api.client.AssetApi
-
public class AssetApi extends Object
AssetApi has methods for interacting with all endpoints in the API set
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArrayInputStreamconvertInputToByteArray(InputStream is)convert intput to byte arrayAssetcreateAsset(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)adds a fixed asset Adds an asset to the systemAssetTypecreateAssetType(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)adds a fixed asset type Adds an fixed asset type to the systemApiClientgetApiClient()get ApiClientAssetgetAssetById(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)Retrieves fixed asset by id By passing in the appropriate asset id, you can search for a specific fixed asset in the systemAssetsgetAssets(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)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.HttpResponsegetAssetsForHttpResponse(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 systemList<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)searches fixed asset types By passing in the appropriate options, you can search for available fixed asset types in the systemstatic AssetApigetInstance(ApiClient apiClient)AssetApi getInstanceStringgetUserAgent()get user agentvoidsetApiClient(ApiClient apiClient)set ApiClientvoidsetUserAgent(String userAgent)set user agent
-
-
-
Constructor Detail
-
AssetApi
public AssetApi()
AssetApi
-
AssetApi
public AssetApi(ApiClient apiClient)
AssetApi- Parameters:
apiClient- ApiClient pass into the new instance of this class
-
-
Method Detail
-
getInstance
public static AssetApi getInstance(ApiClient apiClient)
AssetApi getInstance- Parameters:
apiClient- ApiClient pass into the new instance of this class- Returns:
- instance of this class
-
getApiClient
public ApiClient getApiClient()
get ApiClient- Returns:
- apiClient the current ApiClient
-
setApiClient
public void setApiClient(ApiClient apiClient)
set ApiClient- Parameters:
apiClient- ApiClient pass into the new instance of this class
-
setUserAgent
public void setUserAgent(String userAgent)
set user agent- Parameters:
userAgent- string to override the user agent
-
getUserAgent
public String getUserAgent()
get user agent- Returns:
- String of user agent
-
createAsset
public Asset createAsset(String accessToken, String xeroTenantId, Asset asset) throws IOException
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
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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
createAssetType
public AssetType createAssetType(String accessToken, String xeroTenantId, AssetType assetType) throws IOException
adds 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
adds 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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetById
public Asset getAssetById(String accessToken, String xeroTenantId, UUID id) throws IOException
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
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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetSettings
public Setting getAssetSettings(String accessToken, String xeroTenantId) throws IOException
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
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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssetTypes
public List<AssetType> getAssetTypes(String accessToken, String xeroTenantId) throws IOException
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
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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getAssets
public Assets getAssets(String accessToken, String xeroTenantId, AssetStatusQueryParam status, Integer page, Integer pageSize, String orderBy, String sortDirection, String filterBy) throws IOException
searches 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
searches 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:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
convertInputToByteArray
public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException
convert intput to byte array- Parameters:
is- InputStream the server status code returned- Returns:
- byteArrayInputStream a ByteArrayInputStream
- Throws:
IOException- for failed or interrupted I/O operations
-
-