| /** |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| |
| /* |
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| * https://openapi-generator.tech |
| * Do not edit the class manually. |
| */ |
| |
| /* tslint:disable:no-unused-variable member-ordering */ |
| |
| import { Inject, Injectable, Optional } from '@angular/core'; |
| import { HttpClient, HttpHeaders, HttpParams, |
| HttpResponse, HttpEvent, HttpContext |
| } from '@angular/common/http'; |
| import { Observable } from 'rxjs'; |
| import { OpenApiHttpParams, QueryParamStyle } from '../query.params'; |
| |
| // @ts-ignore |
| import { Scorecard } from '../model/scorecard'; |
| // @ts-ignore |
| import { ScorecardData } from '../model/scorecardData'; |
| |
| // @ts-ignore |
| import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; |
| import { Configuration } from '../configuration'; |
| import { BaseService } from '../api.base.service'; |
| |
| |
| |
| @Injectable({ |
| providedIn: 'root' |
| }) |
| export class ScoreCardService extends BaseService { |
| |
| constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { |
| super(basePath, configuration); |
| } |
| |
| /** |
| * @endpoint get /v1/surveys/scorecards/clients/{clientId} |
| * @param clientId |
| * @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. |
| * @param options additional options |
| */ |
| public getSurveysScorecardsClientsClientId(clientId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<ScorecardData>>; |
| public getSurveysScorecardsClientsClientId(clientId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<ScorecardData>>>; |
| public getSurveysScorecardsClientsClientId(clientId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<ScorecardData>>>; |
| public getSurveysScorecardsClientsClientId(clientId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> { |
| if (clientId === null || clientId === undefined) { |
| throw new Error('Required parameter clientId was null or undefined when calling getSurveysScorecardsClientsClientId.'); |
| } |
| |
| let localVarHeaders = this.defaultHeaders; |
| |
| // authentication (basicAuth) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('basicAuth', 'Authorization', localVarHeaders, 'Basic '); |
| |
| // authentication (tenantid) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('tenantid', 'fineract-platform-tenantid', localVarHeaders); |
| |
| const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ |
| 'application/json' |
| ]); |
| if (localVarHttpHeaderAcceptSelected !== undefined) { |
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); |
| } |
| |
| const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); |
| |
| const localVarTransferCache: boolean = options?.transferCache ?? true; |
| |
| |
| let responseType_: 'text' | 'json' | 'blob' = 'json'; |
| if (localVarHttpHeaderAcceptSelected) { |
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { |
| responseType_ = 'text'; |
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { |
| responseType_ = 'json'; |
| } else { |
| responseType_ = 'blob'; |
| } |
| } |
| |
| let localVarPath = `/v1/surveys/scorecards/clients/${this.configuration.encodeParam({name: "clientId", value: clientId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; |
| const { basePath, withCredentials } = this.configuration; |
| return this.httpClient.request<Array<ScorecardData>>('get', `${basePath}${localVarPath}`, |
| { |
| context: localVarHttpContext, |
| responseType: <any>responseType_, |
| ...(withCredentials ? { withCredentials } : {}), |
| headers: localVarHeaders, |
| observe: observe, |
| ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), |
| reportProgress: reportProgress |
| } |
| ); |
| } |
| |
| /** |
| * List all Scorecard entries |
| * List all Scorecard entries for a survey. |
| * @endpoint get /v1/surveys/scorecards/{surveyId} |
| * @param surveyId Enter surveyId |
| * @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. |
| * @param options additional options |
| */ |
| public getSurveysScorecardsSurveyId(surveyId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<Scorecard>>; |
| public getSurveysScorecardsSurveyId(surveyId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<Scorecard>>>; |
| public getSurveysScorecardsSurveyId(surveyId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<Scorecard>>>; |
| public getSurveysScorecardsSurveyId(surveyId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> { |
| if (surveyId === null || surveyId === undefined) { |
| throw new Error('Required parameter surveyId was null or undefined when calling getSurveysScorecardsSurveyId.'); |
| } |
| |
| let localVarHeaders = this.defaultHeaders; |
| |
| // authentication (basicAuth) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('basicAuth', 'Authorization', localVarHeaders, 'Basic '); |
| |
| // authentication (tenantid) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('tenantid', 'fineract-platform-tenantid', localVarHeaders); |
| |
| const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ |
| 'application/json' |
| ]); |
| if (localVarHttpHeaderAcceptSelected !== undefined) { |
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); |
| } |
| |
| const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); |
| |
| const localVarTransferCache: boolean = options?.transferCache ?? true; |
| |
| |
| let responseType_: 'text' | 'json' | 'blob' = 'json'; |
| if (localVarHttpHeaderAcceptSelected) { |
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { |
| responseType_ = 'text'; |
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { |
| responseType_ = 'json'; |
| } else { |
| responseType_ = 'blob'; |
| } |
| } |
| |
| let localVarPath = `/v1/surveys/scorecards/${this.configuration.encodeParam({name: "surveyId", value: surveyId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; |
| const { basePath, withCredentials } = this.configuration; |
| return this.httpClient.request<Array<Scorecard>>('get', `${basePath}${localVarPath}`, |
| { |
| context: localVarHttpContext, |
| responseType: <any>responseType_, |
| ...(withCredentials ? { withCredentials } : {}), |
| headers: localVarHeaders, |
| observe: observe, |
| ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), |
| reportProgress: reportProgress |
| } |
| ); |
| } |
| |
| /** |
| * @endpoint get /v1/surveys/scorecards/{surveyId}/clients/{clientId} |
| * @param surveyId Enter surveyId |
| * @param clientId Enter clientId |
| * @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. |
| * @param options additional options |
| */ |
| public getSurveysScorecardsSurveyIdClientsClientId(surveyId: number, clientId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<ScorecardData>>; |
| public getSurveysScorecardsSurveyIdClientsClientId(surveyId: number, clientId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<ScorecardData>>>; |
| public getSurveysScorecardsSurveyIdClientsClientId(surveyId: number, clientId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<ScorecardData>>>; |
| public getSurveysScorecardsSurveyIdClientsClientId(surveyId: number, clientId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> { |
| if (surveyId === null || surveyId === undefined) { |
| throw new Error('Required parameter surveyId was null or undefined when calling getSurveysScorecardsSurveyIdClientsClientId.'); |
| } |
| if (clientId === null || clientId === undefined) { |
| throw new Error('Required parameter clientId was null or undefined when calling getSurveysScorecardsSurveyIdClientsClientId.'); |
| } |
| |
| let localVarHeaders = this.defaultHeaders; |
| |
| // authentication (basicAuth) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('basicAuth', 'Authorization', localVarHeaders, 'Basic '); |
| |
| // authentication (tenantid) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('tenantid', 'fineract-platform-tenantid', localVarHeaders); |
| |
| const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ |
| 'application/json' |
| ]); |
| if (localVarHttpHeaderAcceptSelected !== undefined) { |
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); |
| } |
| |
| const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); |
| |
| const localVarTransferCache: boolean = options?.transferCache ?? true; |
| |
| |
| let responseType_: 'text' | 'json' | 'blob' = 'json'; |
| if (localVarHttpHeaderAcceptSelected) { |
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { |
| responseType_ = 'text'; |
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { |
| responseType_ = 'json'; |
| } else { |
| responseType_ = 'blob'; |
| } |
| } |
| |
| let localVarPath = `/v1/surveys/scorecards/${this.configuration.encodeParam({name: "surveyId", value: surveyId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}/clients/${this.configuration.encodeParam({name: "clientId", value: clientId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; |
| const { basePath, withCredentials } = this.configuration; |
| return this.httpClient.request<Array<ScorecardData>>('get', `${basePath}${localVarPath}`, |
| { |
| context: localVarHttpContext, |
| responseType: <any>responseType_, |
| ...(withCredentials ? { withCredentials } : {}), |
| headers: localVarHeaders, |
| observe: observe, |
| ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), |
| reportProgress: reportProgress |
| } |
| ); |
| } |
| |
| /** |
| * Create a Scorecard entry |
| * Add a new entry to a survey. Mandatory Fields clientId, createdOn, questionId, responseId, staffId |
| * @endpoint post /v1/surveys/scorecards/{surveyId} |
| * @param surveyId Enter surveyId |
| * @param scorecardData scorecardData |
| * @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. |
| * @param options additional options |
| */ |
| public postSurveysScorecardsSurveyId(surveyId: number, scorecardData?: ScorecardData, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>; |
| public postSurveysScorecardsSurveyId(surveyId: number, scorecardData?: ScorecardData, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>; |
| public postSurveysScorecardsSurveyId(surveyId: number, scorecardData?: ScorecardData, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>; |
| public postSurveysScorecardsSurveyId(surveyId: number, scorecardData?: ScorecardData, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> { |
| if (surveyId === null || surveyId === undefined) { |
| throw new Error('Required parameter surveyId was null or undefined when calling postSurveysScorecardsSurveyId.'); |
| } |
| |
| let localVarHeaders = this.defaultHeaders; |
| |
| // authentication (basicAuth) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('basicAuth', 'Authorization', localVarHeaders, 'Basic '); |
| |
| // authentication (tenantid) required |
| localVarHeaders = this.configuration.addCredentialToHeaders('tenantid', 'fineract-platform-tenantid', localVarHeaders); |
| |
| const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ |
| ]); |
| if (localVarHttpHeaderAcceptSelected !== undefined) { |
| localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); |
| } |
| |
| const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); |
| |
| const localVarTransferCache: boolean = options?.transferCache ?? true; |
| |
| |
| // to determine the Content-Type header |
| const consumes: string[] = [ |
| 'application/json' |
| ]; |
| const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); |
| if (httpContentTypeSelected !== undefined) { |
| localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); |
| } |
| |
| let responseType_: 'text' | 'json' | 'blob' = 'json'; |
| if (localVarHttpHeaderAcceptSelected) { |
| if (localVarHttpHeaderAcceptSelected.startsWith('text')) { |
| responseType_ = 'text'; |
| } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { |
| responseType_ = 'json'; |
| } else { |
| responseType_ = 'blob'; |
| } |
| } |
| |
| let localVarPath = `/v1/surveys/scorecards/${this.configuration.encodeParam({name: "surveyId", value: surveyId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; |
| const { basePath, withCredentials } = this.configuration; |
| return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, |
| { |
| context: localVarHttpContext, |
| body: scorecardData, |
| responseType: <any>responseType_, |
| ...(withCredentials ? { withCredentials } : {}), |
| headers: localVarHeaders, |
| observe: observe, |
| ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), |
| reportProgress: reportProgress |
| } |
| ); |
| } |
| |
| } |