710 lines
28 KiB
TypeScript
710 lines
28 KiB
TypeScript
/**
|
|
* 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<DossierAttributes>;
|
|
|
|
public addOrUpdateDossierAttributes(
|
|
body: DossierAttribute,
|
|
dossierId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributes>>;
|
|
|
|
public addOrUpdateDossierAttributes(
|
|
body: DossierAttribute,
|
|
dossierId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<DossierAttributes>>;
|
|
|
|
public addOrUpdateDossierAttributes(
|
|
body: DossierAttribute,
|
|
dossierId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<DossierAttributes>(
|
|
'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<DossierAttributeConfig>;
|
|
|
|
public addOrUpdateDossierAttributesConfig(
|
|
body: DossierAttributeConfig,
|
|
dossierTemplateId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributeConfig>>;
|
|
|
|
public addOrUpdateDossierAttributesConfig(
|
|
body: DossierAttributeConfig,
|
|
dossierTemplateId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<DossierAttributeConfig>>;
|
|
|
|
public addOrUpdateDossierAttributesConfig(
|
|
body: DossierAttributeConfig,
|
|
dossierTemplateId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<DossierAttributeConfig>(
|
|
'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<any>;
|
|
|
|
public deleteDossierAttribute(
|
|
dossierAttributeId: string,
|
|
dossierId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public deleteDossierAttribute(
|
|
dossierAttributeId: string,
|
|
dossierId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<any>>;
|
|
|
|
public deleteDossierAttribute(
|
|
dossierAttributeId: string,
|
|
dossierId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<any>(
|
|
'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<any>;
|
|
|
|
public deleteDossierAttributeConfig(
|
|
dossierAttributeId: string,
|
|
dossierTemplateId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public deleteDossierAttributeConfig(
|
|
dossierAttributeId: string,
|
|
dossierTemplateId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<any>>;
|
|
|
|
public deleteDossierAttributeConfig(
|
|
dossierAttributeId: string,
|
|
dossierTemplateId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<any>(
|
|
'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<string>,
|
|
dossierTemplateId: string,
|
|
observe?: 'body',
|
|
reportProgress?: boolean
|
|
): Observable<any>;
|
|
|
|
public deleteDossierAttributesConfig(
|
|
dossierAttributeIds: Array<string>,
|
|
dossierTemplateId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<any>>;
|
|
|
|
public deleteDossierAttributesConfig(
|
|
dossierAttributeIds: Array<string>,
|
|
dossierTemplateId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<any>>;
|
|
|
|
public deleteDossierAttributesConfig(
|
|
dossierAttributeIds: Array<string>,
|
|
dossierTemplateId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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', <any>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<any>(
|
|
'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<DossierAttributes>;
|
|
|
|
public getDossierAttributes(
|
|
dossierId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributes>>;
|
|
|
|
public getDossierAttributes(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<DossierAttributes>>;
|
|
|
|
public getDossierAttributes(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
|
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<DossierAttributes>(
|
|
'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<DossierAttributesConfig>;
|
|
|
|
public getDossierAttributesConfig(
|
|
dossierTemplateId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributesConfig>>;
|
|
|
|
public getDossierAttributesConfig(
|
|
dossierTemplateId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<DossierAttributesConfig>>;
|
|
|
|
public getDossierAttributesConfig(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
|
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<DossierAttributesConfig>(
|
|
'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<DossierAttributes>;
|
|
|
|
public setDossierAttributes(
|
|
body: DossierAttributes,
|
|
dossierId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributes>>;
|
|
|
|
public setDossierAttributes(
|
|
body: DossierAttributes,
|
|
dossierId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<DossierAttributes>>;
|
|
|
|
public setDossierAttributes(
|
|
body: DossierAttributes,
|
|
dossierId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<DossierAttributes>(
|
|
'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<DossierAttributesConfig>;
|
|
|
|
public setDossierAttributesConfig(
|
|
body: DossierAttributesConfig,
|
|
dossierTemplateId: string,
|
|
observe?: 'response',
|
|
reportProgress?: boolean
|
|
): Observable<HttpResponse<DossierAttributesConfig>>;
|
|
|
|
public setDossierAttributesConfig(
|
|
body: DossierAttributesConfig,
|
|
dossierTemplateId: string,
|
|
observe?: 'events',
|
|
reportProgress?: boolean
|
|
): Observable<HttpEvent<DossierAttributesConfig>>;
|
|
|
|
public setDossierAttributesConfig(
|
|
body: DossierAttributesConfig,
|
|
dossierTemplateId: string,
|
|
observe: any = 'body',
|
|
reportProgress: boolean = false
|
|
): Observable<any> {
|
|
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<DossierAttributesConfig>(
|
|
'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;
|
|
}
|
|
}
|