/* tslint:disable */
/* eslint-disable */
/**
* TeamCity REST API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2018.1 (current)
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// @ts-ignore
import {
BASE_PATH,
BaseAPI,
COLLECTION_FORMATS,
type RequestArgs,
RequiredError,
operationServerMap,
} from '../base';
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
createRequestFunction,
serializeDataIfNeeded,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
toPathString,
} from '../common';
import type { Configuration } from '../configuration';
// @ts-ignore
import type { TestOccurrence } from '../models';
// @ts-ignore
import type { TestOccurrences } from '../models';
/**
* TestOccurrenceApi - axios parameter creator
* @export
*/
export const TestOccurrenceApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @summary Get all test occurrences.
* @param {string} [locator]
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllTestOccurrences: async (
locator?: string,
fields?: string,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/app/rest/testOccurrences`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {} as Record<string, string>;
const localVarQueryParameter = {} as Record<string, string>;
if (locator !== undefined) {
localVarQueryParameter['locator'] = String(locator);
}
if (fields !== undefined) {
localVarQueryParameter['fields'] = String(fields);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions["headers"] ? baseOptions["headers"] : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options["headers"],
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get a matching test occurrence.
* @param {string} testLocator
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTestOccurrence: async (
testLocator: string,
fields?: string,
options: RawAxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'testLocator' is not null or undefined
assertParamExists('getTestOccurrence', 'testLocator', testLocator);
const localVarPath = `/app/rest/testOccurrences/{testLocator}`.replace(
`{${'testLocator'}}`,
encodeURIComponent(String(testLocator))
);
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {} as Record<string, string>;
const localVarQueryParameter = {} as Record<string, string>;
if (fields !== undefined) {
localVarQueryParameter['fields'] = String(fields);
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions["headers"] ? baseOptions["headers"] : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options["headers"],
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* TestOccurrenceApi - functional programming interface
* @export
*/
export const TestOccurrenceApiFp = function (configuration?: Configuration) {
const localVarAxiosParamCreator = TestOccurrenceApiAxiosParamCreator(configuration);
return {
/**
*
* @summary Get all test occurrences.
* @param {string} [locator]
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAllTestOccurrences(
locator?: string,
fields?: string,
options?: RawAxiosRequestConfig
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TestOccurrences>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllTestOccurrences(
locator,
fields,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['TestOccurrenceApi.getAllTestOccurrences']?.[
localVarOperationServerIndex
]?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
/**
*
* @summary Get a matching test occurrence.
* @param {string} testLocator
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getTestOccurrence(
testLocator: string,
fields?: string,
options?: RawAxiosRequestConfig
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TestOccurrence>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getTestOccurrence(
testLocator,
fields,
options
);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath =
operationServerMap['TestOccurrenceApi.getTestOccurrence']?.[localVarOperationServerIndex]
?.url;
return (axios, basePath) =>
createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
)(axios, localVarOperationServerBasePath || basePath);
},
};
};
/**
* TestOccurrenceApi - factory interface
* @export
*/
export const TestOccurrenceApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance
) {
const localVarFp = TestOccurrenceApiFp(configuration);
return {
/**
*
* @summary Get all test occurrences.
* @param {string} [locator]
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllTestOccurrences(
locator?: string,
fields?: string,
options?: RawAxiosRequestConfig
): AxiosPromise<TestOccurrences> {
return localVarFp
.getAllTestOccurrences(locator, fields, options)
.then((request) => request(axios, basePath));
},
/**
*
* @summary Get a matching test occurrence.
* @param {string} testLocator
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTestOccurrence(
testLocator: string,
fields?: string,
options?: RawAxiosRequestConfig
): AxiosPromise<TestOccurrence> {
return localVarFp
.getTestOccurrence(testLocator, fields, options)
.then((request) => request(axios, basePath));
},
};
};
/**
* TestOccurrenceApi - interface
* @export
* @interface TestOccurrenceApi
*/
export interface TestOccurrenceApiInterface {
/**
*
* @summary Get all test occurrences.
* @param {string} [locator]
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TestOccurrenceApiInterface
*/
getAllTestOccurrences(
locator?: string,
fields?: string,
options?: RawAxiosRequestConfig
): AxiosPromise<TestOccurrences>;
/**
*
* @summary Get a matching test occurrence.
* @param {string} testLocator
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TestOccurrenceApiInterface
*/
getTestOccurrence(
testLocator: string,
fields?: string,
options?: RawAxiosRequestConfig
): AxiosPromise<TestOccurrence>;
}
/**
* TestOccurrenceApi - object-oriented interface
* @export
* @class TestOccurrenceApi
* @extends {BaseAPI}
*/
export class TestOccurrenceApi extends BaseAPI implements TestOccurrenceApiInterface {
/**
*
* @summary Get all test occurrences.
* @param {string} [locator]
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TestOccurrenceApi
*/
public getAllTestOccurrences(locator?: string, fields?: string, options?: RawAxiosRequestConfig) {
return TestOccurrenceApiFp(this.configuration)
.getAllTestOccurrences(locator, fields, options)
.then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Get a matching test occurrence.
* @param {string} testLocator
* @param {string} [fields]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TestOccurrenceApi
*/
public getTestOccurrence(testLocator: string, fields?: string, options?: RawAxiosRequestConfig) {
return TestOccurrenceApiFp(this.configuration)
.getTestOccurrence(testLocator, fields, options)
.then((request) => request(this.axios, this.basePath));
}
}