· 5 years ago · Feb 26, 2021, 08:04 PM
1/// <reference path="./custom.d.ts" />
2// tslint:disable
3/**
4 * Swagger Petstore
5 * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
6 *
7 * OpenAPI spec version: 1.0.0
8 * Contact: apiteam@swagger.io
9 *
10 * NOTE: This class is auto generated by the swagger code generator program.
11 * https://github.com/swagger-api/swagger-codegen.git
12 * Do not edit the class manually.
13 */
14
15import * as url from "url";
16import * as portableFetch from "portable-fetch";
17import { Configuration } from "./configuration";
18
19const BASE_PATH = "https://petstore.swagger.io/v2".replace(/\/+$/, "");
20
21/**
22 *
23 * @export
24 */
25export const COLLECTION_FORMATS = {
26 csv: ",",
27 ssv: " ",
28 tsv: "\t",
29 pipes: "|",
30};
31
32/**
33 *
34 * @export
35 * @interface FetchAPI
36 */
37export interface FetchAPI {
38 (url: string, init?: any): Promise<Response>;
39}
40
41/**
42 *
43 * @export
44 * @interface FetchArgs
45 */
46export interface FetchArgs {
47 url: string;
48 options: any;
49}
50
51/**
52 *
53 * @export
54 * @class BaseAPI
55 */
56export class BaseAPI {
57 protected configuration: Configuration;
58
59 constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = portableFetch) {
60 if (configuration) {
61 this.configuration = configuration;
62 this.basePath = configuration.basePath || this.basePath;
63 }
64 }
65};
66
67/**
68 *
69 * @export
70 * @class RequiredError
71 * @extends {Error}
72 */
73export class RequiredError extends Error {
74 name: "RequiredError"
75 constructor(public field: string, msg?: string) {
76 super(msg);
77 }
78}
79
80/**
81 *
82 * @export
83 * @interface ApiResponse
84 */
85export interface ApiResponse {
86 /**
87 *
88 * @type {number}
89 * @memberof ApiResponse
90 */
91 code?: number;
92 /**
93 *
94 * @type {string}
95 * @memberof ApiResponse
96 */
97 type?: string;
98 /**
99 *
100 * @type {string}
101 * @memberof ApiResponse
102 */
103 message?: string;
104}
105/**
106 *
107 * @export
108 * @interface Body
109 */
110export interface Body {
111 /**
112 * Updated name of the pet
113 * @type {string}
114 * @memberof Body
115 */
116 name?: string;
117 /**
118 * Updated status of the pet
119 * @type {string}
120 * @memberof Body
121 */
122 status?: string;
123}
124/**
125 *
126 * @export
127 * @interface Body1
128 */
129export interface Body1 {
130 /**
131 * Additional data to pass to server
132 * @type {string}
133 * @memberof Body1
134 */
135 additionalMetadata?: string;
136 /**
137 * file to upload
138 * @type {Blob}
139 * @memberof Body1
140 */
141 file?: Blob;
142}
143/**
144 *
145 * @export
146 * @interface Category
147 */
148export interface Category {
149 /**
150 *
151 * @type {number}
152 * @memberof Category
153 */
154 id?: number;
155 /**
156 *
157 * @type {string}
158 * @memberof Category
159 */
160 name?: string;
161}
162/**
163 *
164 * @export
165 * @interface Order
166 */
167export interface Order {
168 /**
169 *
170 * @type {number}
171 * @memberof Order
172 */
173 id?: number;
174 /**
175 *
176 * @type {number}
177 * @memberof Order
178 */
179 petId?: number;
180 /**
181 *
182 * @type {number}
183 * @memberof Order
184 */
185 quantity?: number;
186 /**
187 *
188 * @type {Date}
189 * @memberof Order
190 */
191 shipDate?: Date;
192 /**
193 * Order Status
194 * @type {string}
195 * @memberof Order
196 */
197 status?: Order.StatusEnum;
198 /**
199 *
200 * @type {boolean}
201 * @memberof Order
202 */
203 complete?: boolean;
204}
205
206/**
207 * @export
208 * @namespace Order
209 */
210export namespace Order {
211 /**
212 * @export
213 * @enum {string}
214 */
215 export enum StatusEnum {
216 Placed = <any> 'placed',
217 Approved = <any> 'approved',
218 Delivered = <any> 'delivered'
219 }
220}
221/**
222 *
223 * @export
224 * @interface Pet
225 */
226export interface Pet {
227 /**
228 *
229 * @type {number}
230 * @memberof Pet
231 */
232 id?: number;
233 /**
234 *
235 * @type {Category}
236 * @memberof Pet
237 */
238 category?: Category;
239 /**
240 *
241 * @type {string}
242 * @memberof Pet
243 */
244 name: string;
245 /**
246 *
247 * @type {Array<string>}
248 * @memberof Pet
249 */
250 photoUrls: Array<string>;
251 /**
252 *
253 * @type {Array<Tag>}
254 * @memberof Pet
255 */
256 tags?: Array<Tag>;
257 /**
258 * pet status in the store
259 * @type {string}
260 * @memberof Pet
261 */
262 status?: Pet.StatusEnum;
263}
264
265/**
266 * @export
267 * @namespace Pet
268 */
269export namespace Pet {
270 /**
271 * @export
272 * @enum {string}
273 */
274 export enum StatusEnum {
275 Available = <any> 'available',
276 Pending = <any> 'pending',
277 Sold = <any> 'sold'
278 }
279}
280/**
281 *
282 * @export
283 * @interface Tag
284 */
285export interface Tag {
286 /**
287 *
288 * @type {number}
289 * @memberof Tag
290 */
291 id?: number;
292 /**
293 *
294 * @type {string}
295 * @memberof Tag
296 */
297 name?: string;
298}
299/**
300 *
301 * @export
302 * @interface User
303 */
304export interface User {
305 /**
306 *
307 * @type {number}
308 * @memberof User
309 */
310 id?: number;
311 /**
312 *
313 * @type {string}
314 * @memberof User
315 */
316 username?: string;
317 /**
318 *
319 * @type {string}
320 * @memberof User
321 */
322 firstName?: string;
323 /**
324 *
325 * @type {string}
326 * @memberof User
327 */
328 lastName?: string;
329 /**
330 *
331 * @type {string}
332 * @memberof User
333 */
334 email?: string;
335 /**
336 *
337 * @type {string}
338 * @memberof User
339 */
340 password?: string;
341 /**
342 *
343 * @type {string}
344 * @memberof User
345 */
346 phone?: string;
347 /**
348 * User Status
349 * @type {number}
350 * @memberof User
351 */
352 userStatus?: number;
353}
354/**
355 * PetApi - fetch parameter creator
356 * @export
357 */
358export const PetApiFetchParamCreator = function (configuration?: Configuration) {
359 return {
360 /**
361 *
362 * @summary Add a new pet to the store
363 * @param {Pet} body Pet object that needs to be added to the store
364 * @param {*} [options] Override http request option.
365 * @throws {RequiredError}
366 */
367 addPet(body: Pet, options: any = {}): FetchArgs {
368 // verify required parameter 'body' is not null or undefined
369 if (body === null || body === undefined) {
370 throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.');
371 }
372 const localVarPath = `/pet`;
373 const localVarUrlObj = url.parse(localVarPath, true);
374 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
375 const localVarHeaderParameter = {} as any;
376 const localVarQueryParameter = {} as any;
377
378 // authentication petstore_auth required
379 // oauth required
380 if (configuration && configuration.accessToken) {
381 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
382 ? configuration.accessToken("petstore_auth", [""])
383 : configuration.accessToken;
384 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
385 }
386
387 localVarHeaderParameter['Content-Type'] = 'application/json';
388
389 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
390 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
391 delete localVarUrlObj.search;
392 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
393 const needsSerialization = (<any>"Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
394 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
395
396 return {
397 url: url.format(localVarUrlObj),
398 options: localVarRequestOptions,
399 };
400 },
401 /**
402 *
403 * @summary Deletes a pet
404 * @param {number} petId Pet id to delete
405 * @param {string} [apiKey]
406 * @param {*} [options] Override http request option.
407 * @throws {RequiredError}
408 */
409 deletePet(petId: number, apiKey?: string, options: any = {}): FetchArgs {
410 // verify required parameter 'petId' is not null or undefined
411 if (petId === null || petId === undefined) {
412 throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.');
413 }
414 const localVarPath = `/pet/{petId}`
415 .replace(`{${"petId"}}`, encodeURIComponent(String(petId)));
416 const localVarUrlObj = url.parse(localVarPath, true);
417 const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
418 const localVarHeaderParameter = {} as any;
419 const localVarQueryParameter = {} as any;
420
421 // authentication petstore_auth required
422 // oauth required
423 if (configuration && configuration.accessToken) {
424 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
425 ? configuration.accessToken("petstore_auth", [""])
426 : configuration.accessToken;
427 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
428 }
429
430 if (apiKey !== undefined && apiKey !== null) {
431 localVarHeaderParameter['api_key'] = String(apiKey);
432 }
433
434 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
435 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
436 delete localVarUrlObj.search;
437 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
438
439 return {
440 url: url.format(localVarUrlObj),
441 options: localVarRequestOptions,
442 };
443 },
444 /**
445 * Multiple status values can be provided with comma separated strings
446 * @summary Finds Pets by status
447 * @param {Array<string>} status Status values that need to be considered for filter
448 * @param {*} [options] Override http request option.
449 * @throws {RequiredError}
450 */
451 findPetsByStatus(status: Array<string>, options: any = {}): FetchArgs {
452 // verify required parameter 'status' is not null or undefined
453 if (status === null || status === undefined) {
454 throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.');
455 }
456 const localVarPath = `/pet/findByStatus`;
457 const localVarUrlObj = url.parse(localVarPath, true);
458 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
459 const localVarHeaderParameter = {} as any;
460 const localVarQueryParameter = {} as any;
461
462 // authentication petstore_auth required
463 // oauth required
464 if (configuration && configuration.accessToken) {
465 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
466 ? configuration.accessToken("petstore_auth", [""])
467 : configuration.accessToken;
468 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
469 }
470
471 if (status) {
472 localVarQueryParameter['status'] = status;
473 }
474
475 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
476 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
477 delete localVarUrlObj.search;
478 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
479
480 return {
481 url: url.format(localVarUrlObj),
482 options: localVarRequestOptions,
483 };
484 },
485 /**
486 * Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
487 * @summary Finds Pets by tags
488 * @param {Array<string>} tags Tags to filter by
489 * @param {*} [options] Override http request option.
490 * @throws {RequiredError}
491 */
492 findPetsByTags(tags: Array<string>, options: any = {}): FetchArgs {
493 // verify required parameter 'tags' is not null or undefined
494 if (tags === null || tags === undefined) {
495 throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.');
496 }
497 const localVarPath = `/pet/findByTags`;
498 const localVarUrlObj = url.parse(localVarPath, true);
499 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
500 const localVarHeaderParameter = {} as any;
501 const localVarQueryParameter = {} as any;
502
503 // authentication petstore_auth required
504 // oauth required
505 if (configuration && configuration.accessToken) {
506 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
507 ? configuration.accessToken("petstore_auth", [""])
508 : configuration.accessToken;
509 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
510 }
511
512 if (tags) {
513 localVarQueryParameter['tags'] = tags;
514 }
515
516 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
517 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
518 delete localVarUrlObj.search;
519 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
520
521 return {
522 url: url.format(localVarUrlObj),
523 options: localVarRequestOptions,
524 };
525 },
526 /**
527 * Returns a single pet
528 * @summary Find pet by ID
529 * @param {number} petId ID of pet to return
530 * @param {*} [options] Override http request option.
531 * @throws {RequiredError}
532 */
533 getPetById(petId: number, options: any = {}): FetchArgs {
534 // verify required parameter 'petId' is not null or undefined
535 if (petId === null || petId === undefined) {
536 throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.');
537 }
538 const localVarPath = `/pet/{petId}`
539 .replace(`{${"petId"}}`, encodeURIComponent(String(petId)));
540 const localVarUrlObj = url.parse(localVarPath, true);
541 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
542 const localVarHeaderParameter = {} as any;
543 const localVarQueryParameter = {} as any;
544
545 // authentication api_key required
546 if (configuration && configuration.apiKey) {
547 const localVarApiKeyValue = typeof configuration.apiKey === 'function'
548 ? configuration.apiKey("api_key")
549 : configuration.apiKey;
550 localVarHeaderParameter["api_key"] = localVarApiKeyValue;
551 }
552
553 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
554 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
555 delete localVarUrlObj.search;
556 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
557
558 return {
559 url: url.format(localVarUrlObj),
560 options: localVarRequestOptions,
561 };
562 },
563 /**
564 *
565 * @summary Update an existing pet
566 * @param {Pet} body Pet object that needs to be added to the store
567 * @param {*} [options] Override http request option.
568 * @throws {RequiredError}
569 */
570 updatePet(body: Pet, options: any = {}): FetchArgs {
571 // verify required parameter 'body' is not null or undefined
572 if (body === null || body === undefined) {
573 throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.');
574 }
575 const localVarPath = `/pet`;
576 const localVarUrlObj = url.parse(localVarPath, true);
577 const localVarRequestOptions = Object.assign({ method: 'PUT' }, options);
578 const localVarHeaderParameter = {} as any;
579 const localVarQueryParameter = {} as any;
580
581 // authentication petstore_auth required
582 // oauth required
583 if (configuration && configuration.accessToken) {
584 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
585 ? configuration.accessToken("petstore_auth", [""])
586 : configuration.accessToken;
587 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
588 }
589
590 localVarHeaderParameter['Content-Type'] = 'application/json';
591
592 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
593 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
594 delete localVarUrlObj.search;
595 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
596 const needsSerialization = (<any>"Pet" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
597 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
598
599 return {
600 url: url.format(localVarUrlObj),
601 options: localVarRequestOptions,
602 };
603 },
604 /**
605 *
606 * @summary Updates a pet in the store with form data
607 * @param {number} petId ID of pet that needs to be updated
608 * @param {string} [name]
609 * @param {string} [status]
610 * @param {*} [options] Override http request option.
611 * @throws {RequiredError}
612 */
613 updatePetWithForm(petId: number, name?: string, status?: string, options: any = {}): FetchArgs {
614 // verify required parameter 'petId' is not null or undefined
615 if (petId === null || petId === undefined) {
616 throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.');
617 }
618 const localVarPath = `/pet/{petId}`
619 .replace(`{${"petId"}}`, encodeURIComponent(String(petId)));
620 const localVarUrlObj = url.parse(localVarPath, true);
621 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
622 const localVarHeaderParameter = {} as any;
623 const localVarQueryParameter = {} as any;
624 const localVarFormParams = new url.URLSearchParams();
625
626 // authentication petstore_auth required
627 // oauth required
628 if (configuration && configuration.accessToken) {
629 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
630 ? configuration.accessToken("petstore_auth", [""])
631 : configuration.accessToken;
632 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
633 }
634
635 if (name !== undefined) {
636 localVarFormParams.set('name', name as any);
637 }
638
639 if (status !== undefined) {
640 localVarFormParams.set('status', status as any);
641 }
642
643 localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
644
645 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
646 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
647 delete localVarUrlObj.search;
648 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
649 localVarRequestOptions.body = localVarFormParams.toString();
650
651 return {
652 url: url.format(localVarUrlObj),
653 options: localVarRequestOptions,
654 };
655 },
656 /**
657 *
658 * @summary uploads an image
659 * @param {number} petId ID of pet to update
660 * @param {string} [additionalMetadata]
661 * @param {Blob} [file]
662 * @param {*} [options] Override http request option.
663 * @throws {RequiredError}
664 */
665 uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options: any = {}): FetchArgs {
666 // verify required parameter 'petId' is not null or undefined
667 if (petId === null || petId === undefined) {
668 throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.');
669 }
670 const localVarPath = `/pet/{petId}/uploadImage`
671 .replace(`{${"petId"}}`, encodeURIComponent(String(petId)));
672 const localVarUrlObj = url.parse(localVarPath, true);
673 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
674 const localVarHeaderParameter = {} as any;
675 const localVarQueryParameter = {} as any;
676 const localVarFormParams = new url.URLSearchParams();
677
678 // authentication petstore_auth required
679 // oauth required
680 if (configuration && configuration.accessToken) {
681 const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
682 ? configuration.accessToken("petstore_auth", [""])
683 : configuration.accessToken;
684 localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue;
685 }
686
687 if (additionalMetadata !== undefined) {
688 localVarFormParams.set('additionalMetadata', additionalMetadata as any);
689 }
690
691 if (file !== undefined) {
692 localVarFormParams.set('file', file as any);
693 }
694
695 localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
696
697 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
698 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
699 delete localVarUrlObj.search;
700 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
701 localVarRequestOptions.body = localVarFormParams.toString();
702
703 return {
704 url: url.format(localVarUrlObj),
705 options: localVarRequestOptions,
706 };
707 },
708 }
709};
710
711/**
712 * PetApi - functional programming interface
713 * @export
714 */
715export const PetApiFp = function(configuration?: Configuration) {
716 return {
717 /**
718 *
719 * @summary Add a new pet to the store
720 * @param {Pet} body Pet object that needs to be added to the store
721 * @param {*} [options] Override http request option.
722 * @throws {RequiredError}
723 */
724 addPet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
725 const localVarFetchArgs = PetApiFetchParamCreator(configuration).addPet(body, options);
726 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
727 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
728 if (response.status >= 200 && response.status < 300) {
729 return response;
730 } else {
731 throw response;
732 }
733 });
734 };
735 },
736 /**
737 *
738 * @summary Deletes a pet
739 * @param {number} petId Pet id to delete
740 * @param {string} [apiKey]
741 * @param {*} [options] Override http request option.
742 * @throws {RequiredError}
743 */
744 deletePet(petId: number, apiKey?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
745 const localVarFetchArgs = PetApiFetchParamCreator(configuration).deletePet(petId, apiKey, options);
746 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
747 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
748 if (response.status >= 200 && response.status < 300) {
749 return response;
750 } else {
751 throw response;
752 }
753 });
754 };
755 },
756 /**
757 * Multiple status values can be provided with comma separated strings
758 * @summary Finds Pets by status
759 * @param {Array<string>} status Status values that need to be considered for filter
760 * @param {*} [options] Override http request option.
761 * @throws {RequiredError}
762 */
763 findPetsByStatus(status: Array<string>, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Array<Pet>> {
764 const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByStatus(status, options);
765 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
766 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
767 if (response.status >= 200 && response.status < 300) {
768 return response.json();
769 } else {
770 throw response;
771 }
772 });
773 };
774 },
775 /**
776 * Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
777 * @summary Finds Pets by tags
778 * @param {Array<string>} tags Tags to filter by
779 * @param {*} [options] Override http request option.
780 * @throws {RequiredError}
781 */
782 findPetsByTags(tags: Array<string>, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Array<Pet>> {
783 const localVarFetchArgs = PetApiFetchParamCreator(configuration).findPetsByTags(tags, options);
784 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
785 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
786 if (response.status >= 200 && response.status < 300) {
787 return response.json();
788 } else {
789 throw response;
790 }
791 });
792 };
793 },
794 /**
795 * Returns a single pet
796 * @summary Find pet by ID
797 * @param {number} petId ID of pet to return
798 * @param {*} [options] Override http request option.
799 * @throws {RequiredError}
800 */
801 getPetById(petId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Pet> {
802 const localVarFetchArgs = PetApiFetchParamCreator(configuration).getPetById(petId, options);
803 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
804 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
805 if (response.status >= 200 && response.status < 300) {
806 return response.json();
807 } else {
808 throw response;
809 }
810 });
811 };
812 },
813 /**
814 *
815 * @summary Update an existing pet
816 * @param {Pet} body Pet object that needs to be added to the store
817 * @param {*} [options] Override http request option.
818 * @throws {RequiredError}
819 */
820 updatePet(body: Pet, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
821 const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePet(body, options);
822 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
823 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
824 if (response.status >= 200 && response.status < 300) {
825 return response;
826 } else {
827 throw response;
828 }
829 });
830 };
831 },
832 /**
833 *
834 * @summary Updates a pet in the store with form data
835 * @param {number} petId ID of pet that needs to be updated
836 * @param {string} [name]
837 * @param {string} [status]
838 * @param {*} [options] Override http request option.
839 * @throws {RequiredError}
840 */
841 updatePetWithForm(petId: number, name?: string, status?: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
842 const localVarFetchArgs = PetApiFetchParamCreator(configuration).updatePetWithForm(petId, name, status, options);
843 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
844 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
845 if (response.status >= 200 && response.status < 300) {
846 return response;
847 } else {
848 throw response;
849 }
850 });
851 };
852 },
853 /**
854 *
855 * @summary uploads an image
856 * @param {number} petId ID of pet to update
857 * @param {string} [additionalMetadata]
858 * @param {Blob} [file]
859 * @param {*} [options] Override http request option.
860 * @throws {RequiredError}
861 */
862 uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<ApiResponse> {
863 const localVarFetchArgs = PetApiFetchParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options);
864 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
865 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
866 if (response.status >= 200 && response.status < 300) {
867 return response.json();
868 } else {
869 throw response;
870 }
871 });
872 };
873 },
874 }
875};
876
877/**
878 * PetApi - factory interface
879 * @export
880 */
881export const PetApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
882 return {
883 /**
884 *
885 * @summary Add a new pet to the store
886 * @param {Pet} body Pet object that needs to be added to the store
887 * @param {*} [options] Override http request option.
888 * @throws {RequiredError}
889 */
890 addPet(body: Pet, options?: any) {
891 return PetApiFp(configuration).addPet(body, options)(fetch, basePath);
892 },
893 /**
894 *
895 * @summary Deletes a pet
896 * @param {number} petId Pet id to delete
897 * @param {string} [apiKey]
898 * @param {*} [options] Override http request option.
899 * @throws {RequiredError}
900 */
901 deletePet(petId: number, apiKey?: string, options?: any) {
902 return PetApiFp(configuration).deletePet(petId, apiKey, options)(fetch, basePath);
903 },
904 /**
905 * Multiple status values can be provided with comma separated strings
906 * @summary Finds Pets by status
907 * @param {Array<string>} status Status values that need to be considered for filter
908 * @param {*} [options] Override http request option.
909 * @throws {RequiredError}
910 */
911 findPetsByStatus(status: Array<string>, options?: any) {
912 return PetApiFp(configuration).findPetsByStatus(status, options)(fetch, basePath);
913 },
914 /**
915 * Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
916 * @summary Finds Pets by tags
917 * @param {Array<string>} tags Tags to filter by
918 * @param {*} [options] Override http request option.
919 * @throws {RequiredError}
920 */
921 findPetsByTags(tags: Array<string>, options?: any) {
922 return PetApiFp(configuration).findPetsByTags(tags, options)(fetch, basePath);
923 },
924 /**
925 * Returns a single pet
926 * @summary Find pet by ID
927 * @param {number} petId ID of pet to return
928 * @param {*} [options] Override http request option.
929 * @throws {RequiredError}
930 */
931 getPetById(petId: number, options?: any) {
932 return PetApiFp(configuration).getPetById(petId, options)(fetch, basePath);
933 },
934 /**
935 *
936 * @summary Update an existing pet
937 * @param {Pet} body Pet object that needs to be added to the store
938 * @param {*} [options] Override http request option.
939 * @throws {RequiredError}
940 */
941 updatePet(body: Pet, options?: any) {
942 return PetApiFp(configuration).updatePet(body, options)(fetch, basePath);
943 },
944 /**
945 *
946 * @summary Updates a pet in the store with form data
947 * @param {number} petId ID of pet that needs to be updated
948 * @param {string} [name]
949 * @param {string} [status]
950 * @param {*} [options] Override http request option.
951 * @throws {RequiredError}
952 */
953 updatePetWithForm(petId: number, name?: string, status?: string, options?: any) {
954 return PetApiFp(configuration).updatePetWithForm(petId, name, status, options)(fetch, basePath);
955 },
956 /**
957 *
958 * @summary uploads an image
959 * @param {number} petId ID of pet to update
960 * @param {string} [additionalMetadata]
961 * @param {Blob} [file]
962 * @param {*} [options] Override http request option.
963 * @throws {RequiredError}
964 */
965 uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: any) {
966 return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options)(fetch, basePath);
967 },
968 };
969};
970
971/**
972 * PetApi - object-oriented interface
973 * @export
974 * @class PetApi
975 * @extends {BaseAPI}
976 */
977export class PetApi extends BaseAPI {
978 /**
979 *
980 * @summary Add a new pet to the store
981 * @param {Pet} body Pet object that needs to be added to the store
982 * @param {*} [options] Override http request option.
983 * @throws {RequiredError}
984 * @memberof PetApi
985 */
986 public addPet(body: Pet, options?: any) {
987 return PetApiFp(this.configuration).addPet(body, options)(this.fetch, this.basePath);
988 }
989
990 /**
991 *
992 * @summary Deletes a pet
993 * @param {number} petId Pet id to delete
994 * @param {string} [apiKey]
995 * @param {*} [options] Override http request option.
996 * @throws {RequiredError}
997 * @memberof PetApi
998 */
999 public deletePet(petId: number, apiKey?: string, options?: any) {
1000 return PetApiFp(this.configuration).deletePet(petId, apiKey, options)(this.fetch, this.basePath);
1001 }
1002
1003 /**
1004 * Multiple status values can be provided with comma separated strings
1005 * @summary Finds Pets by status
1006 * @param {Array<string>} status Status values that need to be considered for filter
1007 * @param {*} [options] Override http request option.
1008 * @throws {RequiredError}
1009 * @memberof PetApi
1010 */
1011 public findPetsByStatus(status: Array<string>, options?: any) {
1012 return PetApiFp(this.configuration).findPetsByStatus(status, options)(this.fetch, this.basePath);
1013 }
1014
1015 /**
1016 * Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
1017 * @summary Finds Pets by tags
1018 * @param {Array<string>} tags Tags to filter by
1019 * @param {*} [options] Override http request option.
1020 * @throws {RequiredError}
1021 * @memberof PetApi
1022 */
1023 public findPetsByTags(tags: Array<string>, options?: any) {
1024 return PetApiFp(this.configuration).findPetsByTags(tags, options)(this.fetch, this.basePath);
1025 }
1026
1027 /**
1028 * Returns a single pet
1029 * @summary Find pet by ID
1030 * @param {number} petId ID of pet to return
1031 * @param {*} [options] Override http request option.
1032 * @throws {RequiredError}
1033 * @memberof PetApi
1034 */
1035 public getPetById(petId: number, options?: any) {
1036 return PetApiFp(this.configuration).getPetById(petId, options)(this.fetch, this.basePath);
1037 }
1038
1039 /**
1040 *
1041 * @summary Update an existing pet
1042 * @param {Pet} body Pet object that needs to be added to the store
1043 * @param {*} [options] Override http request option.
1044 * @throws {RequiredError}
1045 * @memberof PetApi
1046 */
1047 public updatePet(body: Pet, options?: any) {
1048 return PetApiFp(this.configuration).updatePet(body, options)(this.fetch, this.basePath);
1049 }
1050
1051 /**
1052 *
1053 * @summary Updates a pet in the store with form data
1054 * @param {number} petId ID of pet that needs to be updated
1055 * @param {string} [name]
1056 * @param {string} [status]
1057 * @param {*} [options] Override http request option.
1058 * @throws {RequiredError}
1059 * @memberof PetApi
1060 */
1061 public updatePetWithForm(petId: number, name?: string, status?: string, options?: any) {
1062 return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options)(this.fetch, this.basePath);
1063 }
1064
1065 /**
1066 *
1067 * @summary uploads an image
1068 * @param {number} petId ID of pet to update
1069 * @param {string} [additionalMetadata]
1070 * @param {Blob} [file]
1071 * @param {*} [options] Override http request option.
1072 * @throws {RequiredError}
1073 * @memberof PetApi
1074 */
1075 public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, options?: any) {
1076 return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options)(this.fetch, this.basePath);
1077 }
1078
1079}
1080/**
1081 * StoreApi - fetch parameter creator
1082 * @export
1083 */
1084export const StoreApiFetchParamCreator = function (configuration?: Configuration) {
1085 return {
1086 /**
1087 * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
1088 * @summary Delete purchase order by ID
1089 * @param {number} orderId ID of the order that needs to be deleted
1090 * @param {*} [options] Override http request option.
1091 * @throws {RequiredError}
1092 */
1093 deleteOrder(orderId: number, options: any = {}): FetchArgs {
1094 // verify required parameter 'orderId' is not null or undefined
1095 if (orderId === null || orderId === undefined) {
1096 throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.');
1097 }
1098 const localVarPath = `/store/order/{orderId}`
1099 .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
1100 const localVarUrlObj = url.parse(localVarPath, true);
1101 const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
1102 const localVarHeaderParameter = {} as any;
1103 const localVarQueryParameter = {} as any;
1104
1105 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1106 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1107 delete localVarUrlObj.search;
1108 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1109
1110 return {
1111 url: url.format(localVarUrlObj),
1112 options: localVarRequestOptions,
1113 };
1114 },
1115 /**
1116 * Returns a map of status codes to quantities
1117 * @summary Returns pet inventories by status
1118 * @param {*} [options] Override http request option.
1119 * @throws {RequiredError}
1120 */
1121 getInventory(options: any = {}): FetchArgs {
1122 const localVarPath = `/store/inventory`;
1123 const localVarUrlObj = url.parse(localVarPath, true);
1124 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1125 const localVarHeaderParameter = {} as any;
1126 const localVarQueryParameter = {} as any;
1127
1128 // authentication api_key required
1129 if (configuration && configuration.apiKey) {
1130 const localVarApiKeyValue = typeof configuration.apiKey === 'function'
1131 ? configuration.apiKey("api_key")
1132 : configuration.apiKey;
1133 localVarHeaderParameter["api_key"] = localVarApiKeyValue;
1134 }
1135
1136 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1137 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1138 delete localVarUrlObj.search;
1139 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1140
1141 return {
1142 url: url.format(localVarUrlObj),
1143 options: localVarRequestOptions,
1144 };
1145 },
1146 /**
1147 * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
1148 * @summary Find purchase order by ID
1149 * @param {number} orderId ID of pet that needs to be fetched
1150 * @param {*} [options] Override http request option.
1151 * @throws {RequiredError}
1152 */
1153 getOrderById(orderId: number, options: any = {}): FetchArgs {
1154 // verify required parameter 'orderId' is not null or undefined
1155 if (orderId === null || orderId === undefined) {
1156 throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.');
1157 }
1158 const localVarPath = `/store/order/{orderId}`
1159 .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
1160 const localVarUrlObj = url.parse(localVarPath, true);
1161 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1162 const localVarHeaderParameter = {} as any;
1163 const localVarQueryParameter = {} as any;
1164
1165 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1166 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1167 delete localVarUrlObj.search;
1168 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1169
1170 return {
1171 url: url.format(localVarUrlObj),
1172 options: localVarRequestOptions,
1173 };
1174 },
1175 /**
1176 *
1177 * @summary Place an order for a pet
1178 * @param {Order} body order placed for purchasing the pet
1179 * @param {*} [options] Override http request option.
1180 * @throws {RequiredError}
1181 */
1182 placeOrder(body: Order, options: any = {}): FetchArgs {
1183 // verify required parameter 'body' is not null or undefined
1184 if (body === null || body === undefined) {
1185 throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.');
1186 }
1187 const localVarPath = `/store/order`;
1188 const localVarUrlObj = url.parse(localVarPath, true);
1189 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1190 const localVarHeaderParameter = {} as any;
1191 const localVarQueryParameter = {} as any;
1192
1193 localVarHeaderParameter['Content-Type'] = '*/*';
1194
1195 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1196 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1197 delete localVarUrlObj.search;
1198 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1199 const needsSerialization = (<any>"Order" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1200 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
1201
1202 return {
1203 url: url.format(localVarUrlObj),
1204 options: localVarRequestOptions,
1205 };
1206 },
1207 }
1208};
1209
1210/**
1211 * StoreApi - functional programming interface
1212 * @export
1213 */
1214export const StoreApiFp = function(configuration?: Configuration) {
1215 return {
1216 /**
1217 * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
1218 * @summary Delete purchase order by ID
1219 * @param {number} orderId ID of the order that needs to be deleted
1220 * @param {*} [options] Override http request option.
1221 * @throws {RequiredError}
1222 */
1223 deleteOrder(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1224 const localVarFetchArgs = StoreApiFetchParamCreator(configuration).deleteOrder(orderId, options);
1225 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1226 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1227 if (response.status >= 200 && response.status < 300) {
1228 return response;
1229 } else {
1230 throw response;
1231 }
1232 });
1233 };
1234 },
1235 /**
1236 * Returns a map of status codes to quantities
1237 * @summary Returns pet inventories by status
1238 * @param {*} [options] Override http request option.
1239 * @throws {RequiredError}
1240 */
1241 getInventory(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<{ [key: string]: number; }> {
1242 const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getInventory(options);
1243 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1244 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1245 if (response.status >= 200 && response.status < 300) {
1246 return response.json();
1247 } else {
1248 throw response;
1249 }
1250 });
1251 };
1252 },
1253 /**
1254 * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
1255 * @summary Find purchase order by ID
1256 * @param {number} orderId ID of pet that needs to be fetched
1257 * @param {*} [options] Override http request option.
1258 * @throws {RequiredError}
1259 */
1260 getOrderById(orderId: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Order> {
1261 const localVarFetchArgs = StoreApiFetchParamCreator(configuration).getOrderById(orderId, options);
1262 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1263 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1264 if (response.status >= 200 && response.status < 300) {
1265 return response.json();
1266 } else {
1267 throw response;
1268 }
1269 });
1270 };
1271 },
1272 /**
1273 *
1274 * @summary Place an order for a pet
1275 * @param {Order} body order placed for purchasing the pet
1276 * @param {*} [options] Override http request option.
1277 * @throws {RequiredError}
1278 */
1279 placeOrder(body: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Order> {
1280 const localVarFetchArgs = StoreApiFetchParamCreator(configuration).placeOrder(body, options);
1281 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1282 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1283 if (response.status >= 200 && response.status < 300) {
1284 return response.json();
1285 } else {
1286 throw response;
1287 }
1288 });
1289 };
1290 },
1291 }
1292};
1293
1294/**
1295 * StoreApi - factory interface
1296 * @export
1297 */
1298export const StoreApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
1299 return {
1300 /**
1301 * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
1302 * @summary Delete purchase order by ID
1303 * @param {number} orderId ID of the order that needs to be deleted
1304 * @param {*} [options] Override http request option.
1305 * @throws {RequiredError}
1306 */
1307 deleteOrder(orderId: number, options?: any) {
1308 return StoreApiFp(configuration).deleteOrder(orderId, options)(fetch, basePath);
1309 },
1310 /**
1311 * Returns a map of status codes to quantities
1312 * @summary Returns pet inventories by status
1313 * @param {*} [options] Override http request option.
1314 * @throws {RequiredError}
1315 */
1316 getInventory(options?: any) {
1317 return StoreApiFp(configuration).getInventory(options)(fetch, basePath);
1318 },
1319 /**
1320 * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
1321 * @summary Find purchase order by ID
1322 * @param {number} orderId ID of pet that needs to be fetched
1323 * @param {*} [options] Override http request option.
1324 * @throws {RequiredError}
1325 */
1326 getOrderById(orderId: number, options?: any) {
1327 return StoreApiFp(configuration).getOrderById(orderId, options)(fetch, basePath);
1328 },
1329 /**
1330 *
1331 * @summary Place an order for a pet
1332 * @param {Order} body order placed for purchasing the pet
1333 * @param {*} [options] Override http request option.
1334 * @throws {RequiredError}
1335 */
1336 placeOrder(body: Order, options?: any) {
1337 return StoreApiFp(configuration).placeOrder(body, options)(fetch, basePath);
1338 },
1339 };
1340};
1341
1342/**
1343 * StoreApi - object-oriented interface
1344 * @export
1345 * @class StoreApi
1346 * @extends {BaseAPI}
1347 */
1348export class StoreApi extends BaseAPI {
1349 /**
1350 * For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
1351 * @summary Delete purchase order by ID
1352 * @param {number} orderId ID of the order that needs to be deleted
1353 * @param {*} [options] Override http request option.
1354 * @throws {RequiredError}
1355 * @memberof StoreApi
1356 */
1357 public deleteOrder(orderId: number, options?: any) {
1358 return StoreApiFp(this.configuration).deleteOrder(orderId, options)(this.fetch, this.basePath);
1359 }
1360
1361 /**
1362 * Returns a map of status codes to quantities
1363 * @summary Returns pet inventories by status
1364 * @param {*} [options] Override http request option.
1365 * @throws {RequiredError}
1366 * @memberof StoreApi
1367 */
1368 public getInventory(options?: any) {
1369 return StoreApiFp(this.configuration).getInventory(options)(this.fetch, this.basePath);
1370 }
1371
1372 /**
1373 * For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
1374 * @summary Find purchase order by ID
1375 * @param {number} orderId ID of pet that needs to be fetched
1376 * @param {*} [options] Override http request option.
1377 * @throws {RequiredError}
1378 * @memberof StoreApi
1379 */
1380 public getOrderById(orderId: number, options?: any) {
1381 return StoreApiFp(this.configuration).getOrderById(orderId, options)(this.fetch, this.basePath);
1382 }
1383
1384 /**
1385 *
1386 * @summary Place an order for a pet
1387 * @param {Order} body order placed for purchasing the pet
1388 * @param {*} [options] Override http request option.
1389 * @throws {RequiredError}
1390 * @memberof StoreApi
1391 */
1392 public placeOrder(body: Order, options?: any) {
1393 return StoreApiFp(this.configuration).placeOrder(body, options)(this.fetch, this.basePath);
1394 }
1395
1396}
1397/**
1398 * UserApi - fetch parameter creator
1399 * @export
1400 */
1401export const UserApiFetchParamCreator = function (configuration?: Configuration) {
1402 return {
1403 /**
1404 * This can only be done by the logged in user.
1405 * @summary Create user
1406 * @param {User} body Created user object
1407 * @param {*} [options] Override http request option.
1408 * @throws {RequiredError}
1409 */
1410 createUser(body: User, options: any = {}): FetchArgs {
1411 // verify required parameter 'body' is not null or undefined
1412 if (body === null || body === undefined) {
1413 throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.');
1414 }
1415 const localVarPath = `/user`;
1416 const localVarUrlObj = url.parse(localVarPath, true);
1417 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1418 const localVarHeaderParameter = {} as any;
1419 const localVarQueryParameter = {} as any;
1420
1421 localVarHeaderParameter['Content-Type'] = '*/*';
1422
1423 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1424 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1425 delete localVarUrlObj.search;
1426 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1427 const needsSerialization = (<any>"User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1428 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
1429
1430 return {
1431 url: url.format(localVarUrlObj),
1432 options: localVarRequestOptions,
1433 };
1434 },
1435 /**
1436 *
1437 * @summary Creates list of users with given input array
1438 * @param {Array<User>} body List of user object
1439 * @param {*} [options] Override http request option.
1440 * @throws {RequiredError}
1441 */
1442 createUsersWithArrayInput(body: Array<User>, options: any = {}): FetchArgs {
1443 // verify required parameter 'body' is not null or undefined
1444 if (body === null || body === undefined) {
1445 throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.');
1446 }
1447 const localVarPath = `/user/createWithArray`;
1448 const localVarUrlObj = url.parse(localVarPath, true);
1449 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1450 const localVarHeaderParameter = {} as any;
1451 const localVarQueryParameter = {} as any;
1452
1453 localVarHeaderParameter['Content-Type'] = '*/*';
1454
1455 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1456 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1457 delete localVarUrlObj.search;
1458 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1459 const needsSerialization = (<any>"Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1460 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
1461
1462 return {
1463 url: url.format(localVarUrlObj),
1464 options: localVarRequestOptions,
1465 };
1466 },
1467 /**
1468 *
1469 * @summary Creates list of users with given input array
1470 * @param {Array<User>} body List of user object
1471 * @param {*} [options] Override http request option.
1472 * @throws {RequiredError}
1473 */
1474 createUsersWithListInput(body: Array<User>, options: any = {}): FetchArgs {
1475 // verify required parameter 'body' is not null or undefined
1476 if (body === null || body === undefined) {
1477 throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.');
1478 }
1479 const localVarPath = `/user/createWithList`;
1480 const localVarUrlObj = url.parse(localVarPath, true);
1481 const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
1482 const localVarHeaderParameter = {} as any;
1483 const localVarQueryParameter = {} as any;
1484
1485 localVarHeaderParameter['Content-Type'] = '*/*';
1486
1487 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1488 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1489 delete localVarUrlObj.search;
1490 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1491 const needsSerialization = (<any>"Array<User>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1492 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
1493
1494 return {
1495 url: url.format(localVarUrlObj),
1496 options: localVarRequestOptions,
1497 };
1498 },
1499 /**
1500 * This can only be done by the logged in user.
1501 * @summary Delete user
1502 * @param {string} username The name that needs to be deleted
1503 * @param {*} [options] Override http request option.
1504 * @throws {RequiredError}
1505 */
1506 deleteUser(username: string, options: any = {}): FetchArgs {
1507 // verify required parameter 'username' is not null or undefined
1508 if (username === null || username === undefined) {
1509 throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.');
1510 }
1511 const localVarPath = `/user/{username}`
1512 .replace(`{${"username"}}`, encodeURIComponent(String(username)));
1513 const localVarUrlObj = url.parse(localVarPath, true);
1514 const localVarRequestOptions = Object.assign({ method: 'DELETE' }, options);
1515 const localVarHeaderParameter = {} as any;
1516 const localVarQueryParameter = {} as any;
1517
1518 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1519 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1520 delete localVarUrlObj.search;
1521 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1522
1523 return {
1524 url: url.format(localVarUrlObj),
1525 options: localVarRequestOptions,
1526 };
1527 },
1528 /**
1529 *
1530 * @summary Get user by user name
1531 * @param {string} username The name that needs to be fetched. Use user1 for testing.
1532 * @param {*} [options] Override http request option.
1533 * @throws {RequiredError}
1534 */
1535 getUserByName(username: string, options: any = {}): FetchArgs {
1536 // verify required parameter 'username' is not null or undefined
1537 if (username === null || username === undefined) {
1538 throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.');
1539 }
1540 const localVarPath = `/user/{username}`
1541 .replace(`{${"username"}}`, encodeURIComponent(String(username)));
1542 const localVarUrlObj = url.parse(localVarPath, true);
1543 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1544 const localVarHeaderParameter = {} as any;
1545 const localVarQueryParameter = {} as any;
1546
1547 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1548 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1549 delete localVarUrlObj.search;
1550 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1551
1552 return {
1553 url: url.format(localVarUrlObj),
1554 options: localVarRequestOptions,
1555 };
1556 },
1557 /**
1558 *
1559 * @summary Logs user into the system
1560 * @param {string} username The user name for login
1561 * @param {string} password The password for login in clear text
1562 * @param {*} [options] Override http request option.
1563 * @throws {RequiredError}
1564 */
1565 loginUser(username: string, password: string, options: any = {}): FetchArgs {
1566 // verify required parameter 'username' is not null or undefined
1567 if (username === null || username === undefined) {
1568 throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.');
1569 }
1570 // verify required parameter 'password' is not null or undefined
1571 if (password === null || password === undefined) {
1572 throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.');
1573 }
1574 const localVarPath = `/user/login`;
1575 const localVarUrlObj = url.parse(localVarPath, true);
1576 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1577 const localVarHeaderParameter = {} as any;
1578 const localVarQueryParameter = {} as any;
1579
1580 if (username !== undefined) {
1581 localVarQueryParameter['username'] = username;
1582 }
1583
1584 if (password !== undefined) {
1585 localVarQueryParameter['password'] = password;
1586 }
1587
1588 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1589 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1590 delete localVarUrlObj.search;
1591 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1592
1593 return {
1594 url: url.format(localVarUrlObj),
1595 options: localVarRequestOptions,
1596 };
1597 },
1598 /**
1599 *
1600 * @summary Logs out current logged in user session
1601 * @param {*} [options] Override http request option.
1602 * @throws {RequiredError}
1603 */
1604 logoutUser(options: any = {}): FetchArgs {
1605 const localVarPath = `/user/logout`;
1606 const localVarUrlObj = url.parse(localVarPath, true);
1607 const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
1608 const localVarHeaderParameter = {} as any;
1609 const localVarQueryParameter = {} as any;
1610
1611 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1612 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1613 delete localVarUrlObj.search;
1614 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1615
1616 return {
1617 url: url.format(localVarUrlObj),
1618 options: localVarRequestOptions,
1619 };
1620 },
1621 /**
1622 * This can only be done by the logged in user.
1623 * @summary Updated user
1624 * @param {User} body Updated user object
1625 * @param {string} username name that need to be updated
1626 * @param {*} [options] Override http request option.
1627 * @throws {RequiredError}
1628 */
1629 updateUser(body: User, username: string, options: any = {}): FetchArgs {
1630 // verify required parameter 'body' is not null or undefined
1631 if (body === null || body === undefined) {
1632 throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.');
1633 }
1634 // verify required parameter 'username' is not null or undefined
1635 if (username === null || username === undefined) {
1636 throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.');
1637 }
1638 const localVarPath = `/user/{username}`
1639 .replace(`{${"username"}}`, encodeURIComponent(String(username)));
1640 const localVarUrlObj = url.parse(localVarPath, true);
1641 const localVarRequestOptions = Object.assign({ method: 'PUT' }, options);
1642 const localVarHeaderParameter = {} as any;
1643 const localVarQueryParameter = {} as any;
1644
1645 localVarHeaderParameter['Content-Type'] = '*/*';
1646
1647 localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
1648 // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
1649 delete localVarUrlObj.search;
1650 localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
1651 const needsSerialization = (<any>"User" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
1652 localVarRequestOptions.body = needsSerialization ? JSON.stringify(body || {}) : (body || "");
1653
1654 return {
1655 url: url.format(localVarUrlObj),
1656 options: localVarRequestOptions,
1657 };
1658 },
1659 }
1660};
1661
1662/**
1663 * UserApi - functional programming interface
1664 * @export
1665 */
1666export const UserApiFp = function(configuration?: Configuration) {
1667 return {
1668 /**
1669 * This can only be done by the logged in user.
1670 * @summary Create user
1671 * @param {User} body Created user object
1672 * @param {*} [options] Override http request option.
1673 * @throws {RequiredError}
1674 */
1675 createUser(body: User, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1676 const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUser(body, options);
1677 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1678 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1679 if (response.status >= 200 && response.status < 300) {
1680 return response;
1681 } else {
1682 throw response;
1683 }
1684 });
1685 };
1686 },
1687 /**
1688 *
1689 * @summary Creates list of users with given input array
1690 * @param {Array<User>} body List of user object
1691 * @param {*} [options] Override http request option.
1692 * @throws {RequiredError}
1693 */
1694 createUsersWithArrayInput(body: Array<User>, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1695 const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithArrayInput(body, options);
1696 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1697 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1698 if (response.status >= 200 && response.status < 300) {
1699 return response;
1700 } else {
1701 throw response;
1702 }
1703 });
1704 };
1705 },
1706 /**
1707 *
1708 * @summary Creates list of users with given input array
1709 * @param {Array<User>} body List of user object
1710 * @param {*} [options] Override http request option.
1711 * @throws {RequiredError}
1712 */
1713 createUsersWithListInput(body: Array<User>, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1714 const localVarFetchArgs = UserApiFetchParamCreator(configuration).createUsersWithListInput(body, options);
1715 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1716 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1717 if (response.status >= 200 && response.status < 300) {
1718 return response;
1719 } else {
1720 throw response;
1721 }
1722 });
1723 };
1724 },
1725 /**
1726 * This can only be done by the logged in user.
1727 * @summary Delete user
1728 * @param {string} username The name that needs to be deleted
1729 * @param {*} [options] Override http request option.
1730 * @throws {RequiredError}
1731 */
1732 deleteUser(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1733 const localVarFetchArgs = UserApiFetchParamCreator(configuration).deleteUser(username, options);
1734 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1735 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1736 if (response.status >= 200 && response.status < 300) {
1737 return response;
1738 } else {
1739 throw response;
1740 }
1741 });
1742 };
1743 },
1744 /**
1745 *
1746 * @summary Get user by user name
1747 * @param {string} username The name that needs to be fetched. Use user1 for testing.
1748 * @param {*} [options] Override http request option.
1749 * @throws {RequiredError}
1750 */
1751 getUserByName(username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<User> {
1752 const localVarFetchArgs = UserApiFetchParamCreator(configuration).getUserByName(username, options);
1753 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1754 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1755 if (response.status >= 200 && response.status < 300) {
1756 return response.json();
1757 } else {
1758 throw response;
1759 }
1760 });
1761 };
1762 },
1763 /**
1764 *
1765 * @summary Logs user into the system
1766 * @param {string} username The user name for login
1767 * @param {string} password The password for login in clear text
1768 * @param {*} [options] Override http request option.
1769 * @throws {RequiredError}
1770 */
1771 loginUser(username: string, password: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<string> {
1772 const localVarFetchArgs = UserApiFetchParamCreator(configuration).loginUser(username, password, options);
1773 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1774 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1775 if (response.status >= 200 && response.status < 300) {
1776 return response.json();
1777 } else {
1778 throw response;
1779 }
1780 });
1781 };
1782 },
1783 /**
1784 *
1785 * @summary Logs out current logged in user session
1786 * @param {*} [options] Override http request option.
1787 * @throws {RequiredError}
1788 */
1789 logoutUser(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1790 const localVarFetchArgs = UserApiFetchParamCreator(configuration).logoutUser(options);
1791 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1792 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1793 if (response.status >= 200 && response.status < 300) {
1794 return response;
1795 } else {
1796 throw response;
1797 }
1798 });
1799 };
1800 },
1801 /**
1802 * This can only be done by the logged in user.
1803 * @summary Updated user
1804 * @param {User} body Updated user object
1805 * @param {string} username name that need to be updated
1806 * @param {*} [options] Override http request option.
1807 * @throws {RequiredError}
1808 */
1809 updateUser(body: User, username: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<Response> {
1810 const localVarFetchArgs = UserApiFetchParamCreator(configuration).updateUser(body, username, options);
1811 return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
1812 return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
1813 if (response.status >= 200 && response.status < 300) {
1814 return response;
1815 } else {
1816 throw response;
1817 }
1818 });
1819 };
1820 },
1821 }
1822};
1823
1824/**
1825 * UserApi - factory interface
1826 * @export
1827 */
1828export const UserApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
1829 return {
1830 /**
1831 * This can only be done by the logged in user.
1832 * @summary Create user
1833 * @param {User} body Created user object
1834 * @param {*} [options] Override http request option.
1835 * @throws {RequiredError}
1836 */
1837 createUser(body: User, options?: any) {
1838 return UserApiFp(configuration).createUser(body, options)(fetch, basePath);
1839 },
1840 /**
1841 *
1842 * @summary Creates list of users with given input array
1843 * @param {Array<User>} body List of user object
1844 * @param {*} [options] Override http request option.
1845 * @throws {RequiredError}
1846 */
1847 createUsersWithArrayInput(body: Array<User>, options?: any) {
1848 return UserApiFp(configuration).createUsersWithArrayInput(body, options)(fetch, basePath);
1849 },
1850 /**
1851 *
1852 * @summary Creates list of users with given input array
1853 * @param {Array<User>} body List of user object
1854 * @param {*} [options] Override http request option.
1855 * @throws {RequiredError}
1856 */
1857 createUsersWithListInput(body: Array<User>, options?: any) {
1858 return UserApiFp(configuration).createUsersWithListInput(body, options)(fetch, basePath);
1859 },
1860 /**
1861 * This can only be done by the logged in user.
1862 * @summary Delete user
1863 * @param {string} username The name that needs to be deleted
1864 * @param {*} [options] Override http request option.
1865 * @throws {RequiredError}
1866 */
1867 deleteUser(username: string, options?: any) {
1868 return UserApiFp(configuration).deleteUser(username, options)(fetch, basePath);
1869 },
1870 /**
1871 *
1872 * @summary Get user by user name
1873 * @param {string} username The name that needs to be fetched. Use user1 for testing.
1874 * @param {*} [options] Override http request option.
1875 * @throws {RequiredError}
1876 */
1877 getUserByName(username: string, options?: any) {
1878 return UserApiFp(configuration).getUserByName(username, options)(fetch, basePath);
1879 },
1880 /**
1881 *
1882 * @summary Logs user into the system
1883 * @param {string} username The user name for login
1884 * @param {string} password The password for login in clear text
1885 * @param {*} [options] Override http request option.
1886 * @throws {RequiredError}
1887 */
1888 loginUser(username: string, password: string, options?: any) {
1889 return UserApiFp(configuration).loginUser(username, password, options)(fetch, basePath);
1890 },
1891 /**
1892 *
1893 * @summary Logs out current logged in user session
1894 * @param {*} [options] Override http request option.
1895 * @throws {RequiredError}
1896 */
1897 logoutUser(options?: any) {
1898 return UserApiFp(configuration).logoutUser(options)(fetch, basePath);
1899 },
1900 /**
1901 * This can only be done by the logged in user.
1902 * @summary Updated user
1903 * @param {User} body Updated user object
1904 * @param {string} username name that need to be updated
1905 * @param {*} [options] Override http request option.
1906 * @throws {RequiredError}
1907 */
1908 updateUser(body: User, username: string, options?: any) {
1909 return UserApiFp(configuration).updateUser(body, username, options)(fetch, basePath);
1910 },
1911 };
1912};
1913
1914/**
1915 * UserApi - object-oriented interface
1916 * @export
1917 * @class UserApi
1918 * @extends {BaseAPI}
1919 */
1920export class UserApi extends BaseAPI {
1921 /**
1922 * This can only be done by the logged in user.
1923 * @summary Create user
1924 * @param {User} body Created user object
1925 * @param {*} [options] Override http request option.
1926 * @throws {RequiredError}
1927 * @memberof UserApi
1928 */
1929 public createUser(body: User, options?: any) {
1930 return UserApiFp(this.configuration).createUser(body, options)(this.fetch, this.basePath);
1931 }
1932
1933 /**
1934 *
1935 * @summary Creates list of users with given input array
1936 * @param {Array<User>} body List of user object
1937 * @param {*} [options] Override http request option.
1938 * @throws {RequiredError}
1939 * @memberof UserApi
1940 */
1941 public createUsersWithArrayInput(body: Array<User>, options?: any) {
1942 return UserApiFp(this.configuration).createUsersWithArrayInput(body, options)(this.fetch, this.basePath);
1943 }
1944
1945 /**
1946 *
1947 * @summary Creates list of users with given input array
1948 * @param {Array<User>} body List of user object
1949 * @param {*} [options] Override http request option.
1950 * @throws {RequiredError}
1951 * @memberof UserApi
1952 */
1953 public createUsersWithListInput(body: Array<User>, options?: any) {
1954 return UserApiFp(this.configuration).createUsersWithListInput(body, options)(this.fetch, this.basePath);
1955 }
1956
1957 /**
1958 * This can only be done by the logged in user.
1959 * @summary Delete user
1960 * @param {string} username The name that needs to be deleted
1961 * @param {*} [options] Override http request option.
1962 * @throws {RequiredError}
1963 * @memberof UserApi
1964 */
1965 public deleteUser(username: string, options?: any) {
1966 return UserApiFp(this.configuration).deleteUser(username, options)(this.fetch, this.basePath);
1967 }
1968
1969 /**
1970 *
1971 * @summary Get user by user name
1972 * @param {string} username The name that needs to be fetched. Use user1 for testing.
1973 * @param {*} [options] Override http request option.
1974 * @throws {RequiredError}
1975 * @memberof UserApi
1976 */
1977 public getUserByName(username: string, options?: any) {
1978 return UserApiFp(this.configuration).getUserByName(username, options)(this.fetch, this.basePath);
1979 }
1980
1981 /**
1982 *
1983 * @summary Logs user into the system
1984 * @param {string} username The user name for login
1985 * @param {string} password The password for login in clear text
1986 * @param {*} [options] Override http request option.
1987 * @throws {RequiredError}
1988 * @memberof UserApi
1989 */
1990 public loginUser(username: string, password: string, options?: any) {
1991 return UserApiFp(this.configuration).loginUser(username, password, options)(this.fetch, this.basePath);
1992 }
1993
1994 /**
1995 *
1996 * @summary Logs out current logged in user session
1997 * @param {*} [options] Override http request option.
1998 * @throws {RequiredError}
1999 * @memberof UserApi
2000 */
2001 public logoutUser(options?: any) {
2002 return UserApiFp(this.configuration).logoutUser(options)(this.fetch, this.basePath);
2003 }
2004
2005 /**
2006 * This can only be done by the logged in user.
2007 * @summary Updated user
2008 * @param {User} body Updated user object
2009 * @param {string} username name that need to be updated
2010 * @param {*} [options] Override http request option.
2011 * @throws {RequiredError}
2012 * @memberof UserApi
2013 */
2014 public updateUser(body: User, username: string, options?: any) {
2015 return UserApiFp(this.configuration).updateUser(body, username, options)(this.fetch, this.basePath);
2016 }
2017
2018}
2019