xero-node
Version:
Xero NodeJS OAuth 2.0 client for xero-node
315 lines (314 loc) • 11.2 kB
TypeScript
/**
* Xero Files API
* These endpoints are specific to Xero Files API
*
* The version of the OpenAPI document: 12.0.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import fs = require('fs');
import { Association } from '../model/files/association';
import { FileObject } from '../model/files/fileObject';
import { Files } from '../model/files/files';
import { Folder } from '../model/files/folder';
import { Authentication } from '../model/files/models';
import { AxiosResponse } from 'axios';
import { Readable } from "stream";
import { OAuth } from '../model/files/models';
export declare enum FilesApiApiKeys {
}
export declare class FilesApi {
protected _basePath: string;
protected defaultHeaders: any;
protected _useQuerystring: boolean;
protected binaryHeaders: any;
protected authentications: {
default: Authentication;
OAuth2: OAuth;
};
constructor(basePath?: string);
set useQuerystring(value: boolean);
set basePath(basePath: string);
get basePath(): string;
setDefaultAuthentication(auth: Authentication): void;
setApiKey(key: FilesApiApiKeys, value: string): void;
set accessToken(token: string);
/**
* By passing in the appropriate options, you can create a new folder
* @summary Creates a new file association
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
* @param association
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
*/
createFileAssociation(xeroTenantId: string, fileId: string, association: Association, idempotencyKey?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Association;
}>;
/**
* By passing in the appropriate properties, you can create a new folder
* @summary Creates a new folder
* @param xeroTenantId Xero identifier for Tenant
* @param folder
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
*/
createFolder(xeroTenantId: string, folder: Folder, idempotencyKey?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Folder;
}>;
/**
* Delete a specific file
* @summary Deletes a specific file
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
*/
deleteFile(xeroTenantId: string, fileId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* By passing in the appropriate options, you can create a new folder
* @summary Deletes an existing file association
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
* @param objectId Object id for single object
*/
deleteFileAssociation(xeroTenantId: string, fileId: string, objectId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* By passing in the appropriate ID, you can delete a folder
* @summary Deletes a folder
* @param xeroTenantId Xero identifier for Tenant
* @param folderId Folder id for single object
*/
deleteFolder(xeroTenantId: string, folderId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body?: any;
}>;
/**
* By passing in the appropriate options, you can retrieve an association
* @summary Retrieves an association object using a unique object ID
* @param xeroTenantId Xero identifier for Tenant
* @param objectId Object id for single object
* @param pagesize pass an optional page size value
* @param page number of records to skip for pagination
* @param sort values to sort by
* @param direction direction to sort by
*/
getAssociationsByObject(xeroTenantId: string, objectId: string, pagesize?: number, page?: number, sort?: 'Name' | 'CreatedDateUTC', direction?: 'ASC' | 'DESC', options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Array<Association>;
}>;
/**
* By passing in the appropriate options, you can retrieve the association count for objects
* @summary Retrieves a count of associations for a list of objects.
* @param xeroTenantId Xero identifier for Tenant
* @param objectIds A comma-separated list of object ids
*/
getAssociationsCount(xeroTenantId: string, objectIds: Array<string>, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: object;
}>;
/**
*
* @summary Retrieves a file by a unique file ID
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
*/
getFile(xeroTenantId: string, fileId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: FileObject;
}>;
/**
* By passing in the appropriate options,
* @summary Retrieves a specific file associations
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
*/
getFileAssociations(xeroTenantId: string, fileId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Array<Association>;
}>;
/**
* By passing in the appropriate options, retrieve data for specific file
* @summary Retrieves the content of a specific file
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
*/
getFileContent(xeroTenantId: string, fileId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Buffer;
}>;
/**
*
* @summary Retrieves files
* @param xeroTenantId Xero identifier for Tenant
* @param pagesize pass an optional page size value
* @param page number of records to skip for pagination
* @param sort values to sort by
* @param direction sort direction
*/
getFiles(xeroTenantId: string, pagesize?: number, page?: number, sort?: 'Name' | 'Size' | 'CreatedDateUTC', direction?: 'ASC' | 'DESC', options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Files;
}>;
/**
* By passing in the appropriate ID, you can search for specific folder
* @summary Retrieves specific folder by using a unique folder ID
* @param xeroTenantId Xero identifier for Tenant
* @param folderId Folder id for single object
*/
getFolder(xeroTenantId: string, folderId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Folder;
}>;
/**
* By passing in the appropriate options, you can search for available folders
* @summary Retrieves folders
* @param xeroTenantId Xero identifier for Tenant
* @param sort values to sort by
*/
getFolders(xeroTenantId: string, sort?: 'Name' | 'Size' | 'CreatedDateUTC', options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Array<Folder>;
}>;
/**
* Search for the user inbox
* @summary Retrieves inbox folder
* @param xeroTenantId Xero identifier for Tenant
*/
getInbox(xeroTenantId: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Folder;
}>;
/**
* Updates file properties of a single file
* @summary Update a file
* @param xeroTenantId Xero identifier for Tenant
* @param fileId File id for single object
* @param fileObject
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
*/
updateFile(xeroTenantId: string, fileId: string, fileObject: FileObject, idempotencyKey?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: FileObject;
}>;
/**
* By passing in the appropriate ID and properties, you can update a folder
* @summary Updates an existing folder
* @param xeroTenantId Xero identifier for Tenant
* @param folderId Folder id for single object
* @param folder
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
*/
updateFolder(xeroTenantId: string, folderId: string, folder: Folder, idempotencyKey?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: Folder;
}>;
/**
*
* @summary Uploads a File to the inbox
* @param xeroTenantId Xero identifier for Tenant
* @param body
* @param name exact name of the file you are uploading
* @param filename
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
* @param mimeType
*/
uploadFile(xeroTenantId: string, body: fs.ReadStream | Readable | Buffer, name: string, filename: string, idempotencyKey?: string, mimeType?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: FileObject;
}>;
/**
*
* @summary Uploads a File to a specific folder
* @param xeroTenantId Xero identifier for Tenant
* @param folderId pass required folder id to save file to specific folder
* @param body
* @param name exact name of the file you are uploading
* @param filename
* @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
* @param mimeType
*/
uploadFileToFolder(xeroTenantId: string, folderId: string, body: fs.ReadStream | Readable | Buffer, name: string, filename: string, idempotencyKey?: string, mimeType?: string, options?: {
headers: {
[name: string]: string;
};
}): Promise<{
response: AxiosResponse;
body: FileObject;
}>;
}