/** * API Documentation for Redaction Gateway * Description for redaction * * OpenAPI spec version: 1.0 * * * 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. */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; import { PageExclusionRequest } from '../model/pageExclusionRequest'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class ReanalysisControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); protected basePath = ''; constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration ) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * Exclude pages from analysis for a file * None * @param body pageExclusionRequest * @param dossierId dossierId * @param fileId fileId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public excludePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean ): Observable; public excludePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public excludePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public excludePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling excludePages.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling excludePages.'); } if (fileId === null || fileId === undefined) { throw new Error('Required parameter fileId was null or undefined when calling excludePages.'); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.request( 'post', `${this.basePath}/exclude-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Include pages from analysis for a file * None * @param body pageInclusionRequest * @param dossierId dossierId * @param fileId fileId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public includePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean ): Observable; public includePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public includePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public includePages( body: PageExclusionRequest, dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling includePages.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling includePages.'); } if (fileId === null || fileId === undefined) { throw new Error('Required parameter fileId was null or undefined when calling includePages.'); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.request( 'post', `${this.basePath}/include-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Ocr and reanalyze a dossier * None * @param dossierId dossierId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public ocrDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; public ocrDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; public ocrDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; public ocrDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling ocrDossier.'); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * Ocr and reanalyze a file * None * @param dossierId dossierId * @param fileId fileId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public ocrFile(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; public ocrFile(dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; public ocrFile(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; public ocrFile(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling ocrFile.'); } if (fileId === null || fileId === undefined) { throw new Error('Required parameter fileId was null or undefined when calling ocrFile.'); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Ocr and reanalyze multiple files for a dossier * None * @param body fileIds * @param dossierId dossierId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public ocrFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; public ocrFiles(body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; public ocrFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; public ocrFiles(body: Array, dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling ocrFiles.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling ocrFiles.'); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * Reanalyze all files of the dossier. * None * @param dossierId dossierId * @param force force * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; public reanalyzeDossier( dossierId: string, force?: boolean, observe?: 'response', reportProgress?: boolean ): Observable>; public reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; public reanalyzeDossier(dossierId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeDossier.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (force !== undefined && force !== null) { queryParameters = queryParameters.set('force', force); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * Reanalyze a file * None * @param dossierId dossierId * @param fileId fileId * @param force force * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public reanalyzeFile(dossierId: string, fileId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; public reanalyzeFile( dossierId: string, fileId: string, force?: boolean, observe?: 'response', reportProgress?: boolean ): Observable>; public reanalyzeFile( dossierId: string, fileId: string, force?: boolean, observe?: 'events', reportProgress?: boolean ): Observable>; public reanalyzeFile( dossierId: string, fileId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFile.'); } if (fileId === null || fileId === undefined) { throw new Error('Required parameter fileId was null or undefined when calling reanalyzeFile.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (force !== undefined && force !== null) { queryParameters = queryParameters.set('force', force); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Reanalyze multiple files for a dossier * None * @param body fileIds * @param dossierId dossierId * @param force force * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public reanalyzeFilesForDossier( body: Array, dossierId: string, force?: boolean, observe?: 'body', reportProgress?: boolean ): Observable; public reanalyzeFilesForDossier( body: Array, dossierId: string, force?: boolean, observe?: 'response', reportProgress?: boolean ): Observable>; public reanalyzeFilesForDossier( body: Array, dossierId: string, force?: boolean, observe?: 'events', reportProgress?: boolean ): Observable>; public reanalyzeFilesForDossier( body: Array, dossierId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling reanalyzeFilesForDossier.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFilesForDossier.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (force !== undefined && force !== null) { queryParameters = queryParameters.set('force', force); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } // to determine the Content-Type header const consumes: string[] = ['application/json']; const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { headers = headers.set('Content-Type', httpContentTypeSelected); } return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { body: body, params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress }); } /** * Exclude or re-include a file to analysis * None * @param dossierId dossierId * @param fileId fileId * @param excluded excluded * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public toggleAnalysis( dossierId: string, fileId: string, excluded?: boolean, observe?: 'body', reportProgress?: boolean ): Observable; public toggleAnalysis( dossierId: string, fileId: string, excluded?: boolean, observe?: 'response', reportProgress?: boolean ): Observable>; public toggleAnalysis( dossierId: string, fileId: string, excluded?: boolean, observe?: 'events', reportProgress?: boolean ): Observable>; public toggleAnalysis( dossierId: string, fileId: string, excluded?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling toggleAnalysis.'); } if (fileId === null || fileId === undefined) { throw new Error('Required parameter fileId was null or undefined when calling toggleAnalysis.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (excluded !== undefined && excluded !== null) { queryParameters = queryParameters.set('excluded', excluded); } let headers = this.defaultHeaders; // authentication (RED-OAUTH) required if (this.configuration.accessToken) { const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; headers = headers.set('Authorization', 'Bearer ' + accessToken); } // to determine the Accept header const httpHeaderAccepts: string[] = []; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'post', `${this.basePath}/toggle-analysis/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }