|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * API Generation |
| 5 | + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.0.0 |
| 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 | + serverIndex?: number; |
| 23 | + baseOptions?: any; |
| 24 | + formDataCtor?: new () => any; |
| 25 | +} |
| 26 | + |
| 27 | +export class Configuration { |
| 28 | + /** |
| 29 | + * parameter for apiKey security |
| 30 | + * @param name security name |
| 31 | + * @memberof Configuration |
| 32 | + */ |
| 33 | + apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>); |
| 34 | + /** |
| 35 | + * parameter for basic security |
| 36 | + * |
| 37 | + * @type {string} |
| 38 | + * @memberof Configuration |
| 39 | + */ |
| 40 | + username?: string; |
| 41 | + /** |
| 42 | + * parameter for basic security |
| 43 | + * |
| 44 | + * @type {string} |
| 45 | + * @memberof Configuration |
| 46 | + */ |
| 47 | + password?: string; |
| 48 | + /** |
| 49 | + * parameter for oauth2 security |
| 50 | + * @param name security name |
| 51 | + * @param scopes oauth2 scope |
| 52 | + * @memberof Configuration |
| 53 | + */ |
| 54 | + accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>); |
| 55 | + /** |
| 56 | + * override base path |
| 57 | + * |
| 58 | + * @type {string} |
| 59 | + * @memberof Configuration |
| 60 | + */ |
| 61 | + basePath?: string; |
| 62 | + /** |
| 63 | + * override server index |
| 64 | + * |
| 65 | + * @type {number} |
| 66 | + * @memberof Configuration |
| 67 | + */ |
| 68 | + serverIndex?: number; |
| 69 | + /** |
| 70 | + * base options for axios calls |
| 71 | + * |
| 72 | + * @type {any} |
| 73 | + * @memberof Configuration |
| 74 | + */ |
| 75 | + baseOptions?: any; |
| 76 | + /** |
| 77 | + * The FormData constructor that will be used to create multipart form data |
| 78 | + * requests. You can inject this here so that execution environments that |
| 79 | + * do not support the FormData class can still run the generated client. |
| 80 | + * |
| 81 | + * @type {new () => FormData} |
| 82 | + */ |
| 83 | + formDataCtor?: new () => any; |
| 84 | + |
| 85 | + constructor(param: ConfigurationParameters = {}) { |
| 86 | + this.apiKey = param.apiKey; |
| 87 | + this.username = param.username; |
| 88 | + this.password = param.password; |
| 89 | + this.accessToken = param.accessToken; |
| 90 | + this.basePath = param.basePath; |
| 91 | + this.serverIndex = param.serverIndex; |
| 92 | + this.baseOptions = { |
| 93 | + ...param.baseOptions, |
| 94 | + headers: { |
| 95 | + ...param.baseOptions?.headers, |
| 96 | + }, |
| 97 | + }; |
| 98 | + this.formDataCtor = param.formDataCtor; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Check if the given MIME is a JSON MIME. |
| 103 | + * JSON MIME examples: |
| 104 | + * application/json |
| 105 | + * application/json; charset=UTF8 |
| 106 | + * APPLICATION/JSON |
| 107 | + * application/vnd.company+json |
| 108 | + * @param mime - MIME (Multipurpose Internet Mail Extensions) |
| 109 | + * @return True if the given MIME is JSON, false otherwise. |
| 110 | + */ |
| 111 | + public isJsonMime(mime: string): boolean { |
| 112 | + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); |
| 113 | + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); |
| 114 | + } |
| 115 | +} |
0 commit comments