Class AssetApi


  • public class AssetApi
    extends Object
    AssetApi has methods for interacting with all endpoints in the API set
    • 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 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
        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:
        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 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
        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:
        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 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
        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:
        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 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
        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:
        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 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
        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:
        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 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
        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:
        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