forked from loafle/openapi-generator-original
replace tab with spaces, minor code format change (#8775)
This commit is contained in:
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '{{npmName}}';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## {{npmName}}@{{npmVersion}}
|
||||
modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache {{npmName}}@{{npmVersion}}
|
||||
|
||||
### Building
|
||||
|
||||
@@ -52,7 +52,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '{{npmName}}';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -134,4 +134,4 @@ import { environment } from '../environments/environment';
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
```
|
||||
```
|
||||
|
||||
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
}
|
||||
|
||||
{{#servers}}
|
||||
|
||||
@@ -26,8 +26,8 @@ import { {{classname}} } from '..{{filename}}{{extensionForDeno}}';
|
||||
@injectable()
|
||||
{{/useInversify}}
|
||||
export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
{{#operation}}
|
||||
|
||||
{{#operation}}
|
||||
/**
|
||||
{{#notes}}
|
||||
* {{¬es}}
|
||||
@@ -40,44 +40,44 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
{{/allParams}}
|
||||
*/
|
||||
public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
{{#allParams}}
|
||||
|
||||
{{#required}}
|
||||
let config = options || this.configuration;
|
||||
{{#allParams}}
|
||||
|
||||
{{#required}}
|
||||
// verify required parameter '{{paramName}}' is not null or undefined
|
||||
if ({{paramName}} === null || {{paramName}} === undefined) {
|
||||
throw new RequiredError('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.');
|
||||
}
|
||||
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '{{{path}}}'{{#pathParams}}
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '{{{path}}}'{{#pathParams}}
|
||||
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
{{#queryParams}}
|
||||
{{#queryParams}}
|
||||
if ({{paramName}} !== undefined) {
|
||||
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
|
||||
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
|
||||
}
|
||||
{{/queryParams}}
|
||||
|
||||
// Header Params
|
||||
{{#headerParams}}
|
||||
requestContext.setHeaderParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
|
||||
{{/headerParams}}
|
||||
|
||||
// Form Params
|
||||
{{#hasFormParams}}
|
||||
let localVarFormParams = new FormData();
|
||||
{{/hasFormParams}}
|
||||
{{/queryParams}}
|
||||
|
||||
{{#formParams}}
|
||||
// Header Params
|
||||
{{#headerParams}}
|
||||
requestContext.setHeaderParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
|
||||
{{/headerParams}}
|
||||
|
||||
// Form Params
|
||||
{{#hasFormParams}}
|
||||
let localVarFormParams = new FormData();
|
||||
{{/hasFormParams}}
|
||||
|
||||
{{#formParams}}
|
||||
{{#isArray}}
|
||||
if ({{paramName}}) {
|
||||
{{#isCollectionFormatMulti}}
|
||||
@@ -86,14 +86,14 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
})
|
||||
{{/isCollectionFormatMulti}}
|
||||
{{^isCollectionFormatMulti}}
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
|
||||
{{/isCollectionFormatMulti}}
|
||||
}
|
||||
{{/isArray}}
|
||||
{{^isArray}}
|
||||
if ({{paramName}} !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
{{^isFile}}
|
||||
localVarFormParams.append('{{baseName}}', {{paramName}} as any);
|
||||
{{/isFile}}
|
||||
@@ -109,13 +109,13 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
{{/isFile}}
|
||||
}
|
||||
{{/isArray}}
|
||||
{{/formParams}}
|
||||
{{#hasFormParams}}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
{{/hasFormParams}}
|
||||
{{/formParams}}
|
||||
{{#hasFormParams}}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
{{/hasFormParams}}
|
||||
|
||||
// Body Params
|
||||
{{#bodyParam}}
|
||||
// Body Params
|
||||
{{#bodyParam}}
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([{{#consumes}}
|
||||
"{{{mediaType}}}"{{^-last}},{{/-last}}
|
||||
{{/consumes}}]);
|
||||
@@ -125,7 +125,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
contentType
|
||||
);
|
||||
requestContext.setBody(serializedBody);
|
||||
{{/bodyParam}}
|
||||
{{/bodyParam}}
|
||||
|
||||
{{#hasAuthMethods}}
|
||||
let authMethod = null;
|
||||
@@ -144,8 +144,6 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
{{/operation}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
||||
|
||||
{{#operations}}
|
||||
|
||||
{{#useInversify}}
|
||||
@@ -213,9 +211,9 @@ export class {{classname}}ResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
|
||||
{{/operation}}
|
||||
}
|
||||
{{/operations}}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'./rx
|
||||
*
|
||||
*/
|
||||
export interface Middleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Observable<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
||||
*
|
||||
*/
|
||||
export interface PromiseMiddleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Promise<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
|
||||
* @returns an observable of the modified response context
|
||||
*/
|
||||
post(context: ResponseContext): Promise<ResponseContext>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,11 @@ export type HttpFile = {{{fileContentDataType}}} & { readonly name: string };
|
||||
*/
|
||||
class URLParse {
|
||||
private url: URL;
|
||||
|
||||
constructor(address: string, _parser: boolean) {
|
||||
this.url = new URL(address);
|
||||
}
|
||||
|
||||
public set(_part: 'query', obj: {[key: string]: string | undefined}) {
|
||||
for (const key in obj) {
|
||||
const value = obj[key];
|
||||
@@ -76,6 +78,7 @@ class URLParse {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public get query() {
|
||||
const obj: {[key: string]: string} = {};
|
||||
for (const [key, value] of this.url.searchParams.entries()) {
|
||||
@@ -83,6 +86,7 @@ class URLParse {
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public toString() {
|
||||
return this.url.toString();
|
||||
}
|
||||
@@ -109,24 +113,24 @@ export class RequestContext {
|
||||
private body: RequestBody = undefined;
|
||||
private url: URLParse;
|
||||
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
public constructor(url: string, private httpMethod: HttpMethod) {
|
||||
this.url = new URLParse(url, true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the url set in the constructor including the query string
|
||||
*
|
||||
*/
|
||||
public getUrl(): string {
|
||||
return this.url.toString();
|
||||
return this.url.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the url set in the constructor with this url.
|
||||
*
|
||||
@@ -149,27 +153,27 @@ export class RequestContext {
|
||||
}
|
||||
|
||||
public getHttpMethod(): HttpMethod {
|
||||
return this.httpMethod;
|
||||
return this.httpMethod;
|
||||
}
|
||||
|
||||
|
||||
public getHeaders(): { [key: string]: string } {
|
||||
return this.headers;
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
public getBody(): RequestBody {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public setQueryParam(name: string, value: string) {
|
||||
public setQueryParam(name: string, value: string) {
|
||||
let queryObj = this.url.query;
|
||||
queryObj[name] = value;
|
||||
this.url.set("query", queryObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
public addCookie(name: string, value: string): void {
|
||||
if (!this.headers["Cookie"]) {
|
||||
this.headers["Cookie"] = "";
|
||||
@@ -187,7 +191,6 @@ export interface ResponseBody {
|
||||
binary(): Promise<{{{fileContentDataType}}}>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to generate a `ResponseBody` from binary data
|
||||
*/
|
||||
@@ -299,4 +302,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
||||
return from(promiseHttpLibrary.send(request));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,13 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
data: body
|
||||
};
|
||||
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
requestOptions["xhrFields"] = { responseType: 'blob' };
|
||||
requestOptions["converters"] = {}
|
||||
requestOptions["converters"]["* blob"] = (result:any) => result;
|
||||
requestOptions["dataType"] = "blob";
|
||||
|
||||
|
||||
if (request.getHeaders()['Content-Type']) {
|
||||
requestOptions.contentType = headerParams['Content-Type'];
|
||||
}
|
||||
@@ -41,7 +40,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
}
|
||||
}
|
||||
})(headerParams);
|
||||
|
||||
|
||||
if (request.getHeaders()["Cookie"]) {
|
||||
throw new HttpException("Setting the \"Cookie\"-Header field is blocked by every major browser when using jquery.ajax requests. Please switch to another library like fetch to enable this option");
|
||||
}
|
||||
@@ -49,9 +48,9 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
if (body && body.constructor.name == "FormData") {
|
||||
requestOptions.contentType = false;
|
||||
}
|
||||
|
||||
|
||||
const sentRequest = $.ajax(requestOptions);
|
||||
|
||||
|
||||
const resultPromise = new Promise<ResponseContext>((resolve, reject) => {
|
||||
sentRequest.done((data, _, jqXHR) => {
|
||||
const result = new ResponseContext(
|
||||
@@ -65,7 +64,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
const headers = this.getResponseHeaders(jqXHR)
|
||||
const result = new ResponseContext(jqXHR.status, headers, jqXHR.responseText);
|
||||
resolve(result);
|
||||
})
|
||||
})
|
||||
})
|
||||
return from(resultPromise);
|
||||
}
|
||||
@@ -79,7 +78,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
var key = header.shift();
|
||||
if (key.length == 0) return
|
||||
// chrome60+ force lowercase, other browsers can be different
|
||||
key = key.toLowerCase();
|
||||
key = key.toLowerCase();
|
||||
responseHeaders[key] = header.join(": ");
|
||||
});
|
||||
return responseHeaders
|
||||
|
||||
@@ -22,30 +22,30 @@ export class ServerConfiguration<T extends { [key: string]: string }> implements
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
{{#servers}}
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
{{/useInversify}}
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist",
|
||||
"node_modules"
|
||||
],
|
||||
"filesGlob": [
|
||||
"./**/*.ts",
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,12 @@ export interface {{classname}}{{operationIdCamelCase}}Request {
|
||||
}
|
||||
|
||||
{{/operation}}
|
||||
|
||||
export class Object{{classname}} {
|
||||
private api: Observable{{classname}}
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: {{classname}}RequestFactory, responseProcessor?: {{classname}}ResponseProcessor) {
|
||||
this.api = new Observable{{classname}}(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
{{#operation}}
|
||||
/**
|
||||
@@ -51,13 +50,9 @@ export class Object{{classname}} {
|
||||
public {{nickname}}(param: {{classname}}{{operationIdCamelCase}}Request, options?: Configuration): {{#useRxJS}}Observable{{/useRxJS}}{{^useRxJS}}Promise{{/useRxJS}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
return this.api.{{nickname}}({{#allParams}}param.{{paramName}}, {{/allParams}} options){{^useRxJS}}.toPromise(){{/useRxJS}};
|
||||
}
|
||||
|
||||
|
||||
{{/operation}}
|
||||
|
||||
}
|
||||
|
||||
{{/operations}}
|
||||
|
||||
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
{{/apiInfo}}
|
||||
|
||||
@@ -7,7 +7,6 @@ import {mergeMap, map} from {{#useRxJS}}'rxjs/operators'{{/useRxJS}}{{^useRxJS}
|
||||
import { injectable, inject, optional } from "inversify";
|
||||
import { AbstractConfiguration } from "../services/configuration{{extensionForDeno}}";
|
||||
{{/useInversify}}
|
||||
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
import { {{{ classname }}} } from '../models/{{{ classFilename }}}{{extensionForDeno}}';
|
||||
@@ -64,30 +63,26 @@ export class Observable{{classname}} {
|
||||
{{/allParams}}
|
||||
*/
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
const requestContextPromise = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
||||
const requestContextPromise = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.{{nickname}}(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.{{nickname}}(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
{{/operation}}
|
||||
|
||||
}
|
||||
|
||||
{{/operations}}
|
||||
|
||||
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
{{/apiInfo}}
|
||||
|
||||
@@ -15,7 +15,6 @@ import { {{{ classname }}} } from '../models/{{{ classFilename }}}{{extensionFor
|
||||
{{#apis}}
|
||||
import { Observable{{classname}} } from './ObservableAPI{{extensionForDeno}}';
|
||||
|
||||
|
||||
{{#operations}}
|
||||
import { {{classname}}RequestFactory, {{classname}}ResponseProcessor} from "../apis/{{classname}}{{extensionForDeno}}";
|
||||
{{#useInversify}}
|
||||
@@ -54,10 +53,10 @@ export class Promise{{classname}} {
|
||||
{{/allParams}}
|
||||
*/
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
||||
const result = this.api.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
{{/operation}}
|
||||
|
||||
}
|
||||
@@ -66,4 +65,4 @@ export class Promise{{classname}} {
|
||||
|
||||
|
||||
{{/apis}}
|
||||
{{/apiInfo}}
|
||||
{{/apiInfo}}
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
* @param code the http status code to be checked against the code range
|
||||
*/
|
||||
export function isCodeInRange(codeRange: string, code: number): boolean {
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/angular2-typescript-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-angular-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -62,8 +62,8 @@ export class BaseAPI {
|
||||
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||
}
|
||||
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
const init = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## @openapitools/typescript-nestjs-petstore@1.0.0
|
||||
modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache @openapitools/typescript-nestjs-petstore@1.0.0
|
||||
|
||||
### Building
|
||||
|
||||
@@ -52,7 +52,7 @@ export class AppModule {}
|
||||
import { DefaultApi } from '@openapitools/typescript-nestjs-petstore';
|
||||
|
||||
export class AppComponent {
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
constructor(private apiGateway: DefaultApi) { }
|
||||
}
|
||||
```
|
||||
|
||||
@@ -134,4 +134,4 @@ import { environment } from '../environments/environment';
|
||||
]
|
||||
})
|
||||
export class AppModule { }
|
||||
```
|
||||
```
|
||||
|
||||
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
}
|
||||
|
||||
const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "")
|
||||
|
||||
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
}
|
||||
|
||||
const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "")
|
||||
|
||||
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
}
|
||||
|
||||
const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "")
|
||||
|
||||
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
public getDescription(): string {
|
||||
return this.description
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
/**
|
||||
* Constructions the URL this server using the url with variables
|
||||
* replaced with their respective values
|
||||
*/
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
}
|
||||
|
||||
const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { }, "")
|
||||
|
||||
@@ -14,35 +14,35 @@ import { Pet } from '../models/Pet';
|
||||
* no description
|
||||
*/
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -71,32 +71,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -114,32 +114,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (status !== undefined) {
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -157,32 +157,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (tags !== undefined) {
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -200,30 +200,30 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -240,29 +240,29 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -292,42 +292,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (name !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('status', status as any);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -346,42 +346,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -395,8 +395,6 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class PetApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -429,9 +427,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -451,9 +449,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -484,9 +482,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -517,9 +515,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -553,9 +551,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -592,9 +590,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -614,9 +612,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -644,7 +642,7 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,37 +13,37 @@ import { Order } from '../models/Order';
|
||||
* no description
|
||||
*/
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -55,23 +55,23 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -89,30 +89,30 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -124,29 +124,29 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -164,8 +164,6 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class StoreApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -190,9 +188,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -220,9 +218,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -256,9 +254,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -289,7 +287,7 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,36 +13,36 @@ import { User } from '../models/User';
|
||||
* no description
|
||||
*/
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param user Created user object
|
||||
*/
|
||||
public async createUser(user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -68,29 +68,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -116,29 +116,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -165,30 +165,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -205,30 +205,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -241,41 +241,41 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser(username: string, password: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (username !== undefined) {
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
}
|
||||
if (password !== undefined) {
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -286,23 +286,23 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -321,36 +321,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public async updateUser(username: string, user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -373,8 +373,6 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -396,9 +394,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -418,9 +416,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -440,9 +438,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -465,9 +463,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -501,9 +499,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -534,9 +532,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -556,9 +554,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -581,7 +579,7 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,24 +50,24 @@ export class RequestContext {
|
||||
private body: RequestBody = undefined;
|
||||
private url: URLParse;
|
||||
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
public constructor(url: string, private httpMethod: HttpMethod) {
|
||||
this.url = new URLParse(url, true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the url set in the constructor including the query string
|
||||
*
|
||||
*/
|
||||
public getUrl(): string {
|
||||
return this.url.toString();
|
||||
return this.url.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the url set in the constructor with this url.
|
||||
*
|
||||
@@ -90,27 +90,27 @@ export class RequestContext {
|
||||
}
|
||||
|
||||
public getHttpMethod(): HttpMethod {
|
||||
return this.httpMethod;
|
||||
return this.httpMethod;
|
||||
}
|
||||
|
||||
|
||||
public getHeaders(): { [key: string]: string } {
|
||||
return this.headers;
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
public getBody(): RequestBody {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public setQueryParam(name: string, value: string) {
|
||||
public setQueryParam(name: string, value: string) {
|
||||
let queryObj = this.url.query;
|
||||
queryObj[name] = value;
|
||||
this.url.set("query", queryObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
public addCookie(name: string, value: string): void {
|
||||
if (!this.headers["Cookie"]) {
|
||||
this.headers["Cookie"] = "";
|
||||
@@ -128,7 +128,6 @@ export interface ResponseBody {
|
||||
binary(): Promise<Buffer>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to generate a `ResponseBody` from binary data
|
||||
*/
|
||||
@@ -203,4 +202,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
||||
return from(promiseHttpLibrary.send(request));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Observable, from } from './rxjsStub';
|
||||
*
|
||||
*/
|
||||
export interface Middleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Observable<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
||||
*
|
||||
*/
|
||||
export interface PromiseMiddleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Promise<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
|
||||
* @returns an observable of the modified response context
|
||||
*/
|
||||
post(context: ResponseContext): Promise<ResponseContext>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,30 +22,30 @@ export class ServerConfiguration<T extends { [key: string]: string }> implements
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { })
|
||||
|
||||
@@ -20,11 +20,10 @@
|
||||
"lib": [ "es6" ],
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist",
|
||||
"node_modules"
|
||||
],
|
||||
"filesGlob": [
|
||||
"./**/*.ts",
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,13 +114,12 @@ export interface PetApiUploadFileRequest {
|
||||
file?: HttpFile
|
||||
}
|
||||
|
||||
|
||||
export class ObjectPetApi {
|
||||
private api: ObservablePetApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: PetApiRequestFactory, responseProcessor?: PetApiResponseProcessor) {
|
||||
this.api = new ObservablePetApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
@@ -129,7 +128,7 @@ export class ObjectPetApi {
|
||||
public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.addPet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param param the request object
|
||||
@@ -137,7 +136,7 @@ export class ObjectPetApi {
|
||||
public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deletePet(param.petId, param.apiKey, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
@@ -146,7 +145,7 @@ export class ObjectPetApi {
|
||||
public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByStatus(param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
@@ -155,7 +154,7 @@ export class ObjectPetApi {
|
||||
public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByTags(param.tags, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
@@ -164,7 +163,7 @@ export class ObjectPetApi {
|
||||
public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.getPetById(param.petId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param param the request object
|
||||
@@ -172,7 +171,7 @@ export class ObjectPetApi {
|
||||
public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.updatePet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param param the request object
|
||||
@@ -180,7 +179,7 @@ export class ObjectPetApi {
|
||||
public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param param the request object
|
||||
@@ -188,13 +187,9 @@ export class ObjectPetApi {
|
||||
public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise<ApiResponse> {
|
||||
return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableStoreApi } from "./ObservableAPI";
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
|
||||
@@ -228,13 +223,12 @@ export interface StoreApiPlaceOrderRequest {
|
||||
order: Order
|
||||
}
|
||||
|
||||
|
||||
export class ObjectStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: StoreApiRequestFactory, responseProcessor?: StoreApiResponseProcessor) {
|
||||
this.api = new ObservableStoreApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@@ -244,7 +238,7 @@ export class ObjectStoreApi {
|
||||
public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteOrder(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
@@ -253,7 +247,7 @@ export class ObjectStoreApi {
|
||||
public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
return this.api.getInventory( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
@@ -262,7 +256,7 @@ export class ObjectStoreApi {
|
||||
public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.getOrderById(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param param the request object
|
||||
@@ -270,13 +264,9 @@ export class ObjectStoreApi {
|
||||
public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.placeOrder(param.order, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableUserApi } from "./ObservableAPI";
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
|
||||
@@ -358,13 +348,12 @@ export interface UserApiUpdateUserRequest {
|
||||
user: User
|
||||
}
|
||||
|
||||
|
||||
export class ObjectUserApi {
|
||||
private api: ObservableUserApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: UserApiRequestFactory, responseProcessor?: UserApiResponseProcessor) {
|
||||
this.api = new ObservableUserApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
@@ -374,7 +363,7 @@ export class ObjectUserApi {
|
||||
public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUser(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -382,7 +371,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithArrayInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -390,7 +379,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithListInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
@@ -399,7 +388,7 @@ export class ObjectUserApi {
|
||||
public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteUser(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param param the request object
|
||||
@@ -407,7 +396,7 @@ export class ObjectUserApi {
|
||||
public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise<User> {
|
||||
return this.api.getUserByName(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param param the request object
|
||||
@@ -415,7 +404,7 @@ export class ObjectUserApi {
|
||||
public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise<string> {
|
||||
return this.api.loginUser(param.username, param.password, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
* @param param the request object
|
||||
@@ -423,7 +412,7 @@ export class ObjectUserApi {
|
||||
public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.logoutUser( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -432,9 +421,5 @@ export class ObjectUserApi {
|
||||
public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updateUser(param.username, param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as models from '../models/all';
|
||||
import { Configuration} from '../configuration'
|
||||
import { Observable, of, from } from '../rxjsStub';
|
||||
import {mergeMap, map} from '../rxjsStub';
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { Order } from '../models/Order';
|
||||
@@ -32,143 +31,143 @@ export class ObservablePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -176,24 +175,24 @@ export class ObservablePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -201,30 +200,26 @@ export class ObservablePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable<ApiResponse> {
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
export class ObservableStoreApi {
|
||||
private requestFactory: StoreApiRequestFactory;
|
||||
@@ -247,100 +242,96 @@ export class ObservableStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Observable<{ [key: string]: number; }> {
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
export class ObservableUserApi {
|
||||
private requestFactory: UserApiRequestFactory;
|
||||
@@ -363,163 +354,163 @@ export class ObservableUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Observable<User> {
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Observable<string> {
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -527,26 +518,22 @@ export class ObservableUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Tag } from '../models/Tag';
|
||||
import { User } from '../models/User';
|
||||
import { ObservablePetApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { PetApiRequestFactory, PetApiResponseProcessor} from "../apis/PetApi";
|
||||
export class PromisePetApi {
|
||||
private api: ObservablePetApi
|
||||
@@ -28,59 +27,59 @@ export class PromisePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.getPetById(petId, options);
|
||||
const result = this.api.getPetById(petId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -88,10 +87,10 @@ export class PromisePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -99,10 +98,10 @@ export class PromisePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<ApiResponse> {
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +109,6 @@ export class PromisePetApi {
|
||||
|
||||
import { ObservableStoreApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
export class PromiseStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
@@ -129,38 +127,38 @@ export class PromiseStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
const result = this.api.getInventory(options);
|
||||
const result = this.api.getInventory(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -168,7 +166,6 @@ export class PromiseStoreApi {
|
||||
|
||||
import { ObservableUserApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
export class PromiseUserApi {
|
||||
private api: ObservableUserApi
|
||||
@@ -187,65 +184,65 @@ export class PromiseUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteUser(username, options);
|
||||
const result = this.api.deleteUser(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Promise<User> {
|
||||
const result = this.api.getUserByName(username, options);
|
||||
const result = this.api.getUserByName(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Promise<string> {
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Promise<void> {
|
||||
const result = this.api.logoutUser(options);
|
||||
const result = this.api.logoutUser(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -253,10 +250,10 @@ export class PromiseUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
* @param code the http status code to be checked against the code range
|
||||
*/
|
||||
export function isCodeInRange(codeRange: string, code: number): boolean {
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,35 +13,35 @@ import { Pet } from '../models/Pet.ts';
|
||||
* no description
|
||||
*/
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -70,32 +70,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -113,32 +113,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (status !== undefined) {
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -156,32 +156,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (tags !== undefined) {
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -199,30 +199,30 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -239,29 +239,29 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -291,42 +291,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (name !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('status', status as any);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -345,42 +345,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -394,8 +394,6 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class PetApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -428,9 +426,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -450,9 +448,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -483,9 +481,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -516,9 +514,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -552,9 +550,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -591,9 +589,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -613,9 +611,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -643,7 +641,7 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,37 +12,37 @@ import { Order } from '../models/Order.ts';
|
||||
* no description
|
||||
*/
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -54,23 +54,23 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -88,30 +88,30 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -123,29 +123,29 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -163,8 +163,6 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class StoreApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -189,9 +187,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -219,9 +217,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -255,9 +253,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -288,7 +286,7 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,36 +12,36 @@ import { User } from '../models/User.ts';
|
||||
* no description
|
||||
*/
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param user Created user object
|
||||
*/
|
||||
public async createUser(user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -67,29 +67,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -115,29 +115,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -164,30 +164,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -204,30 +204,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -240,41 +240,41 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser(username: string, password: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (username !== undefined) {
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
}
|
||||
if (password !== undefined) {
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -285,23 +285,23 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -320,36 +320,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public async updateUser(username: string, user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -372,8 +372,6 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -395,9 +393,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -417,9 +415,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -439,9 +437,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -464,9 +462,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -500,9 +498,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -533,9 +531,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -555,9 +553,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -580,7 +578,7 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,9 +26,11 @@ export type HttpFile = Blob & { readonly name: string };
|
||||
*/
|
||||
class URLParse {
|
||||
private url: URL;
|
||||
|
||||
constructor(address: string, _parser: boolean) {
|
||||
this.url = new URL(address);
|
||||
}
|
||||
|
||||
public set(_part: 'query', obj: {[key: string]: string | undefined}) {
|
||||
for (const key in obj) {
|
||||
const value = obj[key];
|
||||
@@ -39,6 +41,7 @@ class URLParse {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public get query() {
|
||||
const obj: {[key: string]: string} = {};
|
||||
for (const [key, value] of this.url.searchParams.entries()) {
|
||||
@@ -46,6 +49,7 @@ class URLParse {
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
public toString() {
|
||||
return this.url.toString();
|
||||
}
|
||||
@@ -70,24 +74,24 @@ export class RequestContext {
|
||||
private body: RequestBody = undefined;
|
||||
private url: URLParse;
|
||||
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
public constructor(url: string, private httpMethod: HttpMethod) {
|
||||
this.url = new URLParse(url, true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the url set in the constructor including the query string
|
||||
*
|
||||
*/
|
||||
public getUrl(): string {
|
||||
return this.url.toString();
|
||||
return this.url.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the url set in the constructor with this url.
|
||||
*
|
||||
@@ -110,27 +114,27 @@ export class RequestContext {
|
||||
}
|
||||
|
||||
public getHttpMethod(): HttpMethod {
|
||||
return this.httpMethod;
|
||||
return this.httpMethod;
|
||||
}
|
||||
|
||||
|
||||
public getHeaders(): { [key: string]: string } {
|
||||
return this.headers;
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
public getBody(): RequestBody {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public setQueryParam(name: string, value: string) {
|
||||
public setQueryParam(name: string, value: string) {
|
||||
let queryObj = this.url.query;
|
||||
queryObj[name] = value;
|
||||
this.url.set("query", queryObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
public addCookie(name: string, value: string): void {
|
||||
if (!this.headers["Cookie"]) {
|
||||
this.headers["Cookie"] = "";
|
||||
@@ -148,7 +152,6 @@ export interface ResponseBody {
|
||||
binary(): Promise<Blob>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to generate a `ResponseBody` from binary data
|
||||
*/
|
||||
@@ -232,4 +235,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
||||
return from(promiseHttpLibrary.send(request));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Observable, from } from './rxjsStub.ts';
|
||||
*
|
||||
*/
|
||||
export interface Middleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Observable<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
||||
*
|
||||
*/
|
||||
export interface PromiseMiddleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Promise<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
|
||||
* @returns an observable of the modified response context
|
||||
*/
|
||||
post(context: ResponseContext): Promise<ResponseContext>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,30 +22,30 @@ export class ServerConfiguration<T extends { [key: string]: string }> implements
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { })
|
||||
|
||||
@@ -114,13 +114,12 @@ export interface PetApiUploadFileRequest {
|
||||
file?: HttpFile
|
||||
}
|
||||
|
||||
|
||||
export class ObjectPetApi {
|
||||
private api: ObservablePetApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: PetApiRequestFactory, responseProcessor?: PetApiResponseProcessor) {
|
||||
this.api = new ObservablePetApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
@@ -129,7 +128,7 @@ export class ObjectPetApi {
|
||||
public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.addPet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param param the request object
|
||||
@@ -137,7 +136,7 @@ export class ObjectPetApi {
|
||||
public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deletePet(param.petId, param.apiKey, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
@@ -146,7 +145,7 @@ export class ObjectPetApi {
|
||||
public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByStatus(param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
@@ -155,7 +154,7 @@ export class ObjectPetApi {
|
||||
public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByTags(param.tags, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
@@ -164,7 +163,7 @@ export class ObjectPetApi {
|
||||
public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.getPetById(param.petId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param param the request object
|
||||
@@ -172,7 +171,7 @@ export class ObjectPetApi {
|
||||
public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.updatePet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param param the request object
|
||||
@@ -180,7 +179,7 @@ export class ObjectPetApi {
|
||||
public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param param the request object
|
||||
@@ -188,13 +187,9 @@ export class ObjectPetApi {
|
||||
public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise<ApiResponse> {
|
||||
return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableStoreApi } from "./ObservableAPI.ts";
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi.ts";
|
||||
|
||||
@@ -228,13 +223,12 @@ export interface StoreApiPlaceOrderRequest {
|
||||
order: Order
|
||||
}
|
||||
|
||||
|
||||
export class ObjectStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: StoreApiRequestFactory, responseProcessor?: StoreApiResponseProcessor) {
|
||||
this.api = new ObservableStoreApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@@ -244,7 +238,7 @@ export class ObjectStoreApi {
|
||||
public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteOrder(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
@@ -253,7 +247,7 @@ export class ObjectStoreApi {
|
||||
public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
return this.api.getInventory( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
@@ -262,7 +256,7 @@ export class ObjectStoreApi {
|
||||
public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.getOrderById(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param param the request object
|
||||
@@ -270,13 +264,9 @@ export class ObjectStoreApi {
|
||||
public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.placeOrder(param.order, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableUserApi } from "./ObservableAPI.ts";
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi.ts";
|
||||
|
||||
@@ -358,13 +348,12 @@ export interface UserApiUpdateUserRequest {
|
||||
user: User
|
||||
}
|
||||
|
||||
|
||||
export class ObjectUserApi {
|
||||
private api: ObservableUserApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: UserApiRequestFactory, responseProcessor?: UserApiResponseProcessor) {
|
||||
this.api = new ObservableUserApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
@@ -374,7 +363,7 @@ export class ObjectUserApi {
|
||||
public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUser(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -382,7 +371,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithArrayInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -390,7 +379,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithListInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
@@ -399,7 +388,7 @@ export class ObjectUserApi {
|
||||
public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteUser(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param param the request object
|
||||
@@ -407,7 +396,7 @@ export class ObjectUserApi {
|
||||
public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise<User> {
|
||||
return this.api.getUserByName(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param param the request object
|
||||
@@ -415,7 +404,7 @@ export class ObjectUserApi {
|
||||
public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise<string> {
|
||||
return this.api.loginUser(param.username, param.password, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
* @param param the request object
|
||||
@@ -423,7 +412,7 @@ export class ObjectUserApi {
|
||||
public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.logoutUser( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -432,9 +421,5 @@ export class ObjectUserApi {
|
||||
public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updateUser(param.username, param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as models from '../models/all.ts';
|
||||
import { Configuration} from '../configuration.ts'
|
||||
import { Observable, of, from } from '../rxjsStub.ts';
|
||||
import {mergeMap, map} from '../rxjsStub.ts';
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse.ts';
|
||||
import { Category } from '../models/Category.ts';
|
||||
import { Order } from '../models/Order.ts';
|
||||
@@ -32,143 +31,143 @@ export class ObservablePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -176,24 +175,24 @@ export class ObservablePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -201,30 +200,26 @@ export class ObservablePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable<ApiResponse> {
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi.ts";
|
||||
export class ObservableStoreApi {
|
||||
private requestFactory: StoreApiRequestFactory;
|
||||
@@ -247,100 +242,96 @@ export class ObservableStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Observable<{ [key: string]: number; }> {
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi.ts";
|
||||
export class ObservableUserApi {
|
||||
private requestFactory: UserApiRequestFactory;
|
||||
@@ -363,163 +354,163 @@ export class ObservableUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Observable<User> {
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Observable<string> {
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -527,26 +518,22 @@ export class ObservableUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Tag } from '../models/Tag.ts';
|
||||
import { User } from '../models/User.ts';
|
||||
import { ObservablePetApi } from './ObservableAPI.ts';
|
||||
|
||||
|
||||
import { PetApiRequestFactory, PetApiResponseProcessor} from "../apis/PetApi.ts";
|
||||
export class PromisePetApi {
|
||||
private api: ObservablePetApi
|
||||
@@ -28,59 +27,59 @@ export class PromisePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.getPetById(petId, options);
|
||||
const result = this.api.getPetById(petId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -88,10 +87,10 @@ export class PromisePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -99,10 +98,10 @@ export class PromisePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<ApiResponse> {
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +109,6 @@ export class PromisePetApi {
|
||||
|
||||
import { ObservableStoreApi } from './ObservableAPI.ts';
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi.ts";
|
||||
export class PromiseStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
@@ -129,38 +127,38 @@ export class PromiseStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
const result = this.api.getInventory(options);
|
||||
const result = this.api.getInventory(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -168,7 +166,6 @@ export class PromiseStoreApi {
|
||||
|
||||
import { ObservableUserApi } from './ObservableAPI.ts';
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi.ts";
|
||||
export class PromiseUserApi {
|
||||
private api: ObservableUserApi
|
||||
@@ -187,65 +184,65 @@ export class PromiseUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteUser(username, options);
|
||||
const result = this.api.deleteUser(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Promise<User> {
|
||||
const result = this.api.getUserByName(username, options);
|
||||
const result = this.api.getUserByName(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Promise<string> {
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Promise<void> {
|
||||
const result = this.api.logoutUser(options);
|
||||
const result = this.api.logoutUser(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -253,10 +250,10 @@ export class PromiseUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
* @param code the http status code to be checked against the code range
|
||||
*/
|
||||
export function isCodeInRange(codeRange: string, code: number): boolean {
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,35 +16,35 @@ import { Pet } from '../models/Pet';
|
||||
*/
|
||||
@injectable()
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -73,32 +73,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -116,32 +116,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (status !== undefined) {
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -159,32 +159,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (tags !== undefined) {
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -202,30 +202,30 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -242,29 +242,29 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -294,42 +294,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (name !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('status', status as any);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -348,42 +348,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -397,8 +397,6 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@injectable()
|
||||
export class PetApiResponseProcessor {
|
||||
|
||||
@@ -432,9 +430,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -454,9 +452,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -487,9 +485,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -520,9 +518,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -556,9 +554,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -595,9 +593,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -617,9 +615,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -647,7 +645,7 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,37 +15,37 @@ import { Order } from '../models/Order';
|
||||
*/
|
||||
@injectable()
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -57,23 +57,23 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -91,30 +91,30 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -126,29 +126,29 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -166,8 +166,6 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@injectable()
|
||||
export class StoreApiResponseProcessor {
|
||||
|
||||
@@ -193,9 +191,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -223,9 +221,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -259,9 +257,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -292,7 +290,7 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,36 +15,36 @@ import { User } from '../models/User';
|
||||
*/
|
||||
@injectable()
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param user Created user object
|
||||
*/
|
||||
public async createUser(user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -70,29 +70,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -118,29 +118,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -167,30 +167,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -207,30 +207,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -243,41 +243,41 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser(username: string, password: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (username !== undefined) {
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
}
|
||||
if (password !== undefined) {
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -288,23 +288,23 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -323,36 +323,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public async updateUser(username: string, user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -375,8 +375,6 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@injectable()
|
||||
export class UserApiResponseProcessor {
|
||||
|
||||
@@ -399,9 +397,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -421,9 +419,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -443,9 +441,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -468,9 +466,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -504,9 +502,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -537,9 +535,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -559,9 +557,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -584,7 +582,7 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,24 +50,24 @@ export class RequestContext {
|
||||
private body: RequestBody = undefined;
|
||||
private url: URLParse;
|
||||
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
public constructor(url: string, private httpMethod: HttpMethod) {
|
||||
this.url = new URLParse(url, true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the url set in the constructor including the query string
|
||||
*
|
||||
*/
|
||||
public getUrl(): string {
|
||||
return this.url.toString();
|
||||
return this.url.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the url set in the constructor with this url.
|
||||
*
|
||||
@@ -90,27 +90,27 @@ export class RequestContext {
|
||||
}
|
||||
|
||||
public getHttpMethod(): HttpMethod {
|
||||
return this.httpMethod;
|
||||
return this.httpMethod;
|
||||
}
|
||||
|
||||
|
||||
public getHeaders(): { [key: string]: string } {
|
||||
return this.headers;
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
public getBody(): RequestBody {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public setQueryParam(name: string, value: string) {
|
||||
public setQueryParam(name: string, value: string) {
|
||||
let queryObj = this.url.query;
|
||||
queryObj[name] = value;
|
||||
this.url.set("query", queryObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
public addCookie(name: string, value: string): void {
|
||||
if (!this.headers["Cookie"]) {
|
||||
this.headers["Cookie"] = "";
|
||||
@@ -128,7 +128,6 @@ export interface ResponseBody {
|
||||
binary(): Promise<Buffer>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to generate a `ResponseBody` from binary data
|
||||
*/
|
||||
@@ -203,4 +202,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
||||
return from(promiseHttpLibrary.send(request));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Observable, from } from './rxjsStub';
|
||||
*
|
||||
*/
|
||||
export interface Middleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Observable<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
||||
*
|
||||
*/
|
||||
export interface PromiseMiddleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Promise<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
|
||||
* @returns an observable of the modified response context
|
||||
*/
|
||||
post(context: ResponseContext): Promise<ResponseContext>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,30 +22,30 @@ export class ServerConfiguration<T extends { [key: string]: string }> implements
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { })
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
"experimentalDecorators": true,
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist",
|
||||
"node_modules"
|
||||
],
|
||||
"filesGlob": [
|
||||
"./**/*.ts",
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,13 +114,12 @@ export interface PetApiUploadFileRequest {
|
||||
file?: HttpFile
|
||||
}
|
||||
|
||||
|
||||
export class ObjectPetApi {
|
||||
private api: ObservablePetApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: PetApiRequestFactory, responseProcessor?: PetApiResponseProcessor) {
|
||||
this.api = new ObservablePetApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
@@ -129,7 +128,7 @@ export class ObjectPetApi {
|
||||
public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.addPet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param param the request object
|
||||
@@ -137,7 +136,7 @@ export class ObjectPetApi {
|
||||
public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deletePet(param.petId, param.apiKey, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
@@ -146,7 +145,7 @@ export class ObjectPetApi {
|
||||
public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByStatus(param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
@@ -155,7 +154,7 @@ export class ObjectPetApi {
|
||||
public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByTags(param.tags, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
@@ -164,7 +163,7 @@ export class ObjectPetApi {
|
||||
public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.getPetById(param.petId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param param the request object
|
||||
@@ -172,7 +171,7 @@ export class ObjectPetApi {
|
||||
public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.updatePet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param param the request object
|
||||
@@ -180,7 +179,7 @@ export class ObjectPetApi {
|
||||
public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param param the request object
|
||||
@@ -188,13 +187,9 @@ export class ObjectPetApi {
|
||||
public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise<ApiResponse> {
|
||||
return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableStoreApi } from "./ObservableAPI";
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
|
||||
@@ -228,13 +223,12 @@ export interface StoreApiPlaceOrderRequest {
|
||||
order: Order
|
||||
}
|
||||
|
||||
|
||||
export class ObjectStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: StoreApiRequestFactory, responseProcessor?: StoreApiResponseProcessor) {
|
||||
this.api = new ObservableStoreApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@@ -244,7 +238,7 @@ export class ObjectStoreApi {
|
||||
public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteOrder(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
@@ -253,7 +247,7 @@ export class ObjectStoreApi {
|
||||
public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
return this.api.getInventory( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
@@ -262,7 +256,7 @@ export class ObjectStoreApi {
|
||||
public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.getOrderById(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param param the request object
|
||||
@@ -270,13 +264,9 @@ export class ObjectStoreApi {
|
||||
public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.placeOrder(param.order, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableUserApi } from "./ObservableAPI";
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
|
||||
@@ -358,13 +348,12 @@ export interface UserApiUpdateUserRequest {
|
||||
user: User
|
||||
}
|
||||
|
||||
|
||||
export class ObjectUserApi {
|
||||
private api: ObservableUserApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: UserApiRequestFactory, responseProcessor?: UserApiResponseProcessor) {
|
||||
this.api = new ObservableUserApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
@@ -374,7 +363,7 @@ export class ObjectUserApi {
|
||||
public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUser(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -382,7 +371,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithArrayInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -390,7 +379,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithListInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
@@ -399,7 +388,7 @@ export class ObjectUserApi {
|
||||
public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteUser(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param param the request object
|
||||
@@ -407,7 +396,7 @@ export class ObjectUserApi {
|
||||
public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise<User> {
|
||||
return this.api.getUserByName(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param param the request object
|
||||
@@ -415,7 +404,7 @@ export class ObjectUserApi {
|
||||
public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise<string> {
|
||||
return this.api.loginUser(param.username, param.password, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
* @param param the request object
|
||||
@@ -423,7 +412,7 @@ export class ObjectUserApi {
|
||||
public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.logoutUser( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -432,9 +421,5 @@ export class ObjectUserApi {
|
||||
public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updateUser(param.username, param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Observable, of, from } from '../rxjsStub';
|
||||
import {mergeMap, map} from '../rxjsStub';
|
||||
import { injectable, inject, optional } from "inversify";
|
||||
import { AbstractConfiguration } from "../services/configuration";
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { Order } from '../models/Order';
|
||||
@@ -37,143 +36,143 @@ export class ObservablePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -181,24 +180,24 @@ export class ObservablePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -206,30 +205,26 @@ export class ObservablePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable<ApiResponse> {
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
import { AbstractStoreApiRequestFactory, AbstractStoreApiResponseProcessor } from "../apis/StoreApi.service";
|
||||
|
||||
@@ -255,100 +250,96 @@ export class ObservableStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Observable<{ [key: string]: number; }> {
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
import { AbstractUserApiRequestFactory, AbstractUserApiResponseProcessor } from "../apis/UserApi.service";
|
||||
|
||||
@@ -374,163 +365,163 @@ export class ObservableUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Observable<User> {
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Observable<string> {
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -538,26 +529,22 @@ export class ObservableUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import { Tag } from '../models/Tag';
|
||||
import { User } from '../models/User';
|
||||
import { ObservablePetApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { PetApiRequestFactory, PetApiResponseProcessor} from "../apis/PetApi";
|
||||
import { AbstractPetApiRequestFactory, AbstractPetApiResponseProcessor } from "../apis/PetApi.service";
|
||||
|
||||
@@ -33,59 +32,59 @@ export class PromisePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.getPetById(petId, options);
|
||||
const result = this.api.getPetById(petId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -93,10 +92,10 @@ export class PromisePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -104,10 +103,10 @@ export class PromisePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<ApiResponse> {
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +114,6 @@ export class PromisePetApi {
|
||||
|
||||
import { ObservableStoreApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
import { AbstractStoreApiRequestFactory, AbstractStoreApiResponseProcessor } from "../apis/StoreApi.service";
|
||||
|
||||
@@ -137,38 +135,38 @@ export class PromiseStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
const result = this.api.getInventory(options);
|
||||
const result = this.api.getInventory(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -176,7 +174,6 @@ export class PromiseStoreApi {
|
||||
|
||||
import { ObservableUserApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
import { AbstractUserApiRequestFactory, AbstractUserApiResponseProcessor } from "../apis/UserApi.service";
|
||||
|
||||
@@ -198,65 +195,65 @@ export class PromiseUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteUser(username, options);
|
||||
const result = this.api.deleteUser(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Promise<User> {
|
||||
const result = this.api.getUserByName(username, options);
|
||||
const result = this.api.getUserByName(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Promise<string> {
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Promise<void> {
|
||||
const result = this.api.logoutUser(options);
|
||||
const result = this.api.logoutUser(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -264,10 +261,10 @@ export class PromiseUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
* @param code the http status code to be checked against the code range
|
||||
*/
|
||||
export function isCodeInRange(codeRange: string, code: number): boolean {
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,35 +13,35 @@ import { Pet } from '../models/Pet';
|
||||
* no description
|
||||
*/
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -70,32 +70,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -113,32 +113,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (status !== undefined) {
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -156,32 +156,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (tags !== undefined) {
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -199,30 +199,30 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -239,29 +239,29 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -291,42 +291,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (name !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('status', status as any);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -345,42 +345,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file, file.name);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -394,8 +394,6 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class PetApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -428,9 +426,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -450,9 +448,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -483,9 +481,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -516,9 +514,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -552,9 +550,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -591,9 +589,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -613,9 +611,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -643,7 +641,7 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,37 +12,37 @@ import { Order } from '../models/Order';
|
||||
* no description
|
||||
*/
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -54,23 +54,23 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -88,30 +88,30 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -123,29 +123,29 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -163,8 +163,6 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class StoreApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -189,9 +187,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -219,9 +217,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -255,9 +253,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -288,7 +286,7 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -12,36 +12,36 @@ import { User } from '../models/User';
|
||||
* no description
|
||||
*/
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param user Created user object
|
||||
*/
|
||||
public async createUser(user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -67,29 +67,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -115,29 +115,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -164,30 +164,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -204,30 +204,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -240,41 +240,41 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser(username: string, password: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (username !== undefined) {
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
}
|
||||
if (password !== undefined) {
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -285,23 +285,23 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -320,36 +320,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public async updateUser(username: string, user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -372,8 +372,6 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -395,9 +393,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -417,9 +415,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -439,9 +437,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -464,9 +462,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -500,9 +498,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -533,9 +531,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -555,9 +553,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -580,7 +578,7 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,24 +45,24 @@ export class RequestContext {
|
||||
private body: RequestBody = undefined;
|
||||
private url: URLParse;
|
||||
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
/**
|
||||
* Creates the request context using a http method and request resource url
|
||||
*
|
||||
* @param url url of the requested resource
|
||||
* @param httpMethod http method
|
||||
*/
|
||||
public constructor(url: string, private httpMethod: HttpMethod) {
|
||||
this.url = new URLParse(url, true);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns the url set in the constructor including the query string
|
||||
*
|
||||
*/
|
||||
public getUrl(): string {
|
||||
return this.url.toString();
|
||||
return this.url.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replaces the url set in the constructor with this url.
|
||||
*
|
||||
@@ -85,27 +85,27 @@ export class RequestContext {
|
||||
}
|
||||
|
||||
public getHttpMethod(): HttpMethod {
|
||||
return this.httpMethod;
|
||||
return this.httpMethod;
|
||||
}
|
||||
|
||||
|
||||
public getHeaders(): { [key: string]: string } {
|
||||
return this.headers;
|
||||
return this.headers;
|
||||
}
|
||||
|
||||
public getBody(): RequestBody {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public setQueryParam(name: string, value: string) {
|
||||
public setQueryParam(name: string, value: string) {
|
||||
let queryObj = this.url.query;
|
||||
queryObj[name] = value;
|
||||
this.url.set("query", queryObj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
||||
*
|
||||
*/
|
||||
public addCookie(name: string, value: string): void {
|
||||
if (!this.headers["Cookie"]) {
|
||||
this.headers["Cookie"] = "";
|
||||
@@ -123,7 +123,6 @@ export interface ResponseBody {
|
||||
binary(): Promise<Blob>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper class to generate a `ResponseBody` from binary data
|
||||
*/
|
||||
@@ -218,4 +217,4 @@ export function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLib
|
||||
return from(promiseHttpLibrary.send(request));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,13 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
data: body
|
||||
};
|
||||
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
// If we want a blob, we have to set the xhrFields' responseType AND add a
|
||||
// custom converter to overwrite the default deserialization of JQuery...
|
||||
requestOptions["xhrFields"] = { responseType: 'blob' };
|
||||
requestOptions["converters"] = {}
|
||||
requestOptions["converters"]["* blob"] = (result:any) => result;
|
||||
requestOptions["dataType"] = "blob";
|
||||
|
||||
|
||||
if (request.getHeaders()['Content-Type']) {
|
||||
requestOptions.contentType = headerParams['Content-Type'];
|
||||
}
|
||||
@@ -41,7 +40,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
}
|
||||
}
|
||||
})(headerParams);
|
||||
|
||||
|
||||
if (request.getHeaders()["Cookie"]) {
|
||||
throw new HttpException("Setting the \"Cookie\"-Header field is blocked by every major browser when using jquery.ajax requests. Please switch to another library like fetch to enable this option");
|
||||
}
|
||||
@@ -49,9 +48,9 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
if (body && body.constructor.name == "FormData") {
|
||||
requestOptions.contentType = false;
|
||||
}
|
||||
|
||||
|
||||
const sentRequest = $.ajax(requestOptions);
|
||||
|
||||
|
||||
const resultPromise = new Promise<ResponseContext>((resolve, reject) => {
|
||||
sentRequest.done((data, _, jqXHR) => {
|
||||
const result = new ResponseContext(
|
||||
@@ -65,7 +64,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
const headers = this.getResponseHeaders(jqXHR)
|
||||
const result = new ResponseContext(jqXHR.status, headers, jqXHR.responseText);
|
||||
resolve(result);
|
||||
})
|
||||
})
|
||||
})
|
||||
return from(resultPromise);
|
||||
}
|
||||
@@ -79,7 +78,7 @@ export class JQueryHttpLibrary implements HttpLibrary {
|
||||
var key = header.shift();
|
||||
if (key.length == 0) return
|
||||
// chrome60+ force lowercase, other browsers can be different
|
||||
key = key.toLowerCase();
|
||||
key = key.toLowerCase();
|
||||
responseHeaders[key] = header.join(": ");
|
||||
});
|
||||
return responseHeaders
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Observable, from } from './rxjsStub';
|
||||
*
|
||||
*/
|
||||
export interface Middleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Observable<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
|
||||
*
|
||||
*/
|
||||
export interface PromiseMiddleware {
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Modifies the request before the request is sent.
|
||||
*
|
||||
* @param context RequestContext of a request which is about to be sent to the server
|
||||
* @returns an observable of the updated request context
|
||||
*
|
||||
*/
|
||||
pre(context: RequestContext): Promise<RequestContext>;
|
||||
/**
|
||||
* Modifies the returned response before it is deserialized.
|
||||
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
|
||||
* @returns an observable of the modified response context
|
||||
*/
|
||||
post(context: ResponseContext): Promise<ResponseContext>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,30 +22,30 @@ export class ServerConfiguration<T extends { [key: string]: string }> implements
|
||||
Object.assign(this.variableConfiguration, variableConfiguration);
|
||||
}
|
||||
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
public getConfiguration(): T {
|
||||
return this.variableConfiguration
|
||||
}
|
||||
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
private getUrl() {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
return replacedUrl
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
/**
|
||||
* Creates a new request context for this server using the url with variables
|
||||
* replaced with their respective values and the endpoint of the request appended.
|
||||
*
|
||||
* @param endpoint the endpoint to be queried on the server
|
||||
* @param httpMethod httpMethod to be used
|
||||
*
|
||||
*/
|
||||
public makeRequestContext(endpoint: string, httpMethod: HttpMethod): RequestContext {
|
||||
return new RequestContext(this.getUrl() + endpoint, httpMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export const server1 = new ServerConfiguration<{ }>("http://petstore.swagger.io/v2", { })
|
||||
|
||||
@@ -20,11 +20,10 @@
|
||||
"lib": [ "es6", "dom" ],
|
||||
},
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist",
|
||||
"node_modules"
|
||||
],
|
||||
"filesGlob": [
|
||||
"./**/*.ts",
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,13 +114,12 @@ export interface PetApiUploadFileRequest {
|
||||
file?: HttpFile
|
||||
}
|
||||
|
||||
|
||||
export class ObjectPetApi {
|
||||
private api: ObservablePetApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: PetApiRequestFactory, responseProcessor?: PetApiResponseProcessor) {
|
||||
this.api = new ObservablePetApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
@@ -129,7 +128,7 @@ export class ObjectPetApi {
|
||||
public addPet(param: PetApiAddPetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.addPet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param param the request object
|
||||
@@ -137,7 +136,7 @@ export class ObjectPetApi {
|
||||
public deletePet(param: PetApiDeletePetRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deletePet(param.petId, param.apiKey, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
@@ -146,7 +145,7 @@ export class ObjectPetApi {
|
||||
public findPetsByStatus(param: PetApiFindPetsByStatusRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByStatus(param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
@@ -155,7 +154,7 @@ export class ObjectPetApi {
|
||||
public findPetsByTags(param: PetApiFindPetsByTagsRequest, options?: Configuration): Promise<Array<Pet>> {
|
||||
return this.api.findPetsByTags(param.tags, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
@@ -164,7 +163,7 @@ export class ObjectPetApi {
|
||||
public getPetById(param: PetApiGetPetByIdRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.getPetById(param.petId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param param the request object
|
||||
@@ -172,7 +171,7 @@ export class ObjectPetApi {
|
||||
public updatePet(param: PetApiUpdatePetRequest, options?: Configuration): Promise<Pet> {
|
||||
return this.api.updatePet(param.pet, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param param the request object
|
||||
@@ -180,7 +179,7 @@ export class ObjectPetApi {
|
||||
public updatePetWithForm(param: PetApiUpdatePetWithFormRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updatePetWithForm(param.petId, param.name, param.status, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param param the request object
|
||||
@@ -188,13 +187,9 @@ export class ObjectPetApi {
|
||||
public uploadFile(param: PetApiUploadFileRequest, options?: Configuration): Promise<ApiResponse> {
|
||||
return this.api.uploadFile(param.petId, param.additionalMetadata, param.file, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableStoreApi } from "./ObservableAPI";
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
|
||||
@@ -228,13 +223,12 @@ export interface StoreApiPlaceOrderRequest {
|
||||
order: Order
|
||||
}
|
||||
|
||||
|
||||
export class ObjectStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: StoreApiRequestFactory, responseProcessor?: StoreApiResponseProcessor) {
|
||||
this.api = new ObservableStoreApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
@@ -244,7 +238,7 @@ export class ObjectStoreApi {
|
||||
public deleteOrder(param: StoreApiDeleteOrderRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteOrder(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
@@ -253,7 +247,7 @@ export class ObjectStoreApi {
|
||||
public getInventory(param: StoreApiGetInventoryRequest, options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
return this.api.getInventory( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
@@ -262,7 +256,7 @@ export class ObjectStoreApi {
|
||||
public getOrderById(param: StoreApiGetOrderByIdRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.getOrderById(param.orderId, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param param the request object
|
||||
@@ -270,13 +264,9 @@ export class ObjectStoreApi {
|
||||
public placeOrder(param: StoreApiPlaceOrderRequest, options?: Configuration): Promise<Order> {
|
||||
return this.api.placeOrder(param.order, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { ObservableUserApi } from "./ObservableAPI";
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
|
||||
@@ -358,13 +348,12 @@ export interface UserApiUpdateUserRequest {
|
||||
user: User
|
||||
}
|
||||
|
||||
|
||||
export class ObjectUserApi {
|
||||
private api: ObservableUserApi
|
||||
|
||||
public constructor(configuration: Configuration, requestFactory?: UserApiRequestFactory, responseProcessor?: UserApiResponseProcessor) {
|
||||
this.api = new ObservableUserApi(configuration, requestFactory, responseProcessor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
@@ -374,7 +363,7 @@ export class ObjectUserApi {
|
||||
public createUser(param: UserApiCreateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUser(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -382,7 +371,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithArrayInput(param: UserApiCreateUsersWithArrayInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithArrayInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param param the request object
|
||||
@@ -390,7 +379,7 @@ export class ObjectUserApi {
|
||||
public createUsersWithListInput(param: UserApiCreateUsersWithListInputRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.createUsersWithListInput(param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
@@ -399,7 +388,7 @@ export class ObjectUserApi {
|
||||
public deleteUser(param: UserApiDeleteUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.deleteUser(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param param the request object
|
||||
@@ -407,7 +396,7 @@ export class ObjectUserApi {
|
||||
public getUserByName(param: UserApiGetUserByNameRequest, options?: Configuration): Promise<User> {
|
||||
return this.api.getUserByName(param.username, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param param the request object
|
||||
@@ -415,7 +404,7 @@ export class ObjectUserApi {
|
||||
public loginUser(param: UserApiLoginUserRequest, options?: Configuration): Promise<string> {
|
||||
return this.api.loginUser(param.username, param.password, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
* @param param the request object
|
||||
@@ -423,7 +412,7 @@ export class ObjectUserApi {
|
||||
public logoutUser(param: UserApiLogoutUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.logoutUser( options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -432,9 +421,5 @@ export class ObjectUserApi {
|
||||
public updateUser(param: UserApiUpdateUserRequest, options?: Configuration): Promise<void> {
|
||||
return this.api.updateUser(param.username, param.user, options).toPromise();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as models from '../models/all';
|
||||
import { Configuration} from '../configuration'
|
||||
import { Observable, of, from } from '../rxjsStub';
|
||||
import {mergeMap, map} from '../rxjsStub';
|
||||
|
||||
import { ApiResponse } from '../models/ApiResponse';
|
||||
import { Category } from '../models/Category';
|
||||
import { Order } from '../models/Order';
|
||||
@@ -32,143 +31,143 @@ export class ObservablePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.addPet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.addPet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
const requestContextPromise = this.requestFactory.deletePet(petId, apiKey, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deletePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByStatus(status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByStatus(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Observable<Array<Pet>> {
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
const requestContextPromise = this.requestFactory.findPetsByTags(tags, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.findPetsByTags(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
const requestContextPromise = this.requestFactory.getPetById(petId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getPetById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Observable<Pet> {
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
const requestContextPromise = this.requestFactory.updatePet(pet, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePet(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -176,24 +175,24 @@ export class ObservablePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
const requestContextPromise = this.requestFactory.updatePetWithForm(petId, name, status, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updatePetWithForm(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -201,30 +200,26 @@ export class ObservablePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Observable<ApiResponse> {
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
const requestContextPromise = this.requestFactory.uploadFile(petId, additionalMetadata, file, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.uploadFile(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
export class ObservableStoreApi {
|
||||
private requestFactory: StoreApiRequestFactory;
|
||||
@@ -247,100 +242,96 @@ export class ObservableStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.deleteOrder(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Observable<{ [key: string]: number; }> {
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
const requestContextPromise = this.requestFactory.getInventory(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getInventory(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
const requestContextPromise = this.requestFactory.getOrderById(orderId, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getOrderById(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Observable<Order> {
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
const requestContextPromise = this.requestFactory.placeOrder(order, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.placeOrder(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
export class ObservableUserApi {
|
||||
private requestFactory: UserApiRequestFactory;
|
||||
@@ -363,163 +354,163 @@ export class ObservableUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUser(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithArrayInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithArrayInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
const requestContextPromise = this.requestFactory.createUsersWithListInput(user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.createUsersWithListInput(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
const requestContextPromise = this.requestFactory.deleteUser(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.deleteUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Observable<User> {
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
const requestContextPromise = this.requestFactory.getUserByName(username, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.getUserByName(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Observable<string> {
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
const requestContextPromise = this.requestFactory.loginUser(username, password, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.loginUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
const requestContextPromise = this.requestFactory.logoutUser(options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.logoutUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -527,26 +518,22 @@ export class ObservableUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Observable<void> {
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
const requestContextPromise = this.requestFactory.updateUser(username, user, options);
|
||||
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
// build promise chain
|
||||
let middlewarePreObservable = from<RequestContext>(requestContextPromise);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => middleware.pre(ctx)));
|
||||
}
|
||||
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
return middlewarePreObservable.pipe(mergeMap((ctx: RequestContext) => this.configuration.httpApi.send(ctx))).
|
||||
pipe(mergeMap((response: ResponseContext) => {
|
||||
let middlewarePostObservable = of(response);
|
||||
for (let middleware of this.configuration.middleware) {
|
||||
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp: ResponseContext) => middleware.post(rsp)));
|
||||
}
|
||||
return middlewarePostObservable.pipe(map((rsp: ResponseContext) => this.responseProcessor.updateUser(rsp)));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { Tag } from '../models/Tag';
|
||||
import { User } from '../models/User';
|
||||
import { ObservablePetApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { PetApiRequestFactory, PetApiResponseProcessor} from "../apis/PetApi";
|
||||
export class PromisePetApi {
|
||||
private api: ObservablePetApi
|
||||
@@ -28,59 +27,59 @@ export class PromisePetApi {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.addPet(pet, options);
|
||||
const result = this.api.addPet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
const result = this.api.deletePet(petId, apiKey, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
const result = this.api.findPetsByStatus(status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): Promise<Array<Pet>> {
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
const result = this.api.findPetsByTags(tags, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a single pet
|
||||
* Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public getPetById(petId: number, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.getPetById(petId, options);
|
||||
const result = this.api.getPetById(petId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(pet: Pet, options?: Configuration): Promise<Pet> {
|
||||
const result = this.api.updatePet(pet, options);
|
||||
const result = this.api.updatePet(pet, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
* @param petId ID of pet that needs to be updated
|
||||
@@ -88,10 +87,10 @@ export class PromisePetApi {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
const result = this.api.updatePetWithForm(petId, name, status, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
* @param petId ID of pet to update
|
||||
@@ -99,10 +98,10 @@ export class PromisePetApi {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<ApiResponse> {
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
const result = this.api.uploadFile(petId, additionalMetadata, file, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +109,6 @@ export class PromisePetApi {
|
||||
|
||||
import { ObservableStoreApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { StoreApiRequestFactory, StoreApiResponseProcessor} from "../apis/StoreApi";
|
||||
export class PromiseStoreApi {
|
||||
private api: ObservableStoreApi
|
||||
@@ -129,38 +127,38 @@ export class PromiseStoreApi {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder(orderId: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
const result = this.api.deleteOrder(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a map of status codes to quantities
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public getInventory(options?: Configuration): Promise<{ [key: string]: number; }> {
|
||||
const result = this.api.getInventory(options);
|
||||
const result = this.api.getInventory(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById(orderId: number, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
const result = this.api.getOrderById(orderId, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(order: Order, options?: Configuration): Promise<Order> {
|
||||
const result = this.api.placeOrder(order, options);
|
||||
const result = this.api.placeOrder(order, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -168,7 +166,6 @@ export class PromiseStoreApi {
|
||||
|
||||
import { ObservableUserApi } from './ObservableAPI';
|
||||
|
||||
|
||||
import { UserApiRequestFactory, UserApiResponseProcessor} from "../apis/UserApi";
|
||||
export class PromiseUserApi {
|
||||
private api: ObservableUserApi
|
||||
@@ -187,65 +184,65 @@ export class PromiseUserApi {
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUser(user, options);
|
||||
const result = this.api.createUser(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
const result = this.api.createUsersWithArrayInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<void> {
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
const result = this.api.createUsersWithListInput(user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public deleteUser(username: string, options?: Configuration): Promise<void> {
|
||||
const result = this.api.deleteUser(username, options);
|
||||
const result = this.api.deleteUser(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public getUserByName(username: string, options?: Configuration): Promise<User> {
|
||||
const result = this.api.getUserByName(username, options);
|
||||
const result = this.api.getUserByName(username, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public loginUser(username: string, password: string, options?: Configuration): Promise<string> {
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
const result = this.api.loginUser(username, password, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public logoutUser(options?: Configuration): Promise<void> {
|
||||
const result = this.api.logoutUser(options);
|
||||
const result = this.api.logoutUser(options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Updated user
|
||||
@@ -253,10 +250,10 @@ export class PromiseUserApi {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, user: User, options?: Configuration): Promise<void> {
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
const result = this.api.updateUser(username, user, options);
|
||||
return result.toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
* @param code the http status code to be checked against the code range
|
||||
*/
|
||||
export function isCodeInRange(codeRange: string, code: number): boolean {
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// This is how the default value is encoded in OAG
|
||||
if (codeRange === "0") {
|
||||
return true;
|
||||
}
|
||||
if (codeRange == code.toString()) {
|
||||
return true;
|
||||
} else {
|
||||
const codeString = code.toString();
|
||||
if (codeString.length != codeRange.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < codeString.length; i++) {
|
||||
if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,35 +14,35 @@ import { Pet } from '../models/Pet';
|
||||
* no description
|
||||
*/
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -71,32 +71,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet(petId: number, apiKey?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
requestContext.setHeaderParam("api_key", ObjectSerializer.serialize(apiKey, "string", ""));
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -114,32 +114,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (status !== undefined) {
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
requestContext.setQueryParam("status", ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -157,32 +157,32 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags(tags: Array<string>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (tags !== undefined) {
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
requestContext.setQueryParam("tags", ObjectSerializer.serialize(tags, "Array<string>", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -200,30 +200,30 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById(petId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -240,29 +240,29 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet(pet: Pet, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Path Params
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json",
|
||||
|
||||
@@ -292,42 +292,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (name !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('name', name as any);
|
||||
}
|
||||
if (status !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('status', status as any);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -346,42 +346,42 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
let localVarFormParams = new FormData();
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('additionalMetadata', additionalMetadata as any);
|
||||
}
|
||||
if (file !== undefined) {
|
||||
// TODO: replace .append with .set
|
||||
// TODO: replace .append with .set
|
||||
localVarFormParams.append('file', file.data, file.name);
|
||||
}
|
||||
requestContext.setBody(localVarFormParams);
|
||||
requestContext.setBody(localVarFormParams);
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -395,8 +395,6 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class PetApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -429,9 +427,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -451,9 +449,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -484,9 +482,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -517,9 +515,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -553,9 +551,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -592,9 +590,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -614,9 +612,9 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -644,7 +642,7 @@ export class PetApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,37 +13,37 @@ import { Order } from '../models/Order';
|
||||
* no description
|
||||
*/
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder(orderId: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -55,23 +55,23 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -89,30 +89,30 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById(orderId: number, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -124,29 +124,29 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder(order: Order, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -164,8 +164,6 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class StoreApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -190,9 +188,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -220,9 +218,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -256,9 +254,9 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -289,7 +287,7 @@ export class StoreApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,36 +13,36 @@ import { User } from '../models/User';
|
||||
* no description
|
||||
*/
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* Create user
|
||||
* @param user Created user object
|
||||
*/
|
||||
public async createUser(user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -68,29 +68,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -116,29 +116,29 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user List of user object
|
||||
*/
|
||||
public async createUsersWithListInput(user: Array<User>, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
// Path Params
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -165,30 +165,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -205,30 +205,30 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName(username: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -241,41 +241,41 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser(username: string, password: string, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
if (username !== undefined) {
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
requestContext.setQueryParam("username", ObjectSerializer.serialize(username, "string", ""));
|
||||
}
|
||||
if (password !== undefined) {
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
requestContext.setQueryParam("password", ObjectSerializer.serialize(password, "string", ""));
|
||||
}
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
// Apply auth methods
|
||||
|
||||
@@ -286,23 +286,23 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser(options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
@@ -321,36 +321,36 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public async updateUser(username: string, user: User, options?: Configuration): Promise<RequestContext> {
|
||||
let config = options || this.configuration;
|
||||
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
// Make Request Context
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
|
||||
|
||||
// Query Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
// Header Params
|
||||
|
||||
// Form Params
|
||||
|
||||
|
||||
// Body Params
|
||||
// Body Params
|
||||
const contentType = ObjectSerializer.getPreferredMediaType([
|
||||
"application/json"
|
||||
]);
|
||||
@@ -373,8 +373,6 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export class UserApiResponseProcessor {
|
||||
|
||||
/**
|
||||
@@ -396,9 +394,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -418,9 +416,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -440,9 +438,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -465,9 +463,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -501,9 +499,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -534,9 +532,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -556,9 +554,9 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
||||
* to the expected objects
|
||||
@@ -581,7 +579,7 @@ export class UserApiResponseProcessor {
|
||||
}
|
||||
|
||||
let body = response.body || "";
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*/
|
||||
export class ApiException<T> extends Error {
|
||||
public constructor(public code: number, public body: T) {
|
||||
public constructor(public code: number, public body: T) {
|
||||
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user