/*
 * Daytona
 * Daytona AI platform API Docs
 *
 * The version of the OpenAPI document: 1.0
 * Contact: support@daytona.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.daytona.api.client.api;

import io.daytona.api.client.ApiCallback;
import io.daytona.api.client.ApiClient;
import io.daytona.api.client.ApiException;
import io.daytona.api.client.ApiResponse;
import io.daytona.api.client.Configuration;
import io.daytona.api.client.Pair;
import io.daytona.api.client.ProgressRequestBody;
import io.daytona.api.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.daytona.api.client.model.AccountProvider;
import io.daytona.api.client.model.CreateLinkedAccount;
import io.daytona.api.client.model.User;

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

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

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

    public UsersApi(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 enrollInSmsMfa
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> SMS MFA enrollment URL </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call enrollInSmsMfaCall(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 = "/users/mfa/sms/enroll";

        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 = {
            "application/json"
        };
        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[] { "bearer", "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call enrollInSmsMfaValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return enrollInSmsMfaCall(_callback);

    }

    /**
     * Enroll in SMS MFA
     * 
     * @return String
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> SMS MFA enrollment URL </td><td>  -  </td></tr>
     </table>
     */
    public String enrollInSmsMfa() throws ApiException {
        ApiResponse<String> localVarResp = enrollInSmsMfaWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * Enroll in SMS MFA
     * 
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> SMS MFA enrollment URL </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<String> enrollInSmsMfaWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = enrollInSmsMfaValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Enroll in SMS MFA (asynchronously)
     * 
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> SMS MFA enrollment URL </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call enrollInSmsMfaAsync(final ApiCallback<String> _callback) throws ApiException {

        okhttp3.Call localVarCall = enrollInSmsMfaValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<String>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAuthenticatedUser
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> User details </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAuthenticatedUserCall(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 = "/users/me";

        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 = {
            "application/json"
        };
        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[] { "bearer", "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAuthenticatedUserValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return getAuthenticatedUserCall(_callback);

    }

    /**
     * Get authenticated user
     * 
     * @return User
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> User details </td><td>  -  </td></tr>
     </table>
     */
    public User getAuthenticatedUser() throws ApiException {
        ApiResponse<User> localVarResp = getAuthenticatedUserWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * Get authenticated user
     * 
     * @return ApiResponse&lt;User&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> User details </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<User> getAuthenticatedUserWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = getAuthenticatedUserValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<User>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get authenticated user (asynchronously)
     * 
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> User details </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAuthenticatedUserAsync(final ApiCallback<User> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAuthenticatedUserValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<User>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getAvailableAccountProviders
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Available account providers </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAvailableAccountProvidersCall(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 = "/users/account-providers";

        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 = {
            "application/json"
        };
        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[] { "bearer", "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getAvailableAccountProvidersValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        return getAvailableAccountProvidersCall(_callback);

    }

    /**
     * Get available account providers
     * 
     * @return List&lt;AccountProvider&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Available account providers </td><td>  -  </td></tr>
     </table>
     */
    public List<AccountProvider> getAvailableAccountProviders() throws ApiException {
        ApiResponse<List<AccountProvider>> localVarResp = getAvailableAccountProvidersWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * Get available account providers
     * 
     * @return ApiResponse&lt;List&lt;AccountProvider&gt;&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Available account providers </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<List<AccountProvider>> getAvailableAccountProvidersWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = getAvailableAccountProvidersValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<List<AccountProvider>>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get available account providers (asynchronously)
     * 
     * @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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Available account providers </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getAvailableAccountProvidersAsync(final ApiCallback<List<AccountProvider>> _callback) throws ApiException {

        okhttp3.Call localVarCall = getAvailableAccountProvidersValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<List<AccountProvider>>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for linkAccount
     * @param createLinkedAccount  (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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account linked successfully </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call linkAccountCall(@javax.annotation.Nonnull CreateLinkedAccount createLinkedAccount, 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 = createLinkedAccount;

        // create path and map variables
        String localVarPath = "/users/linked-accounts";

        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 = {
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

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

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

    @SuppressWarnings("rawtypes")
    private okhttp3.Call linkAccountValidateBeforeCall(@javax.annotation.Nonnull CreateLinkedAccount createLinkedAccount, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'createLinkedAccount' is set
        if (createLinkedAccount == null) {
            throw new ApiException("Missing the required parameter 'createLinkedAccount' when calling linkAccount(Async)");
        }

        return linkAccountCall(createLinkedAccount, _callback);

    }

    /**
     * Link account
     * 
     * @param createLinkedAccount  (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account linked successfully </td><td>  -  </td></tr>
     </table>
     */
    public void linkAccount(@javax.annotation.Nonnull CreateLinkedAccount createLinkedAccount) throws ApiException {
        linkAccountWithHttpInfo(createLinkedAccount);
    }

    /**
     * Link account
     * 
     * @param createLinkedAccount  (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account linked successfully </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> linkAccountWithHttpInfo(@javax.annotation.Nonnull CreateLinkedAccount createLinkedAccount) throws ApiException {
        okhttp3.Call localVarCall = linkAccountValidateBeforeCall(createLinkedAccount, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Link account (asynchronously)
     * 
     * @param createLinkedAccount  (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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account linked successfully </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call linkAccountAsync(@javax.annotation.Nonnull CreateLinkedAccount createLinkedAccount, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = linkAccountValidateBeforeCall(createLinkedAccount, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for unlinkAccount
     * @param provider  (required)
     * @param providerUserId  (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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account unlinked successfully </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call unlinkAccountCall(@javax.annotation.Nonnull String provider, @javax.annotation.Nonnull String providerUserId, 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 = "/users/linked-accounts/{provider}/{providerUserId}"
            .replace("{" + "provider" + "}", localVarApiClient.escapeString(provider.toString()))
            .replace("{" + "providerUserId" + "}", localVarApiClient.escapeString(providerUserId.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 = {
        };
        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[] { "bearer", "oauth2" };
        return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call unlinkAccountValidateBeforeCall(@javax.annotation.Nonnull String provider, @javax.annotation.Nonnull String providerUserId, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'provider' is set
        if (provider == null) {
            throw new ApiException("Missing the required parameter 'provider' when calling unlinkAccount(Async)");
        }

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

        return unlinkAccountCall(provider, providerUserId, _callback);

    }

    /**
     * Unlink account
     * 
     * @param provider  (required)
     * @param providerUserId  (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account unlinked successfully </td><td>  -  </td></tr>
     </table>
     */
    public void unlinkAccount(@javax.annotation.Nonnull String provider, @javax.annotation.Nonnull String providerUserId) throws ApiException {
        unlinkAccountWithHttpInfo(provider, providerUserId);
    }

    /**
     * Unlink account
     * 
     * @param provider  (required)
     * @param providerUserId  (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account unlinked successfully </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> unlinkAccountWithHttpInfo(@javax.annotation.Nonnull String provider, @javax.annotation.Nonnull String providerUserId) throws ApiException {
        okhttp3.Call localVarCall = unlinkAccountValidateBeforeCall(provider, providerUserId, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Unlink account (asynchronously)
     * 
     * @param provider  (required)
     * @param providerUserId  (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 border="1">
       <caption>Response Details</caption>
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 204 </td><td> Account unlinked successfully </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call unlinkAccountAsync(@javax.annotation.Nonnull String provider, @javax.annotation.Nonnull String providerUserId, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = unlinkAccountValidateBeforeCall(provider, providerUserId, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
}
