diff --git a/bin/configs/other/openapi3/typescript-angular-default.yaml b/bin/configs/other/openapi3/typescript-angular-default.yaml
index 7870bdd592e..0fefcc8f6f3 100644
--- a/bin/configs/other/openapi3/typescript-angular-default.yaml
+++ b/bin/configs/other/openapi3/typescript-angular-default.yaml
@@ -1,6 +1,6 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v2/default
+outputDir: samples/client/petstore/typescript-angular/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
- ngVersion: "2"
+ ngVersion: 13.3.2
diff --git a/bin/configs/other/openapi3/typescript-angular-npm.yaml b/bin/configs/other/openapi3/typescript-angular-npm.yaml
index 4234f40f8eb..4533bbcd6cb 100644
--- a/bin/configs/other/openapi3/typescript-angular-npm.yaml
+++ b/bin/configs/other/openapi3/typescript-angular-npm.yaml
@@ -1,10 +1,10 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v4.3/npm
+outputDir: samples/client/petstore/typescript-angular/npm
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
npmVersion: 0.0.1
- ngVersion: "4.3"
+ ngVersion: 13.3.2
npmName: '@openapitools/angular2-typescript-petstore'
npmRepository: https://skimdb.npmjs.com/registry
snapshot: false
diff --git a/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml
index 8b5ce23861b..2b860ba10b6 100644
--- a/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml
+++ b/bin/configs/other/openapi3/typescript-angular-with-interfaces.yaml
@@ -1,7 +1,7 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v2/with-interfaces
+outputDir: samples/client/petstore/typescript-angular/with-interfaces
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
withInterfaces: "true"
- ngVersion: "2"
+ ngVersion: 13.3.2
diff --git a/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml
deleted file mode 100644
index e94546bca67..00000000000
--- a/bin/configs/typescript-angular-v10-provided-in-root-with-npm.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/typescript-angular
-additionalProperties:
- ngVersion: 10.0.0
- npmVersion: 1.0.0
- npmName: '@openapitools/typescript-angular-petstore'
- npmRepository: https://skimdb.npmjs.com/registry
- snapshot: false
diff --git a/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml
deleted file mode 100644
index 7e3bcbbf3cb..00000000000
--- a/bin/configs/typescript-angular-v11-provided-in-root-with-npm.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/typescript-angular
-additionalProperties:
- ngVersion: 11.0.0
- npmVersion: 1.0.0
- npmName: '@openapitools/typescript-angular-petstore'
- npmRepository: https://skimdb.npmjs.com/registry
- snapshot: false
diff --git a/bin/configs/typescript-angular-v11-provided-in-root.yaml b/bin/configs/typescript-angular-v11-provided-in-root.yaml
deleted file mode 100644
index a25b4cbe326..00000000000
--- a/bin/configs/typescript-angular-v11-provided-in-root.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/typescript-angular
-additionalProperties:
- ngVersion: 11.0.0
diff --git a/bin/configs/typescript-angular-v11-oneOf.yaml b/bin/configs/typescript-angular-v12-oneOf.yaml
similarity index 73%
rename from bin/configs/typescript-angular-v11-oneOf.yaml
rename to bin/configs/typescript-angular-v12-oneOf.yaml
index e86a596865c..7d355b753cb 100644
--- a/bin/configs/typescript-angular-v11-oneOf.yaml
+++ b/bin/configs/typescript-angular-v12-oneOf.yaml
@@ -1,6 +1,6 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v11-oneOf/builds/default
+outputDir: samples/client/petstore/typescript-angular-v12-oneOf/builds/default
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
- ngVersion: 11.0.0
+ ngVersion: 12.2.0
diff --git a/bin/configs/typescript-angular-v9-provided-in-any.yaml b/bin/configs/typescript-angular-v12-provided-in-any.yaml
similarity index 67%
rename from bin/configs/typescript-angular-v9-provided-in-any.yaml
rename to bin/configs/typescript-angular-v12-provided-in-any.yaml
index 22bee99305f..3cc0d756b33 100644
--- a/bin/configs/typescript-angular-v9-provided-in-any.yaml
+++ b/bin/configs/typescript-angular-v12-provided-in-any.yaml
@@ -1,7 +1,7 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default
+outputDir: samples/client/petstore/typescript-angular-v12-provided-in-any/builds/default
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
- ngVersion: 9.0.0
+ ngVersion: 12.2.0
providedIn: any
diff --git a/bin/configs/typescript-angular-v13-oneOf.yaml b/bin/configs/typescript-angular-v13-oneOf.yaml
new file mode 100644
index 00000000000..7bc65fcbddc
--- /dev/null
+++ b/bin/configs/typescript-angular-v13-oneOf.yaml
@@ -0,0 +1,6 @@
+generatorName: typescript-angular
+outputDir: samples/client/petstore/typescript-angular-v13-oneOf/builds/default
+inputSpec: modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml
+templateDir: modules/openapi-generator/src/main/resources/typescript-angular
+additionalProperties:
+ ngVersion: 13.0.1
diff --git a/bin/configs/typescript-angular-v10-provided-in-root.yaml b/bin/configs/typescript-angular-v13-provided-in-any.yaml
similarity index 61%
rename from bin/configs/typescript-angular-v10-provided-in-root.yaml
rename to bin/configs/typescript-angular-v13-provided-in-any.yaml
index 65a195cb466..5cf16a7e0ea 100644
--- a/bin/configs/typescript-angular-v10-provided-in-root.yaml
+++ b/bin/configs/typescript-angular-v13-provided-in-any.yaml
@@ -1,6 +1,7 @@
generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default
+outputDir: samples/client/petstore/typescript-angular-v13-provided-in-any/builds/default
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
- ngVersion: 10.0.0
+ ngVersion: 13.0.1
+ providedIn: any
diff --git a/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml b/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml
deleted file mode 100644
index df3775b9dd9..00000000000
--- a/bin/configs/typescript-angular-v9-provided-in-root-with-npm.yaml
+++ /dev/null
@@ -1,10 +0,0 @@
-generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/typescript-angular
-additionalProperties:
- ngVersion: 9.0.0
- npmVersion: 1.0.0
- npmName: '@openapitools/typescript-angular-petstore'
- npmRepository: https://skimdb.npmjs.com/registry
- snapshot: false
diff --git a/bin/configs/typescript-angular-v9-provided-in-root.yaml b/bin/configs/typescript-angular-v9-provided-in-root.yaml
deleted file mode 100644
index f32176dc72d..00000000000
--- a/bin/configs/typescript-angular-v9-provided-in-root.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-generatorName: typescript-angular
-outputDir: samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
-templateDir: modules/openapi-generator/src/main/resources/typescript-angular
-additionalProperties:
- ngVersion: 9.0.0
diff --git a/pom.xml b/pom.xml
index f62d968ab6e..3ad05ef1fb3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1208,7 +1208,7 @@
samples/client/petstore/typescript-nestjs-v6-provided-in-root-->
- samples/client/petstore/typescript-angular-v11-provided-in-root
+ samples/client/petstore/typescript-angular-v12-provided-in-root
samples/client/petstore/typescript-angular-v13-provided-in-root
samples/openapi3/client/petstore/typescript/builds/default
samples/openapi3/client/petstore/typescript/tests/default
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts
deleted file mode 100644
index e7a21a8ff1f..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts
+++ /dev/null
@@ -1,672 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { ApiResponse } from '../model/apiResponse';
-// @ts-ignore
-import { Pet } from '../model/pet';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class PetService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
- /**
- * @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;
- }
-
- 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;
- }
-
- /**
- * Add a new pet to the store
- * @param body Pet object that needs to be added to the store
- * @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 addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling addPet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/json',
- 'application/xml'
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Deletes a pet
- * @param petId Pet id to delete
- * @param apiKey
- * @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 deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling deletePet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
- if (apiKey !== undefined && apiKey !== null) {
- localVarHeaders = localVarHeaders.set('api_key', String(apiKey));
- }
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * @param status Status values that need to be considered for filter
- * @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 findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (status === null || status === undefined) {
- throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
- }
-
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- if (status) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- status.join(COLLECTION_FORMATS['csv']), 'status');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`,
- {
- params: localVarQueryParameters,
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * @param tags Tags to filter by
- * @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.
- * @deprecated
- */
- public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (tags === null || tags === undefined) {
- throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
- }
-
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- if (tags) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- tags.join(COLLECTION_FORMATS['csv']), 'tags');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`,
- {
- params: localVarQueryParameters,
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * @param petId ID of pet to return
- * @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 getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling getPetById.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (api_key) required
- localVarCredential = this.configuration.lookupCredential('api_key');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('api_key', localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Update an existing pet
- * @param body Pet object that needs to be added to the store
- * @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 updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling updatePet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/json',
- 'application/xml'
- ];
- 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';
- }
- }
-
- return this.httpClient.put(`${this.configuration.basePath}/pet`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Updates a pet in the store with form data
- * @param petId ID of pet that needs to be updated
- * @param name Updated name of the pet
- * @param status Updated status of the pet
- * @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 updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/x-www-form-urlencoded'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (name !== undefined) {
- localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams;
- }
- if (status !== undefined) {
- localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams;
- }
-
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * uploads an image
- * @param petId ID of pet to update
- * @param additionalMetadata Additional data to pass to server
- * @param file file to upload
- * @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 uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- 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);
- }
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'multipart/form-data'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- // use FormData to transmit files using content-type "multipart/form-data"
- // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
- localVarUseForm = canConsumeForm;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (additionalMetadata !== undefined) {
- localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams;
- }
- if (file !== undefined) {
- localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams;
- }
-
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
- localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts
deleted file mode 100644
index 2a3277c5241..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts
+++ /dev/null
@@ -1,555 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { User } from '../model/user';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class UserService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
-
- 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;
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * @param body Created user object
- * @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 createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUser.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Creates list of users with given input array
- * @param body List of user object
- * @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 createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Creates list of users with given input array
- * @param body List of user object
- * @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 createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * @param username The name that needs to be deleted
- * @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 deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling deleteUser.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Get user by user name
- * @param username The name that needs to be fetched. Use user1 for testing.
- * @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 getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling getUserByName.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Logs user into the system
- * @param username The user name for login
- * @param password The password for login in clear text
- * @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 loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling loginUser.');
- }
- if (password === null || password === undefined) {
- throw new Error('Required parameter password was null or undefined when calling loginUser.');
- }
-
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- if (username !== undefined && username !== null) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- username, 'username');
- }
- if (password !== undefined && password !== null) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- password, 'password');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/user/login`,
- {
- params: localVarQueryParameters,
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Logs out current logged in user session
- * @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 logoutUser(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public logoutUser(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public logoutUser(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public logoutUser(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/user/logout`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Updated user
- * This can only be done by the logged in user.
- * @param username name that need to be deleted
- * @param body Updated user object
- * @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 updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling updateUser.');
- }
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling updateUser.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES
deleted file mode 100644
index 5db7bd76369..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES
+++ /dev/null
@@ -1,22 +0,0 @@
-.gitignore
-README.md
-api.module.ts
-api/api.ts
-api/pet.service.ts
-api/store.service.ts
-api/user.service.ts
-configuration.ts
-encoder.ts
-git_push.sh
-index.ts
-model/apiResponse.ts
-model/category.ts
-model/models.ts
-model/order.ts
-model/pet.ts
-model/tag.ts
-model/user.ts
-ng-package.json
-package.json
-tsconfig.json
-variables.ts
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md
deleted file mode 100644
index 000c51d694b..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/README.md
+++ /dev/null
@@ -1,203 +0,0 @@
-## @openapitools/typescript-angular-petstore@1.0.0
-
-### Building
-
-To install the required dependencies and to build the typescript sources run:
-```
-npm install
-npm run build
-```
-
-### publishing
-
-First build the package then run ```npm publish dist``` (don't forget to specify the `dist` folder!)
-
-### consuming
-
-Navigate to the folder of your consuming project and run one of next commands.
-
-_published:_
-
-```
-npm install @openapitools/typescript-angular-petstore@1.0.0 --save
-```
-
-_without publishing (not recommended):_
-
-```
-npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save
-```
-
-_It's important to take the tgz file, otherwise you'll get trouble with links on windows_
-
-_using `npm link`:_
-
-In PATH_TO_GENERATED_PACKAGE/dist:
-```
-npm link
-```
-
-In your project:
-```
-npm link @openapitools/typescript-angular-petstore
-```
-
-__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
-Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
-Published packages are not effected by this issue.
-
-
-#### General usage
-
-In your Angular project:
-
-
-```
-// without configuring providers
-import { ApiModule } from '@openapitools/typescript-angular-petstore';
-import { HttpClientModule } from '@angular/common/http';
-
-@NgModule({
- imports: [
- ApiModule,
- // make sure to import the HttpClientModule in the AppModule only,
- // see https://github.com/angular/angular/issues/20575
- HttpClientModule
- ],
- declarations: [ AppComponent ],
- providers: [],
- bootstrap: [ AppComponent ]
-})
-export class AppModule {}
-```
-
-```
-// configuring providers
-import { ApiModule, Configuration, ConfigurationParameters } from '@openapitools/typescript-angular-petstore';
-
-export function apiConfigFactory (): Configuration {
- const params: ConfigurationParameters = {
- // set configuration parameters here.
- }
- return new Configuration(params);
-}
-
-@NgModule({
- imports: [ ApiModule.forRoot(apiConfigFactory) ],
- declarations: [ AppComponent ],
- providers: [],
- bootstrap: [ AppComponent ]
-})
-export class AppModule {}
-```
-
-```
-// configuring providers with an authentication service that manages your access tokens
-import { ApiModule, Configuration } from '@openapitools/typescript-angular-petstore';
-
-@NgModule({
- imports: [ ApiModule ],
- declarations: [ AppComponent ],
- providers: [
- {
- provide: Configuration,
- useFactory: (authService: AuthService) => new Configuration(
- {
- basePath: environment.apiUrl,
- accessToken: authService.getAccessToken.bind(authService)
- }
- ),
- deps: [AuthService],
- multi: false
- }
- ],
- bootstrap: [ AppComponent ]
-})
-export class AppModule {}
-```
-
-```
-import { DefaultApi } from '@openapitools/typescript-angular-petstore';
-
-export class AppComponent {
- constructor(private apiGateway: DefaultApi) { }
-}
-```
-
-Note: The ApiModule is restricted to being instantiated once app wide.
-This is to ensure that all services are treated as singletons.
-
-#### Using multiple OpenAPI files / APIs / ApiModules
-In order to use multiple `ApiModules` generated from different OpenAPI files,
-you can create an alias name when importing the modules
-in order to avoid naming conflicts:
-```
-import { ApiModule } from 'my-api-path';
-import { ApiModule as OtherApiModule } from 'my-other-api-path';
-import { HttpClientModule } from '@angular/common/http';
-
-@NgModule({
- imports: [
- ApiModule,
- OtherApiModule,
- // make sure to import the HttpClientModule in the AppModule only,
- // see https://github.com/angular/angular/issues/20575
- HttpClientModule
- ]
-})
-export class AppModule {
-
-}
-```
-
-
-### Set service base path
-If different than the generated base path, during app bootstrap, you can provide the base path to your service.
-
-```
-import { BASE_PATH } from '@openapitools/typescript-angular-petstore';
-
-bootstrap(AppComponent, [
- { provide: BASE_PATH, useValue: 'https://your-web-service.com' },
-]);
-```
-or
-
-```
-import { BASE_PATH } from '@openapitools/typescript-angular-petstore';
-
-@NgModule({
- imports: [],
- declarations: [ AppComponent ],
- providers: [ provide: BASE_PATH, useValue: 'https://your-web-service.com' ],
- bootstrap: [ AppComponent ]
-})
-export class AppModule {}
-```
-
-
-#### Using @angular/cli
-First extend your `src/environments/*.ts` files by adding the corresponding base path:
-
-```
-export const environment = {
- production: false,
- API_BASE_PATH: 'http://127.0.0.1:8080'
-};
-```
-
-In the src/app/app.module.ts:
-```
-import { BASE_PATH } from '@openapitools/typescript-angular-petstore';
-import { environment } from '../environments/environment';
-
-@NgModule({
- declarations: [
- AppComponent
- ],
- imports: [ ],
- providers: [{ provide: BASE_PATH, useValue: environment.API_BASE_PATH }],
- bootstrap: [ AppComponent ]
-})
-export class AppModule { }
-```
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts
deleted file mode 100644
index e7a21a8ff1f..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts
+++ /dev/null
@@ -1,672 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { ApiResponse } from '../model/apiResponse';
-// @ts-ignore
-import { Pet } from '../model/pet';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class PetService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
- /**
- * @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;
- }
-
- 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;
- }
-
- /**
- * Add a new pet to the store
- * @param body Pet object that needs to be added to the store
- * @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 addPet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public addPet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public addPet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling addPet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/json',
- 'application/xml'
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Deletes a pet
- * @param petId Pet id to delete
- * @param apiKey
- * @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 deletePet(petId: number, apiKey?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling deletePet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
- if (apiKey !== undefined && apiKey !== null) {
- localVarHeaders = localVarHeaders.set('api_key', String(apiKey));
- }
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- * @param status Status values that need to be considered for filter
- * @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 findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (status === null || status === undefined) {
- throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
- }
-
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- if (status) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- status.join(COLLECTION_FORMATS['csv']), 'status');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`,
- {
- params: localVarQueryParameters,
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- * @param tags Tags to filter by
- * @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.
- * @deprecated
- */
- public findPetsByTags(tags: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>>;
- public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (tags === null || tags === undefined) {
- throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
- }
-
- let localVarQueryParameters = new HttpParams({encoder: this.encoder});
- if (tags) {
- localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
- tags.join(COLLECTION_FORMATS['csv']), 'tags');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`,
- {
- params: localVarQueryParameters,
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Find pet by ID
- * Returns a single pet
- * @param petId ID of pet to return
- * @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 getPetById(petId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getPetById(petId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getPetById(petId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling getPetById.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (api_key) required
- localVarCredential = this.configuration.lookupCredential('api_key');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('api_key', localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Update an existing pet
- * @param body Pet object that needs to be added to the store
- * @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 updatePet(body: Pet, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling updatePet.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/json',
- 'application/xml'
- ];
- 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';
- }
- }
-
- return this.httpClient.put(`${this.configuration.basePath}/pet`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Updates a pet in the store with form data
- * @param petId ID of pet that needs to be updated
- * @param name Updated name of the pet
- * @param status Updated status of the pet
- * @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 updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'application/x-www-form-urlencoded'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (name !== undefined) {
- localVarFormParams = localVarFormParams.append('name', name) as any || localVarFormParams;
- }
- if (status !== undefined) {
- localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams;
- }
-
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`,
- localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * uploads an image
- * @param petId ID of pet to update
- * @param additionalMetadata Additional data to pass to server
- * @param file file to upload
- * @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 uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable {
- if (petId === null || petId === undefined) {
- throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (petstore_auth) required
- localVarCredential = this.configuration.lookupCredential('petstore_auth');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential);
- }
-
- 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);
- }
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- 'multipart/form-data'
- ];
-
- const canConsumeForm = this.canConsumeForm(consumes);
-
- let localVarFormParams: { append(param: string, value: any): any; };
- let localVarUseForm = false;
- let localVarConvertFormParamsToString = false;
- // use FormData to transmit files using content-type "multipart/form-data"
- // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
- localVarUseForm = canConsumeForm;
- if (localVarUseForm) {
- localVarFormParams = new FormData();
- } else {
- localVarFormParams = new HttpParams({encoder: this.encoder});
- }
-
- if (additionalMetadata !== undefined) {
- localVarFormParams = localVarFormParams.append('additionalMetadata', additionalMetadata) as any || localVarFormParams;
- }
- if (file !== undefined) {
- localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams;
- }
-
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`,
- localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts
deleted file mode 100644
index 942714e216e..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { Order } from '../model/order';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class StoreService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
-
- 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;
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * @param orderId ID of the order that needs to be deleted
- * @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 deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (orderId === null || orderId === undefined) {
- throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * @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 getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>;
- public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable {
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (api_key) required
- localVarCredential = this.configuration.lookupCredential('api_key');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('api_key', localVarCredential);
- }
-
- 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 responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- * @param orderId ID of pet that needs to be fetched
- * @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 getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (orderId === null || orderId === undefined) {
- throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Place an order for a pet
- * @param body order placed for purchasing the pet
- * @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 placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling placeOrder.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/store/order`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json
deleted file mode 100644
index 3b17900dc9c..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/ng-package.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$schema": "./node_modules/ng-packagr/ng-package.schema.json",
- "lib": {
- "entryFile": "index.ts"
- }
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json
deleted file mode 100644
index 609606d8f08..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "@openapitools/typescript-angular-petstore",
- "version": "1.0.0",
- "description": "OpenAPI client for @openapitools/typescript-angular-petstore",
- "author": "OpenAPI-Generator Contributors",
- "repository": {
- "type": "git",
- "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
- },
- "keywords": [
- "openapi-client",
- "openapi-generator"
- ],
- "license": "Unlicense",
- "scripts": {
- "build": "ng-packagr -p ng-package.json"
- },
- "peerDependencies": {
- "@angular/core": "^10.0.0",
- "rxjs": "^6.6.0"
- },
- "devDependencies": {
- "@angular/common": "^10.0.0",
- "@angular/compiler": "^10.0.0",
- "@angular/compiler-cli": "^10.0.0",
- "@angular/core": "^10.0.0",
- "@angular/platform-browser": "^10.0.0",
- "ng-packagr": "^10.0.3",
- "reflect-metadata": "^0.1.3",
- "rxjs": "^6.6.0",
- "tsickle": "^0.39.1",
- "typescript": ">=3.9.2 <4.0.0",
- "zone.js": "^0.10.2"
- },
- "publishConfig": {
- "registry": "https://skimdb.npmjs.com/registry"
- }
-}
diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json
deleted file mode 100644
index c01ebe255d4..00000000000
--- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/tsconfig.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "compilerOptions": {
- "emitDecoratorMetadata": true,
- "experimentalDecorators": true,
- "noImplicitAny": false,
- "suppressImplicitAnyIndexErrors": true,
- "target": "es5",
- "module": "commonjs",
- "moduleResolution": "node",
- "removeComments": true,
- "sourceMap": true,
- "outDir": "./dist",
- "noLib": false,
- "declaration": true,
- "lib": [ "es6", "dom" ],
- "typeRoots": [
- "node_modules/@types"
- ]
- },
- "exclude": [
- "node_modules",
- "dist"
- ],
- "filesGlob": [
- "./model/*.ts",
- "./api/*.ts"
- ]
-}
diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api.module.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api.module.ts
deleted file mode 100644
index 2afb8f64e92..00000000000
--- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api.module.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
-import { Configuration } from './configuration';
-import { HttpClient } from '@angular/common/http';
-
-import { PetService } from './api/pet.service';
-import { StoreService } from './api/store.service';
-import { UserService } from './api/user.service';
-
-@NgModule({
- imports: [],
- declarations: [],
- exports: [],
- providers: []
-})
-export class ApiModule {
- public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders {
- return {
- ngModule: ApiModule,
- providers: [ { provide: Configuration, useFactory: configurationFactory } ]
- };
- }
-
- constructor( @Optional() @SkipSelf() parentModule: ApiModule,
- @Optional() http: HttpClient) {
- if (parentModule) {
- throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
- }
- if (!http) {
- throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
- 'See also https://github.com/angular/angular/issues/20575');
- }
- }
-}
diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/api.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/api.ts
deleted file mode 100644
index 8e44b64083d..00000000000
--- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/api.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-export * from './pet.service';
-import { PetService } from './pet.service';
-export * from './store.service';
-import { StoreService } from './store.service';
-export * from './user.service';
-import { UserService } from './user.service';
-export const APIS = [PetService, StoreService, UserService];
diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts
deleted file mode 100644
index 942714e216e..00000000000
--- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { Order } from '../model/order';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class StoreService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
-
- 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;
- }
-
- /**
- * Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- * @param orderId ID of the order that needs to be deleted
- * @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 deleteOrder(orderId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (orderId === null || orderId === undefined) {
- throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Returns pet inventories by status
- * Returns a map of status codes to quantities
- * @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 getInventory(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable<{ [key: string]: number; }>;
- public getInventory(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public getInventory(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json',}): Observable>;
- public getInventory(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json',}): Observable {
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarCredential: string | undefined;
- // authentication (api_key) required
- localVarCredential = this.configuration.lookupCredential('api_key');
- if (localVarCredential) {
- localVarHeaders = localVarHeaders.set('api_key', localVarCredential);
- }
-
- 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 responseType_: 'text' | 'json' | 'blob' = 'json';
- if (localVarHttpHeaderAcceptSelected) {
- if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
- responseType_ = 'text';
- } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
- responseType_ = 'json';
- } else {
- responseType_ = 'blob';
- }
- }
-
- return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- * @param orderId ID of pet that needs to be fetched
- * @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 getOrderById(orderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (orderId === null || orderId === undefined) {
- throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Place an order for a pet
- * @param body order placed for purchasing the pet
- * @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 placeOrder(body: Order, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling placeOrder.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/store/order`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
-}
diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts
deleted file mode 100644
index 2a3277c5241..00000000000
--- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts
+++ /dev/null
@@ -1,555 +0,0 @@
-/**
- * OpenAPI Petstore
- * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
- *
- * The version of the OpenAPI document: 1.0.0
- *
- *
- * 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
- } from '@angular/common/http';
-import { CustomHttpParameterCodec } from '../encoder';
-import { Observable } from 'rxjs';
-
-// @ts-ignore
-import { User } from '../model/user';
-
-// @ts-ignore
-import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
-import { Configuration } from '../configuration';
-
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class UserService {
-
- protected basePath = 'http://petstore.swagger.io/v2';
- public defaultHeaders = new HttpHeaders();
- public configuration = new Configuration();
- public encoder: HttpParameterCodec;
-
- constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
- if (configuration) {
- this.configuration = configuration;
- }
- if (typeof this.configuration.basePath !== 'string') {
- if (typeof basePath !== 'string') {
- basePath = this.basePath;
- }
- this.configuration.basePath = basePath;
- }
- this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
- }
-
-
- 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;
- }
-
- /**
- * Create user
- * This can only be done by the logged in user.
- * @param body Created user object
- * @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 createUser(body: User, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUser(body: User, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUser(body: User, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUser(body: User, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUser.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Creates list of users with given input array
- * @param body List of user object
- * @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 createUsersWithArrayInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Creates list of users with given input array
- * @param body List of user object
- * @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 createUsersWithListInput(body: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- // to determine the Content-Type header
- const consumes: string[] = [
- ];
- 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';
- }
- }
-
- return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`,
- body,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Delete user
- * This can only be done by the logged in user.
- * @param username The name that needs to be deleted
- * @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 deleteUser(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable;
- public deleteUser(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteUser(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>;
- public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling deleteUser.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Get user by user name
- * @param username The name that needs to be fetched. Use user1 for testing.
- * @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 getUserByName(username: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public getUserByName(username: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getUserByName(username: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable>;
- public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable {
- if (username === null || username === undefined) {
- throw new Error('Required parameter username was null or undefined when calling getUserByName.');
- }
-
- let localVarHeaders = this.defaultHeaders;
-
- let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
- if (localVarHttpHeaderAcceptSelected === undefined) {
- // to determine the Accept header
- const httpHeaderAccepts: string[] = [
- 'application/xml',
- 'application/json'
- ];
- localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
- }
- if (localVarHttpHeaderAcceptSelected !== undefined) {
- localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
- }
-
-
-
- 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';
- }
- }
-
- return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`,
- {
- responseType: responseType_,
- withCredentials: this.configuration.withCredentials,
- headers: localVarHeaders,
- observe: observe,
- reportProgress: reportProgress
- }
- );
- }
-
- /**
- * Logs user into the system
- * @param username The user name for login
- * @param password The password for login in clear text
- * @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 loginUser(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable;
- public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/xml' | 'application/json',}): Observable