Class FilesApi
- java.lang.Object
-
- com.xero.api.client.FilesApi
-
public class FilesApi extends Object
FilesApi 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 arrayAssociationcreateFileAssociation(String accessToken, String xeroTenantId, UUID fileId, Association association)Creates a new file association By passing in the appropriate options, you can create a new foldercom.google.api.client.http.HttpResponsecreateFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, Association association)Creates a new file association By passing in the appropriate options, you can create a new folderFoldercreateFolder(String accessToken, String xeroTenantId, Folder folder)Creates a new folder By passing in the appropriate properties, you can create a new foldercom.google.api.client.http.HttpResponsecreateFolderForHttpResponse(String accessToken, String xeroTenantId, Folder folder)Creates a new folder By passing in the appropriate properties, you can create a new foldervoiddeleteFile(String accessToken, String xeroTenantId, UUID fileId)Deletes a specific file Delete a specific filevoiddeleteFileAssociation(String accessToken, String xeroTenantId, UUID fileId, UUID objectId)Deletes an existing file association By passing in the appropriate options, you can create a new foldercom.google.api.client.http.HttpResponsedeleteFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, UUID objectId)Deletes an existing file association By passing in the appropriate options, you can create a new foldercom.google.api.client.http.HttpResponsedeleteFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId)Deletes a specific file Delete a specific filevoiddeleteFolder(String accessToken, String xeroTenantId, UUID folderId)Deletes a folder By passing in the appropriate ID, you can delete a foldercom.google.api.client.http.HttpResponsedeleteFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId)Deletes a folder By passing in the appropriate ID, you can delete a folderApiClientgetApiClient()get ApiClientList<Association>getAssociationsByObject(String accessToken, String xeroTenantId, UUID objectId)Retrieves an association object using a unique object ID By passing in the appropriate options,com.google.api.client.http.HttpResponsegetAssociationsByObjectForHttpResponse(String accessToken, String xeroTenantId, UUID objectId)Retrieves an association object using a unique object ID By passing in the appropriate options,FileObjectgetFile(String accessToken, String xeroTenantId, UUID fileId)Retrieves a file by a unique file IDList<Association>getFileAssociations(String accessToken, String xeroTenantId, UUID fileId)Retrieves a specific file associations By passing in the appropriate options,com.google.api.client.http.HttpResponsegetFileAssociationsForHttpResponse(String accessToken, String xeroTenantId, UUID fileId)Retrieves a specific file associations By passing in the appropriate options,ByteArrayInputStreamgetFileContent(String accessToken, String xeroTenantId, UUID fileId)Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific filecom.google.api.client.http.HttpResponsegetFileContentForHttpResponse(String accessToken, String xeroTenantId, UUID fileId)Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific filecom.google.api.client.http.HttpResponsegetFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId)Retrieves a file by a unique file IDFilesgetFiles(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort)Retrieves filescom.google.api.client.http.HttpResponsegetFilesForHttpResponse(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort)Retrieves filesFoldergetFolder(String accessToken, String xeroTenantId, UUID folderId)Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific foldercom.google.api.client.http.HttpResponsegetFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId)Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific folderList<Folder>getFolders(String accessToken, String xeroTenantId, String sort)Retrieves folders By passing in the appropriate options, you can search for available folderscom.google.api.client.http.HttpResponsegetFoldersForHttpResponse(String accessToken, String xeroTenantId, String sort)Retrieves folders By passing in the appropriate options, you can search for available foldersFoldergetInbox(String accessToken, String xeroTenantId)Retrieves inbox folder Search for the user inboxcom.google.api.client.http.HttpResponsegetInboxForHttpResponse(String accessToken, String xeroTenantId)Retrieves inbox folder Search for the user inboxstatic FilesApigetInstance(ApiClient apiClient)FilesApi getInstanceStringgetUserAgent()get user agentvoidsetApiClient(ApiClient apiClient)set ApiClientvoidsetUserAgent(String userAgent)set user agentFileObjectupdateFile(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject)Update a file Updates file properties of a single filecom.google.api.client.http.HttpResponseupdateFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject)Update a file Updates file properties of a single fileFolderupdateFolder(String accessToken, String xeroTenantId, UUID folderId, Folder folder)Updates an existing folder By passing in the appropriate ID and properties, you can update a foldercom.google.api.client.http.HttpResponseupdateFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, Folder folder)Updates an existing folder By passing in the appropriate ID and properties, you can update a folderFileObjectuploadFile(String accessToken, String xeroTenantId, File body, String name, String filename, String mimeType)Uploads a File to the inboxcom.google.api.client.http.HttpResponseuploadFileForHttpResponse(String accessToken, String xeroTenantId, File body, String name, String filename, String mimeType)Uploads a File to the inboxFileObjectuploadFileToFolder(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String mimeType)Uploads a File to a specific foldercom.google.api.client.http.HttpResponseuploadFileToFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String mimeType)Uploads a File to a specific folder
-
-
-
Constructor Detail
-
FilesApi
public FilesApi()
FilesApi
-
FilesApi
public FilesApi(ApiClient apiClient)
FilesApi- Parameters:
apiClient- ApiClient pass into the new instance of this class
-
-
Method Detail
-
getInstance
public static FilesApi getInstance(ApiClient apiClient)
FilesApi 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
-
createFileAssociation
public Association createFileAssociation(String accessToken, String xeroTenantId, UUID fileId, Association association) throws IOException
Creates a new file association By passing in the appropriate options, you can create a new folder201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectassociation- The association parameteraccessToken- Authorization token for user set in header of each request- Returns:
- Association
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
createFileAssociationForHttpResponse
public com.google.api.client.http.HttpResponse createFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, Association association) throws IOException
Creates a new file association By passing in the appropriate options, you can create a new folder201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectassociation- The association parameteraccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
createFolder
public Folder createFolder(String accessToken, String xeroTenantId, Folder folder) throws IOException
Creates a new folder By passing in the appropriate properties, you can create a new folder200 - search results matching criteria
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for Tenantfolder- The folder parameteraccessToken- Authorization token for user set in header of each request- Returns:
- Folder
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
createFolderForHttpResponse
public com.google.api.client.http.HttpResponse createFolderForHttpResponse(String accessToken, String xeroTenantId, Folder folder) throws IOException
Creates a new folder By passing in the appropriate properties, you can create a new folder200 - search results matching criteria
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for Tenantfolder- The folder parameteraccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
deleteFile
public void deleteFile(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Deletes a specific file Delete a specific file204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectaccessToken- Authorization token for user set in header of each request- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
deleteFileForHttpResponse
public com.google.api.client.http.HttpResponse deleteFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Deletes a specific file Delete a specific file204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File 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
-
deleteFileAssociation
public void deleteFileAssociation(String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException
Deletes an existing file association By passing in the appropriate options, you can create a new folder204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectobjectId- Object id for single objectaccessToken- Authorization token for user set in header of each request- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
deleteFileAssociationForHttpResponse
public com.google.api.client.http.HttpResponse deleteFileAssociationForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, UUID objectId) throws IOException
Deletes an existing file association By passing in the appropriate options, you can create a new folder204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectobjectId- Object 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
-
deleteFolder
public void deleteFolder(String accessToken, String xeroTenantId, UUID folderId) throws IOException
Deletes a folder By passing in the appropriate ID, you can delete a folder204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder id for single objectaccessToken- Authorization token for user set in header of each request- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
deleteFolderForHttpResponse
public com.google.api.client.http.HttpResponse deleteFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId) throws IOException
Deletes a folder By passing in the appropriate ID, you can delete a folder204 - Successful deletion - return response 204 no content
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder 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
-
getAssociationsByObject
public List<Association> getAssociationsByObject(String accessToken, String xeroTenantId, UUID objectId) throws IOException
Retrieves an association object using a unique object ID By passing in the appropriate options,200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantobjectId- Object id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- List<Association>
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getAssociationsByObjectForHttpResponse
public com.google.api.client.http.HttpResponse getAssociationsByObjectForHttpResponse(String accessToken, String xeroTenantId, UUID objectId) throws IOException
Retrieves an association object using a unique object ID By passing in the appropriate options,200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantobjectId- Object 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
-
getFile
public FileObject getFile(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves a file by a unique file ID200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- FileObject
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFileForHttpResponse
public com.google.api.client.http.HttpResponse getFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves a file by a unique file ID200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File 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
-
getFileAssociations
public List<Association> getFileAssociations(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves a specific file associations By passing in the appropriate options,200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- List<Association>
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFileAssociationsForHttpResponse
public com.google.api.client.http.HttpResponse getFileAssociationsForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves a specific file associations By passing in the appropriate options,200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File 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
-
getFileContent
public ByteArrayInputStream getFileContent(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific file200 - returns the byte array of the specific file based on id
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- ByteArrayInputStream
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFileContentForHttpResponse
public com.google.api.client.http.HttpResponse getFileContentForHttpResponse(String accessToken, String xeroTenantId, UUID fileId) throws IOException
Retrieves the content of a specific file By passing in the appropriate options, retrieve data for specific file200 - returns the byte array of the specific file based on id
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File 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
-
getFiles
public Files getFiles(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) throws IOException
Retrieves files200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for Tenantpagesize- pass an optional page size valuepage- number of records to skip for paginationsort- values to sort byaccessToken- Authorization token for user set in header of each request- Returns:
- Files
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFilesForHttpResponse
public com.google.api.client.http.HttpResponse getFilesForHttpResponse(String accessToken, String xeroTenantId, Integer pagesize, Integer page, String sort) throws IOException
Retrieves files200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for Tenantpagesize- pass an optional page size valuepage- number of records to skip for paginationsort- values to sort byaccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getFolder
public Folder getFolder(String accessToken, String xeroTenantId, UUID folderId) throws IOException
Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific folder200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder id for single objectaccessToken- Authorization token for user set in header of each request- Returns:
- Folder
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFolderForHttpResponse
public com.google.api.client.http.HttpResponse getFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId) throws IOException
Retrieves specific folder by using a unique folder ID By passing in the appropriate ID, you can search for specific folder200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder 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
-
getFolders
public List<Folder> getFolders(String accessToken, String xeroTenantId, String sort) throws IOException
Retrieves folders By passing in the appropriate options, you can search for available folders200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for Tenantsort- values to sort byaccessToken- Authorization token for user set in header of each request- Returns:
- List<Folder>
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getFoldersForHttpResponse
public com.google.api.client.http.HttpResponse getFoldersForHttpResponse(String accessToken, String xeroTenantId, String sort) throws IOException
Retrieves folders By passing in the appropriate options, you can search for available folders200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for Tenantsort- values to sort byaccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
getInbox
public Folder getInbox(String accessToken, String xeroTenantId) throws IOException
Retrieves inbox folder Search for the user inbox200 - search results matching criteria
- Parameters:
xeroTenantId- Xero identifier for TenantaccessToken- Authorization token for user set in header of each request- Returns:
- Folder
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
getInboxForHttpResponse
public com.google.api.client.http.HttpResponse getInboxForHttpResponse(String accessToken, String xeroTenantId) throws IOException
Retrieves inbox folder Search for the user inbox200 - search results matching criteria
- 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
-
updateFile
public FileObject updateFile(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject) throws IOException
Update a file Updates file properties of a single file200 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectfileObject- The fileObject parameteraccessToken- Authorization token for user set in header of each request- Returns:
- FileObject
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
updateFileForHttpResponse
public com.google.api.client.http.HttpResponse updateFileForHttpResponse(String accessToken, String xeroTenantId, UUID fileId, FileObject fileObject) throws IOException
Update a file Updates file properties of a single file200 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfileId- File id for single objectfileObject- The fileObject parameteraccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
updateFolder
public Folder updateFolder(String accessToken, String xeroTenantId, UUID folderId, Folder folder) throws IOException
Updates an existing folder By passing in the appropriate ID and properties, you can update a folder200 - return the updated object
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder id for single objectfolder- The folder parameteraccessToken- Authorization token for user set in header of each request- Returns:
- Folder
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
updateFolderForHttpResponse
public com.google.api.client.http.HttpResponse updateFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, Folder folder) throws IOException
Updates an existing folder By passing in the appropriate ID and properties, you can update a folder200 - return the updated object
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- Folder id for single objectfolder- The folder parameteraccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
uploadFile
public FileObject uploadFile(String accessToken, String xeroTenantId, File body, String name, String filename, String mimeType) throws IOException
Uploads a File to the inbox201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for Tenantbody- The body parametername- exact name of the file you are uploadingfilename- The filename parametermimeType- The mimeType parameteraccessToken- Authorization token for user set in header of each request- Returns:
- FileObject
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
uploadFileForHttpResponse
public com.google.api.client.http.HttpResponse uploadFileForHttpResponse(String accessToken, String xeroTenantId, File body, String name, String filename, String mimeType) throws IOException
Uploads a File to the inbox201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for Tenantbody- The body parametername- exact name of the file you are uploadingfilename- The filename parametermimeType- The mimeType parameteraccessToken- Authorization token for user set in header of each request- Returns:
- HttpResponse
- Throws:
IOException- if an error occurs while attempting to invoke the API
-
uploadFileToFolder
public FileObject uploadFileToFolder(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String mimeType) throws IOException
Uploads a File to a specific folder201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- pass required folder id to save file to specific folderbody- The body parametername- exact name of the file you are uploadingfilename- The filename parametermimeType- The mimeType parameteraccessToken- Authorization token for user set in header of each request- Returns:
- FileObject
- Throws:
IOException- if an error occurs while attempting to invoke the API *
-
uploadFileToFolderForHttpResponse
public com.google.api.client.http.HttpResponse uploadFileToFolderForHttpResponse(String accessToken, String xeroTenantId, UUID folderId, File body, String name, String filename, String mimeType) throws IOException
Uploads a File to a specific folder201 - A successful request
400 - invalid input, object invalid
- Parameters:
xeroTenantId- Xero identifier for TenantfolderId- pass required folder id to save file to specific folderbody- The body parametername- exact name of the file you are uploadingfilename- The filename parametermimeType- The mimeType parameteraccessToken- 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
-
-