Skip to content

Commit 014a37f

Browse files
user mapping condition action code refactor
1 parent 6fa533c commit 014a37f

File tree

1 file changed

+23
-260
lines changed

1 file changed

+23
-260
lines changed

api/defaultApi.ts

Lines changed: 23 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,103 +2081,16 @@ export class DefaultApi {
20812081
response: http.IncomingMessage;
20822082
body: Array<ListConditionValues200ResponseInner>;
20832083
}> {
2084-
const localVarPath =
2085-
this.basePath +
2086-
"/api/2/mappings/actions/{action_value}/values".replace(
2087-
"{" + "action_value" + "}",
2088-
encodeURIComponent(String(actionValue))
2089-
);
2090-
let localVarQueryParameters: any = {};
2091-
let localVarHeaderParams: any = (<any>Object).assign(
2092-
{},
2093-
this._defaultHeaders
2094-
);
2095-
const produces = ["application/json"];
2096-
// give precedence to 'application/json'
2097-
if (produces.indexOf("application/json") >= 0) {
2098-
localVarHeaderParams.Accept = "application/json";
2099-
} else {
2100-
localVarHeaderParams.Accept = produces.join(",");
2101-
}
2102-
let localVarFormParams: any = {};
2103-
2104-
// verify required parameter 'authorization' is not null or undefined
2105-
if (authorization === null || authorization === undefined) {
2106-
throw new Error(
2107-
"Required parameter authorization was null or undefined when calling listMappingActionValues."
2108-
);
2109-
}
2110-
2111-
// verify required parameter 'actionValue' is not null or undefined
2112-
if (actionValue === null || actionValue === undefined) {
2113-
throw new Error(
2114-
"Required parameter actionValue was null or undefined when calling listMappingActionValues."
2115-
);
2116-
}
2117-
2118-
localVarHeaderParams["Authorization"] = ObjectSerializer.serialize(
2084+
return this.request<Array<ListConditionValues200ResponseInner>>(
2085+
"GET",
2086+
`/api/2/mappings/actions/${encodeURIComponent(actionValue)}/values`,
21192087
authorization,
2120-
"string"
2121-
);
2122-
(<any>Object).assign(localVarHeaderParams, options.headers);
2123-
2124-
let localVarUseFormData = false;
2125-
2126-
let localVarRequestOptions: localVarRequest.Options = {
2127-
method: "GET",
2128-
qs: localVarQueryParameters,
2129-
headers: localVarHeaderParams,
2130-
uri: localVarPath,
2131-
useQuerystring: this._useQuerystring,
2132-
json: true,
2133-
};
2134-
2135-
let authenticationPromise = Promise.resolve();
2136-
authenticationPromise = authenticationPromise.then(() =>
2137-
this.authentications.default.applyToRequest(localVarRequestOptions)
2088+
undefined, // No request body for GET
2089+
{}, // No query parameters
2090+
options
21382091
);
2139-
2140-
let interceptorPromise = authenticationPromise;
2141-
for (const interceptor of this.interceptors) {
2142-
interceptorPromise = interceptorPromise.then(() =>
2143-
interceptor(localVarRequestOptions)
2144-
);
2145-
}
2146-
2147-
return interceptorPromise.then(() => {
2148-
if (Object.keys(localVarFormParams).length) {
2149-
if (localVarUseFormData) {
2150-
(<any>localVarRequestOptions).formData = localVarFormParams;
2151-
} else {
2152-
localVarRequestOptions.form = localVarFormParams;
2153-
}
2154-
}
2155-
return new Promise<{
2156-
response: http.IncomingMessage;
2157-
body: Array<ListConditionValues200ResponseInner>;
2158-
}>((resolve, reject) => {
2159-
localVarRequest(localVarRequestOptions, (error, response, body) => {
2160-
if (error) {
2161-
reject(error);
2162-
} else {
2163-
if (
2164-
response.statusCode &&
2165-
response.statusCode >= 200 &&
2166-
response.statusCode <= 299
2167-
) {
2168-
body = ObjectSerializer.deserialize(
2169-
body,
2170-
"Array<ListConditionValues200ResponseInner>"
2171-
);
2172-
resolve({ response: response, body: body });
2173-
} else {
2174-
reject(new HttpError(response, body, response.statusCode));
2175-
}
2176-
}
2177-
});
2178-
});
2179-
});
21802092
}
2093+
21812094
/**
21822095
*
21832096
* @param authorization
@@ -2189,91 +2102,16 @@ export class DefaultApi {
21892102
response: http.IncomingMessage;
21902103
body: Array<ListActions200ResponseInner>;
21912104
}> {
2192-
const localVarPath = this.basePath + "/api/2/mappings/actions";
2193-
let localVarQueryParameters: any = {};
2194-
let localVarHeaderParams: any = (<any>Object).assign(
2195-
{},
2196-
this._defaultHeaders
2197-
);
2198-
const produces = ["application/json"];
2199-
// give precedence to 'application/json'
2200-
if (produces.indexOf("application/json") >= 0) {
2201-
localVarHeaderParams.Accept = "application/json";
2202-
} else {
2203-
localVarHeaderParams.Accept = produces.join(",");
2204-
}
2205-
let localVarFormParams: any = {};
2206-
2207-
// verify required parameter 'authorization' is not null or undefined
2208-
if (authorization === null || authorization === undefined) {
2209-
throw new Error(
2210-
"Required parameter authorization was null or undefined when calling listMappingActions."
2211-
);
2212-
}
2213-
2214-
localVarHeaderParams["Authorization"] = ObjectSerializer.serialize(
2105+
return this.request<Array<ListActions200ResponseInner>>(
2106+
"GET",
2107+
"/api/2/mappings/actions",
22152108
authorization,
2216-
"string"
2217-
);
2218-
(<any>Object).assign(localVarHeaderParams, options.headers);
2219-
2220-
let localVarUseFormData = false;
2221-
2222-
let localVarRequestOptions: localVarRequest.Options = {
2223-
method: "GET",
2224-
qs: localVarQueryParameters,
2225-
headers: localVarHeaderParams,
2226-
uri: localVarPath,
2227-
useQuerystring: this._useQuerystring,
2228-
json: true,
2229-
};
2230-
2231-
let authenticationPromise = Promise.resolve();
2232-
authenticationPromise = authenticationPromise.then(() =>
2233-
this.authentications.default.applyToRequest(localVarRequestOptions)
2109+
undefined, // No request body for GET
2110+
{}, // No query parameters
2111+
options
22342112
);
2235-
2236-
let interceptorPromise = authenticationPromise;
2237-
for (const interceptor of this.interceptors) {
2238-
interceptorPromise = interceptorPromise.then(() =>
2239-
interceptor(localVarRequestOptions)
2240-
);
2241-
}
2242-
2243-
return interceptorPromise.then(() => {
2244-
if (Object.keys(localVarFormParams).length) {
2245-
if (localVarUseFormData) {
2246-
(<any>localVarRequestOptions).formData = localVarFormParams;
2247-
} else {
2248-
localVarRequestOptions.form = localVarFormParams;
2249-
}
2250-
}
2251-
return new Promise<{
2252-
response: http.IncomingMessage;
2253-
body: Array<ListActions200ResponseInner>;
2254-
}>((resolve, reject) => {
2255-
localVarRequest(localVarRequestOptions, (error, response, body) => {
2256-
if (error) {
2257-
reject(error);
2258-
} else {
2259-
if (
2260-
response.statusCode &&
2261-
response.statusCode >= 200 &&
2262-
response.statusCode <= 299
2263-
) {
2264-
body = ObjectSerializer.deserialize(
2265-
body,
2266-
"Array<ListActions200ResponseInner>"
2267-
);
2268-
resolve({ response: response, body: body });
2269-
} else {
2270-
reject(new HttpError(response, body, response.statusCode));
2271-
}
2272-
}
2273-
});
2274-
});
2275-
});
22762113
}
2114+
22772115
/**
22782116
*
22792117
* @param authorization
@@ -2294,7 +2132,7 @@ export class DefaultApi {
22942132
)}/operators`,
22952133
authorization,
22962134
undefined, // No request body for GET
2297-
undefined, // No query parameters
2135+
{}, // Empty query parameters
22982136
options
22992137
);
23002138
}
@@ -2317,7 +2155,7 @@ export class DefaultApi {
23172155
`/api/2/mappings/conditions/${encodeURIComponent(conditionValue)}/values`,
23182156
authorization,
23192157
undefined, // No request body for GET
2320-
undefined, // No query parameters
2158+
{}, // Empty query parameters
23212159
options
23222160
);
23232161
}
@@ -2333,91 +2171,16 @@ export class DefaultApi {
23332171
response: http.IncomingMessage;
23342172
body: Array<ListMappingConditions200ResponseInner>;
23352173
}> {
2336-
const localVarPath = this.basePath + "/api/2/mappings/conditions";
2337-
let localVarQueryParameters: any = {};
2338-
let localVarHeaderParams: any = (<any>Object).assign(
2339-
{},
2340-
this._defaultHeaders
2341-
);
2342-
const produces = ["application/json"];
2343-
// give precedence to 'application/json'
2344-
if (produces.indexOf("application/json") >= 0) {
2345-
localVarHeaderParams.Accept = "application/json";
2346-
} else {
2347-
localVarHeaderParams.Accept = produces.join(",");
2348-
}
2349-
let localVarFormParams: any = {};
2350-
2351-
// verify required parameter 'authorization' is not null or undefined
2352-
if (authorization === null || authorization === undefined) {
2353-
throw new Error(
2354-
"Required parameter authorization was null or undefined when calling listMappingConditions."
2355-
);
2356-
}
2357-
2358-
localVarHeaderParams["Authorization"] = ObjectSerializer.serialize(
2174+
return this.request<Array<ListMappingConditions200ResponseInner>>(
2175+
"GET",
2176+
"/api/2/mappings/conditions",
23592177
authorization,
2360-
"string"
2361-
);
2362-
(<any>Object).assign(localVarHeaderParams, options.headers);
2363-
2364-
let localVarUseFormData = false;
2365-
2366-
let localVarRequestOptions: localVarRequest.Options = {
2367-
method: "GET",
2368-
qs: localVarQueryParameters,
2369-
headers: localVarHeaderParams,
2370-
uri: localVarPath,
2371-
useQuerystring: this._useQuerystring,
2372-
json: true,
2373-
};
2374-
2375-
let authenticationPromise = Promise.resolve();
2376-
authenticationPromise = authenticationPromise.then(() =>
2377-
this.authentications.default.applyToRequest(localVarRequestOptions)
2178+
undefined,
2179+
{},
2180+
options
23782181
);
2379-
2380-
let interceptorPromise = authenticationPromise;
2381-
for (const interceptor of this.interceptors) {
2382-
interceptorPromise = interceptorPromise.then(() =>
2383-
interceptor(localVarRequestOptions)
2384-
);
2385-
}
2386-
2387-
return interceptorPromise.then(() => {
2388-
if (Object.keys(localVarFormParams).length) {
2389-
if (localVarUseFormData) {
2390-
(<any>localVarRequestOptions).formData = localVarFormParams;
2391-
} else {
2392-
localVarRequestOptions.form = localVarFormParams;
2393-
}
2394-
}
2395-
return new Promise<{
2396-
response: http.IncomingMessage;
2397-
body: Array<ListMappingConditions200ResponseInner>;
2398-
}>((resolve, reject) => {
2399-
localVarRequest(localVarRequestOptions, (error, response, body) => {
2400-
if (error) {
2401-
reject(error);
2402-
} else {
2403-
if (
2404-
response.statusCode &&
2405-
response.statusCode >= 200 &&
2406-
response.statusCode <= 299
2407-
) {
2408-
body = ObjectSerializer.deserialize(
2409-
body,
2410-
"Array<ListMappingConditions200ResponseInner>"
2411-
);
2412-
resolve({ response: response, body: body });
2413-
} else {
2414-
reject(new HttpError(response, body, response.statusCode));
2415-
}
2416-
}
2417-
});
2418-
});
2419-
});
24202182
}
2183+
24212184
/**
24222185
*
24232186
* @param authorization

0 commit comments

Comments
 (0)