From e811f1620e79b07890b4b79cc81d995241431dc8 Mon Sep 17 00:00:00 2001 From: Jan Peter Meyer <102802985+janpmeyer@users.noreply.github.com> Date: Mon, 23 Oct 2023 08:45:15 +0200 Subject: [PATCH] feat: remove dataplaneService (#125) feat: remove dataplaneService (#57) --- src/modules/mgmt-api-client/api.module.ts | 1 - src/modules/mgmt-api-client/api/api.ts | 4 +- .../api/dataplaneSelector.service.ts | 277 ------------------ 3 files changed, 1 insertion(+), 281 deletions(-) delete mode 100644 src/modules/mgmt-api-client/api/dataplaneSelector.service.ts diff --git a/src/modules/mgmt-api-client/api.module.ts b/src/modules/mgmt-api-client/api.module.ts index 17e6fad30..a01051eda 100644 --- a/src/modules/mgmt-api-client/api.module.ts +++ b/src/modules/mgmt-api-client/api.module.ts @@ -7,7 +7,6 @@ import { AssetService } from './api/asset.service'; import { ContractAgreementService } from './api/contractAgreement.service'; import { ContractDefinitionService } from './api/contractDefinition.service'; import { ContractNegotiationService } from './api/contractNegotiation.service'; -import { DataplaneSelectorService } from './api/dataplaneSelector.service'; import { HTTPProvisionerWebhookService } from './api/hTTPProvisionerWebhook.service'; import { PolicyService } from './api/policy.service'; import { TransferProcessService } from './api/transferProcess.service'; diff --git a/src/modules/mgmt-api-client/api/api.ts b/src/modules/mgmt-api-client/api/api.ts index 0d30304ec..0cb6d915e 100644 --- a/src/modules/mgmt-api-client/api/api.ts +++ b/src/modules/mgmt-api-client/api/api.ts @@ -8,12 +8,10 @@ export * from './contractDefinition.service'; import { ContractDefinitionService } from './contractDefinition.service'; export * from './contractNegotiation.service'; import { ContractNegotiationService } from './contractNegotiation.service'; -export * from './dataplaneSelector.service'; -import { DataplaneSelectorService } from './dataplaneSelector.service'; export * from './hTTPProvisionerWebhook.service'; import { HTTPProvisionerWebhookService } from './hTTPProvisionerWebhook.service'; export * from './policy.service'; import { PolicyService } from './policy.service'; export * from './transferProcess.service'; import { TransferProcessService } from './transferProcess.service'; -export const APIS = [ApplicationObservabilityService, AssetService, ContractAgreementService, ContractDefinitionService, ContractNegotiationService, DataplaneSelectorService, HTTPProvisionerWebhookService, PolicyService, TransferProcessService]; +export const APIS = [ApplicationObservabilityService, AssetService, ContractAgreementService, ContractDefinitionService, ContractNegotiationService, HTTPProvisionerWebhookService, PolicyService, TransferProcessService]; diff --git a/src/modules/mgmt-api-client/api/dataplaneSelector.service.ts b/src/modules/mgmt-api-client/api/dataplaneSelector.service.ts deleted file mode 100644 index a92368913..000000000 --- a/src/modules/mgmt-api-client/api/dataplaneSelector.service.ts +++ /dev/null @@ -1,277 +0,0 @@ -/** - * EDC REST API - * EDC REST APIs - merged by OpenApiMerger - * - * The version of the OpenAPI document: 0.0.1-SNAPSHOT - * - * - * 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, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { DataPlaneInstance } from '../model/dataPlaneInstance'; -// @ts-ignore -import { SelectionRequest } from '../model/selectionRequest'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; - - - -@Injectable({ - providedIn: 'root' -}) -export class DataplaneSelectorService { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - if (Array.isArray(basePath) && basePath.length > 0) { - basePath = basePath[0]; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substr(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param dataPlaneInstance - * @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 addEntry(dataPlaneInstance?: DataPlaneInstance, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; - public addEntry(dataPlaneInstance?: DataPlaneInstance, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public addEntry(dataPlaneInstance?: DataPlaneInstance, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public addEntry(dataPlaneInstance?: DataPlaneInstance, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - - // 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 = `/v2/dataplanes`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: dataPlaneInstance, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * @param selectionRequest - * @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 find(selectionRequest?: SelectionRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; - public find(selectionRequest?: SelectionRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public find(selectionRequest?: SelectionRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public find(selectionRequest?: SelectionRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - - // 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 = `/v2/dataplanes/select`; - return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: selectionRequest, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * @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 getAll(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public getAll(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public getAll(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public getAll(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - - 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 = `/v2/dataplanes`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - reportProgress: reportProgress - } - ); - } - -}