/**
 * iCure Data Stack API Documentation
 * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
 *
 * OpenAPI spec version: v1
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
import { XHR } from './XHR';
import { DocIdentifier } from '../model/DocIdentifier';
import { Document } from '../model/Document';
import { ListOfIds } from '../model/ListOfIds';
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult';
import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams';
import { PaginatedListDocument } from '../model/PaginatedListDocument';
import { AbstractFilterDocument } from '../model/AbstractFilterDocument';
import { TimingInfo } from '../model/TimingInfo';
export declare class IccDocumentApi {
    host: string;
    _headers: Array<XHR.Header>;
    authenticationProvider: AuthenticationProvider;
    fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
    get headers(): Promise<Array<XHR.Header>>;
    constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
    setHeaders(h: Array<XHR.Header>): void;
    handleError(e: XHR.XHRError): never;
    /**
     * Creates a document and returns an instance of created document afterward
     * @summary Create a document
     * @param body
     */
    createDocument(body?: Document): Promise<Document>;
    /**
     * Deletes a document's attachment and returns the modified document instance afterward
     * @summary Delete a document's attachment
     * @param documentId
     */
    deleteAttachment(documentId: string): Promise<Document>;
    /**
     * @summary Deletes a batch of documents and returns the list of deleted document ids.
     *
     * @param documentIds a ListOfIds containing the ids of the documents to delete.
     * @return a Promise that will resolve in an array of DocIdentifier of the successfully deleted documents.
     */
    deleteDocuments(documentIds: ListOfIds): Promise<Array<DocIdentifier>>;
    /**
     * @summary Deletes a single document by id.
     *
     * @param documentId the id of the document to delete.
     * @return a DocIdentifier of the document.
     */
    deleteDocument(documentId: string): Promise<DocIdentifier>;
    /**
     * @summary Purges a single document, also purging any attachment linked to it.
     *
     * @param document the document to purge.
     * @return a DocIdentifier of the document.
     */
    purgeDocument(document: Document): Promise<DocIdentifier>;
    /**
     * Keys must be delimited by coma
     * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead.
     * @summary List documents found By type, By Healthcare Party and secret foreign keys.
     * @param documentTypeCode
     * @param hcPartyId
     * @param secretFKeys
     */
    findByTypeHCPartyMessageSecretFKeys(documentTypeCode: string, hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>>;
    /**
     * Keys must be delimited by commas.
     * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead.
     * @summary List documents found By Healthcare Party and secret foreign keys.
     * @param hcPartyId
     * @param secretFKeys
     */
    findDocumentsByHCPartyPatientForeignKeys(hcPartyId: string, secretFKeys: string[]): Promise<Array<Document>>;
    /**
     * @summary List documents found By Healthcare Party and a single secret foreign key with pagination.
     * @deprecated use {@link findDocumentIdsByDataOwnerSecretForeignKey} instead.
     * @param hcPartyId the healthcare party id.
     * @param secretFKey the secret foreign key.
     * @param startKey the startKey provided by the previous page or undefined for the first page.
     * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page.
     * @param limit the number of elements that the page should contain.
     * @return a promise that will resolve in a PaginatedListDocument.
     */
    findDocumentsByHCPartyPatientForeignKey(hcPartyId: string, secretFKey: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListDocument>;
    findDocumentIdsByDataOwnerSecretForeignKey(dataOwnerId: string, secretForeignKeys: string[], startDate?: number, endDate?: number, descending?: boolean): Promise<string[]>;
    /**
     * Keys must be delimited by commas.
     * @summary List documents with no delegation
     * @param limit
     */
    findWithoutDelegation(limit?: number): Promise<Array<Document>>;
    /**
     * Returns the document corresponding to the identifier passed in the request
     * @summary Get a document
     * @param documentId
     */
    getDocument(documentId: string): Promise<Document>;
    /**
     * @deprecated use getMainDocumentAttachment instead
     */
    getDocumentAttachment(documentId: string, attachmentId: string, enckeys?: string, fileName?: string): Promise<ArrayBuffer>;
    /**
     * Get the main attachment of a document
     * @param documentId id of the document
     * @return the content of the main attachment for the document (if any)
     */
    getMainDocumentAttachment(documentId: string): Promise<ArrayBuffer>;
    /**
     * Get the main attachment of a document forcing usage of `application/octet-stream` in Content-Type
     * @param documentId id of the document
     * @return the content of the main attachment for the document (if any)
     */
    getRawMainDocumentAttachment(documentId: string): Promise<ArrayBuffer>;
    /**
     * Returns the first document corresponding to the externalUuid passed in the request
     * @summary Get a document
     * @param externalUuid
     */
    getDocumentByExternalUuid(externalUuid: string): Promise<Document>;
    /**
     * Returns a list of document corresponding to the identifiers passed in the body
     * @summary Get a batch of document
     * @param body
     */
    getDocuments(body?: ListOfIds): Promise<Array<Document>>;
    /**
     * Returns a list of document corresponding to the externalUuid passed in the request
     * @summary Get all documents with externalUuid
     * @param externalUuid
     */
    getDocumentsByExternalUuid(externalUuid: string): Promise<Array<Document>>;
    /**
     * Updates the document and returns an instance of the modified document afterward
     * @summary Update a document
     * @param body
     */
    modifyDocument(body?: Document): Promise<Document>;
    /**
     * Returns the modified documents.
     * @summary Update a batch of documents
     * @param body
     */
    modifyDocuments(body?: Array<Document>): Promise<Array<Document>>;
    /**
     * Creates or updates a main attachment for a document and returns the modified document instance afterward
     * @param documentId id of the document
     * @param documentRev revision of the document
     * @param body content of the attachment (must be compatible with XHR body)
     * @param utis an array of UTIs for the attachment. The first element will be considered as the main UTI for the document. If provided and non-empty
     * overrides existing values.
     * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type
     * for the attachment. Defaults is false
     * @param compressionAlgorithm the client-side compression algorithm used on the data, if any (e.g. 'lzma2'). Null/undefined if no compression was applied.
     * @param triedCompressionAlgorithmsVersion a version string indicating which compression algorithms were tried by the SDK, used to decide whether
     * re-compression with newer algorithms should be attempted on read.
     * @param realDataSize the size in bytes of the original data before compression and encryption, used for informational purposes.
     */
    setMainDocumentAttachment(documentId: string, documentRev: string, body: Object, utis?: Array<string>, dataIsEncrypted?: boolean, compressionAlgorithm?: string, triedCompressionAlgorithmsVersion?: string, realDataSize?: number): Promise<Document>;
    /**
     * @deprecated use setMainDocumentAttachment instead
     */
    setDocumentAttachmentBody(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document>;
    /**
     * @deprecated use setMainDocumentAttachment instead
     */
    setDocumentAttachment(documentId: string, documentRev: string, enckeys?: null, body?: Object, utis?: string[]): Promise<Document>;
    /**
     * @deprecated use setMainDocumentAttachment instead
     */
    setDocumentAttachmentMulti(attachment: ArrayBuffer, documentRev: string, documentId: string, enckeys?: null): Promise<Document>;
    /**
     * Creates or updates a secondary attachment for a document and returns the modified document instance afterward
     * @summary Creates or modifies a secondary attachment for a document
     * @param documentId id of the document to update
     * @param key Key of the secondary attachment to update
     * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method
     * will fail with CONFLICT status
     * @param attachment
     * @param utis an array of UTIs for the attachment. If provided and non-empty overrides existing values.
     * @param dataIsEncrypted set this to true if the body you provided is containing encrypted data. This helps to have the appropriate content type
     * for the attachment. Defaults is false
     * @param compressionAlgorithm the client-side compression algorithm used on the data, if any (e.g. 'lzma'). Null/undefined if no compression was applied.
     * @param triedCompressionAlgorithmsVersion a version string indicating which compression algorithms were tried by the SDK, used to decide whether
     * re-compression with newer algorithms should be attempted on read.
     * @param realDataSize the size in bytes of the original data before compression and encryption, used for informational purposes.
     * @return the updated document
     */
    setSecondaryAttachment(documentId: string, key: string, rev: string, attachment: Object, utis?: Array<string>, dataIsEncrypted?: boolean, compressionAlgorithm?: string, triedCompressionAlgorithmsVersion?: string, realDataSize?: number): Promise<Document>;
    /**
     * Get the secondary attachment with the provided key for a document
     * @summary Retrieve a secondary attachment of a document
     * @param documentId id of the document
     * @param key Key of the secondary attachment to retrieve
     * @param fileName
     * @return the content of the attachment
     */
    getSecondaryAttachment(documentId: string, key: string, fileName?: string): Promise<ArrayBuffer>;
    /**
     * Deletes a document's attachment and returns the modified document instance afterward
     * @summary Delete a document's attachment
     * @param documentId id of the document
     * @param key Key of the secondary attachment to delete
     * @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status
     * @return the updated document
     */
    deleteSecondaryAttachment(documentId: string, key: string, rev: string): Promise<Document>;
    /**
     * @internal this method is for internal use only and may be changed without notice
     */
    bulkShareDocument(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Document>[]>;
    matchDocumentsBy(body?: AbstractFilterDocument, collectTiming?: false): Promise<Array<string>>;
    matchDocumentsBy(body?: AbstractFilterDocument, collectTiming?: true): Promise<Array<string> & TimingInfo>;
}
