Class AssetApi

java.lang.Object
com.xero.api.client.AssetApi

public class AssetApi
extends Object
  • Constructor Details

    • AssetApi

      public AssetApi()
    • AssetApi

      public AssetApi​(ApiClient apiClient)
  • Method Details

    • getInstance

      public static AssetApi getInstance​(ApiClient apiClient)
    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient​(ApiClient apiClient)
    • setUserAgent

      public void setUserAgent​(String userAgent)
    • getUserAgent

      public String getUserAgent()
    • createAsset

      public Asset createAsset​(String accessToken, String xeroTenantId, Asset asset) throws IOException
      adds a fixed asset Adds an asset to the system

      200 - return single object - create new asset

      400 - invalid input, object invalid

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      asset - Fixed asset you are creating
      accessToken - 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 IOException
      adds a fixed asset type Adds an fixed asset type to the system

      200 - results single object - created fixed type

      400 - invalid input, object invalid

      409 - a type already exists

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      assetType - Asset type to add
      accessToken - 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

      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 system

      200 - search results matching criteria

      400 - bad input parameter

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      id - fixed asset id for single object
      accessToken - 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

      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 system

      200 - search results matching criteria

      400 - bad input parameter

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      accessToken - 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

      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 system

      200 - search results matching criteria

      400 - bad input parameter

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      accessToken - 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 IOException
      searches fixed asset By passing in the appropriate options, you can search for available fixed asset in the system

      200 - search results matching criteria

      400 - bad input parameter

      Parameters:
      xeroTenantId - Xero identifier for Tenant
      status - Required when retrieving a collection of assets. See Asset Status Codes
      page - 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 DESC
      filterBy - 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

      public ByteArrayInputStream convertInputToByteArray​(InputStream is) throws IOException
      Throws:
      IOException