/*
 * Echo Server API
 * Echo Server API
 *
 * The version of the OpenAPI document: 0.1.0
 * Contact: team@openapitools.org
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.openapitools.client.model.StringEnumRef;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PathApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

    public PathApi() {
        this(Configuration.getDefaultApiClient());
    }

    public PathApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    /**
     * Build call for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath
     * @param pathString  (required)
     * @param pathInteger  (required)
     * @param enumNonrefStringPath  (required)
     * @param enumRefStringPath  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Successful operation </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathCall(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath, final ApiCallback _callback) throws ApiException {
        String basePath = null;
        // Operation Servers
        String[] localBasePaths = new String[] {  };

        // Determine Base Path to Use
        if (localCustomBaseUrl != null){
            basePath = localCustomBaseUrl;
        } else if ( localBasePaths.length > 0 ) {
            basePath = localBasePaths[localHostIndex];
        } else {
            basePath = null;
        }

        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}"
            .replace("{" + "path_string" + "}", localVarApiClient.escapeString(pathString.toString()))
            .replace("{" + "path_integer" + "}", localVarApiClient.escapeString(pathInteger.toString()))
            .replace("{" + "enum_nonref_string_path" + "}", localVarApiClient.escapeString(enumNonrefStringPath.toString()))
            .replace("{" + "enum_ref_string_path" + "}", localVarApiClient.escapeString(enumRefStringPath.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        final String[] localVarAccepts = {
            "text/plain"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

        String[] localVarAuthNames = new String[] {  };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathValidateBeforeCall(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'pathString' is set
        if (pathString == null) {
            throw new ApiException("Missing the required parameter 'pathString' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(Async)");
        }

        // verify the required parameter 'pathInteger' is set
        if (pathInteger == null) {
            throw new ApiException("Missing the required parameter 'pathInteger' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(Async)");
        }

        // verify the required parameter 'enumNonrefStringPath' is set
        if (enumNonrefStringPath == null) {
            throw new ApiException("Missing the required parameter 'enumNonrefStringPath' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(Async)");
        }

        // verify the required parameter 'enumRefStringPath' is set
        if (enumRefStringPath == null) {
            throw new ApiException("Missing the required parameter 'enumRefStringPath' when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(Async)");
        }

        return testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathCall(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath, _callback);

    }

    /**
     * Test path parameter(s)
     * Test path parameter(s)
     * @param pathString  (required)
     * @param pathInteger  (required)
     * @param enumNonrefStringPath  (required)
     * @param enumRefStringPath  (required)
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Successful operation </td><td>  -  </td></tr>
     </table>
     */
    public String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws ApiException {
        ApiResponse<String> localVarResp = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath);
        return localVarResp.getData();
    }

    /**
     * Test path parameter(s)
     * Test path parameter(s)
     * @param pathString  (required)
     * @param pathInteger  (required)
     * @param enumNonrefStringPath  (required)
     * @param enumRefStringPath  (required)
     * @return ApiResponse&lt;String&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Successful operation </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<String> testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath) throws ApiException {
        okhttp3.Call localVarCall = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathValidateBeforeCall(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath, null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Test path parameter(s) (asynchronously)
     * Test path parameter(s)
     * @param pathString  (required)
     * @param pathInteger  (required)
     * @param enumNonrefStringPath  (required)
     * @param enumRefStringPath  (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Successful operation </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsync(String pathString, Integer pathInteger, String enumNonrefStringPath, StringEnumRef enumRefStringPath, final ApiCallback<String> _callback) throws ApiException {

        okhttp3.Call localVarCall = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathValidateBeforeCall(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath, _callback);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
