1 |
3e6b15a7
|
Lukáš Vlček
|
/* tslint:disable */
|
2 |
|
|
/* eslint-disable */
|
3 |
|
|
/**
|
4 |
|
|
* AnnotationTool
|
5 |
|
|
* KIV/ASWI ZČU Plzeň, 2022
|
6 |
|
|
*
|
7 |
|
|
* The version of the OpenAPI document: 0.1.1
|
8 |
|
|
*
|
9 |
|
|
*
|
10 |
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
11 |
|
|
* https://openapi-generator.tech
|
12 |
|
|
* Do not edit the class manually.
|
13 |
|
|
*/
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
export interface ConfigurationParameters {
|
17 |
|
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
18 |
|
|
username?: string;
|
19 |
|
|
password?: string;
|
20 |
|
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
21 |
|
|
basePath?: string;
|
22 |
|
|
baseOptions?: any;
|
23 |
|
|
formDataCtor?: new () => any;
|
24 |
|
|
}
|
25 |
|
|
|
26 |
|
|
export class Configuration {
|
27 |
|
|
/**
|
28 |
|
|
* parameter for apiKey security
|
29 |
|
|
* @param name security name
|
30 |
|
|
* @memberof Configuration
|
31 |
|
|
*/
|
32 |
|
|
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
|
33 |
|
|
/**
|
34 |
|
|
* parameter for basic security
|
35 |
|
|
*
|
36 |
|
|
* @type {string}
|
37 |
|
|
* @memberof Configuration
|
38 |
|
|
*/
|
39 |
|
|
username?: string;
|
40 |
|
|
/**
|
41 |
|
|
* parameter for basic security
|
42 |
|
|
*
|
43 |
|
|
* @type {string}
|
44 |
|
|
* @memberof Configuration
|
45 |
|
|
*/
|
46 |
|
|
password?: string;
|
47 |
|
|
/**
|
48 |
|
|
* parameter for oauth2 security
|
49 |
|
|
* @param name security name
|
50 |
|
|
* @param scopes oauth2 scope
|
51 |
|
|
* @memberof Configuration
|
52 |
|
|
*/
|
53 |
|
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
|
54 |
|
|
/**
|
55 |
|
|
* override base path
|
56 |
|
|
*
|
57 |
|
|
* @type {string}
|
58 |
|
|
* @memberof Configuration
|
59 |
|
|
*/
|
60 |
|
|
basePath?: string;
|
61 |
|
|
/**
|
62 |
|
|
* base options for axios calls
|
63 |
|
|
*
|
64 |
|
|
* @type {any}
|
65 |
|
|
* @memberof Configuration
|
66 |
|
|
*/
|
67 |
|
|
baseOptions?: any;
|
68 |
|
|
/**
|
69 |
|
|
* The FormData constructor that will be used to create multipart form data
|
70 |
|
|
* requests. You can inject this here so that execution environments that
|
71 |
|
|
* do not support the FormData class can still run the generated client.
|
72 |
|
|
*
|
73 |
|
|
* @type {new () => FormData}
|
74 |
|
|
*/
|
75 |
|
|
formDataCtor?: new () => any;
|
76 |
|
|
|
77 |
|
|
constructor(param: ConfigurationParameters = {}) {
|
78 |
|
|
this.apiKey = param.apiKey;
|
79 |
|
|
this.username = param.username;
|
80 |
|
|
this.password = param.password;
|
81 |
|
|
this.accessToken = param.accessToken;
|
82 |
|
|
this.basePath = param.basePath;
|
83 |
|
|
this.baseOptions = param.baseOptions;
|
84 |
|
|
this.formDataCtor = param.formDataCtor;
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
/**
|
88 |
|
|
* Check if the given MIME is a JSON MIME.
|
89 |
|
|
* JSON MIME examples:
|
90 |
|
|
* application/json
|
91 |
|
|
* application/json; charset=UTF8
|
92 |
|
|
* APPLICATION/JSON
|
93 |
|
|
* application/vnd.company+json
|
94 |
|
|
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
95 |
|
|
* @return True if the given MIME is JSON, false otherwise.
|
96 |
|
|
*/
|
97 |
|
|
public isJsonMime(mime: string): boolean {
|
98 |
|
|
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
99 |
|
|
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
100 |
|
|
}
|
101 |
|
|
}
|