/** * 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 { DossierAttributeConfig } from '../model/dossierAttributeConfig'; import { DossierAttribute } from '../model/dossierAttribute'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; import { DossierAttributes } from '../model/dossierAttributes'; import { DossierAttributesConfig } from '../model/dossierAttributesConfig'; @Injectable() export class DossierAttributesControllerService { 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; } } /** * Add or update a dossier attribute in existing dossier. * None * @param body dossierAttribute * @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 addOrUpdateDossierAttributes( body: DossierAttribute, dossierId: string, observe?: 'body', reportProgress?: boolean ): Observable; public addOrUpdateDossierAttributes( body: DossierAttribute, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public addOrUpdateDossierAttributes( body: DossierAttribute, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public addOrUpdateDossierAttributes( body: DossierAttribute, 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 addOrUpdateDossierAttributes.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling addOrUpdateDossierAttributes.'); } 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[] = ['application/json']; 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}/dossier-attributes/update/${encodeURIComponent(String(dossierId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Add or update a dossier attribute in base configuration. * None * @param body dossierAttribute * @param dossierTemplateId dossierTemplateId * @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 addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean ): Observable; public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public addOrUpdateDossierAttributesConfig( body: DossierAttributeConfig, dossierTemplateId: 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 addOrUpdateDossierAttributesConfig.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { throw new Error('Required parameter dossierTemplateId was null or undefined when calling addOrUpdateDossierAttributesConfig.'); } 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[] = ['application/json']; 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}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Delete a specific dossier attribute. * None * @param dossierAttributeId dossierAttributeId * @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 deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe?: 'body', reportProgress?: boolean ): Observable; public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public deleteDossierAttribute( dossierAttributeId: string, dossierId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (dossierAttributeId === null || dossierAttributeId === undefined) { throw new Error('Required parameter dossierAttributeId was null or undefined when calling deleteDossierAttribute.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling deleteDossierAttribute.'); } 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( 'delete', `${this.basePath}/dossier-attributes/set/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( String(dossierAttributeId) )}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Delete a specific dossier attribute. * None * @param dossierAttributeId dossierAttributeId * @param dossierTemplateId dossierTemplateId * @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 deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean ): Observable; public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public deleteDossierAttributeConfig( dossierAttributeId: string, dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (dossierAttributeId === null || dossierAttributeId === undefined) { throw new Error('Required parameter dossierAttributeId was null or undefined when calling deleteDossierAttributeConfig.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierAttributeConfig.'); } 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( 'delete', `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent( String(dossierAttributeId) )}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Bulk delete dossier attributes. * None * @param dossierAttributeIds dossierAttributeIds * @param dossierTemplateId dossierTemplateId * @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 deleteDossierAttributesConfig( dossierAttributeIds: Array, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean ): Observable; public deleteDossierAttributesConfig( dossierAttributeIds: Array, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public deleteDossierAttributesConfig( dossierAttributeIds: Array, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public deleteDossierAttributesConfig( dossierAttributeIds: Array, dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (dossierAttributeIds === null || dossierAttributeIds === undefined) { throw new Error('Required parameter dossierAttributeIds was null or undefined when calling deleteDossierAttributesConfig.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierAttributesConfig.'); } let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); if (dossierAttributeIds) { dossierAttributeIds.forEach(element => { queryParameters = queryParameters.append('dossierAttributeIds', element); }); } 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}/dossier-attributes/config/delete/${encodeURIComponent(String(dossierTemplateId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get the dossier attributes. * 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 getDossierAttributes(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; public getDossierAttributes( dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public getDossierAttributes(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; public getDossierAttributes(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 getDossierAttributes.'); } 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[] = ['application/json']; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'get', `${this.basePath}/dossier-attributes/${encodeURIComponent(String(dossierId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Get the dossier attributes configuration. * None * @param dossierTemplateId dossierTemplateId * @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 getDossierAttributesConfig( dossierTemplateId: string, observe?: 'body', reportProgress?: boolean ): Observable; public getDossierAttributesConfig( dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public getDossierAttributesConfig( dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public getDossierAttributesConfig(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { if (dossierTemplateId === null || dossierTemplateId === undefined) { throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierAttributesConfig.'); } 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[] = ['application/json']; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected !== undefined) { headers = headers.set('Accept', httpHeaderAcceptSelected); } return this.httpClient.request( 'get', `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Set dossier attributes to an existing dossier * None * @param body dossierAttributes * @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 setDossierAttributes( body: DossierAttributes, dossierId: string, observe?: 'body', reportProgress?: boolean ): Observable; public setDossierAttributes( body: DossierAttributes, dossierId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public setDossierAttributes( body: DossierAttributes, dossierId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public setDossierAttributes( body: DossierAttributes, 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 setDossierAttributes.'); } if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling setDossierAttributes.'); } 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[] = ['application/json']; 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}/dossier-attributes/set/${encodeURIComponent(String(dossierId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * Set dossier attributes base configuration. * None * @param body dossierAttributesConfig * @param dossierTemplateId dossierTemplateId * @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 setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean ): Observable; public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean ): Observable>; public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean ): Observable>; public setDossierAttributesConfig( body: DossierAttributesConfig, dossierTemplateId: 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 setDossierAttributesConfig.'); } if (dossierTemplateId === null || dossierTemplateId === undefined) { throw new Error('Required parameter dossierTemplateId was null or undefined when calling setDossierAttributesConfig.'); } 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[] = ['application/json']; 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( 'put', `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise */ private canConsumeForm(consumes: string[]): boolean { const form = 'multipart/form-data'; for (const consume of consumes) { if (form === consume) { return true; } } return false; } }