java/src/main/java/com/konfigthis/dojah/client/api/WebHooksApi.java
/*
 * DOJAH APIs
 * Use Dojah to verify, onboard and manage user identity across Africa!
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
 * Do not edit the class manually.
 */


package com.konfigthis.dojah.client.api;

import com.konfigthis.dojah.client.ApiCallback;
import com.konfigthis.dojah.client.ApiClient;
import com.konfigthis.dojah.client.ApiException;
import com.konfigthis.dojah.client.ApiResponse;
import com.konfigthis.dojah.client.Configuration;
import com.konfigthis.dojah.client.Pair;
import com.konfigthis.dojah.client.ProgressRequestBody;
import com.konfigthis.dojah.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import com.konfigthis.dojah.client.model.DeleteWebhookResponse;
import com.konfigthis.dojah.client.model.GetWebhooksResponse;
import com.konfigthis.dojah.client.model.NotifyWebhookRequest;
import com.konfigthis.dojah.client.model.NotifyWebhookRequestData;
import com.konfigthis.dojah.client.model.NotifyWebhookResponse;
import com.konfigthis.dojah.client.model.SubscribeServiceRequest;
import com.konfigthis.dojah.client.model.SubscribeServiceResponse;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;

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

    public WebHooksApi() throws IllegalArgumentException {
        this(Configuration.getDefaultApiClient());
    }

    public WebHooksApi(ApiClient apiClient) throws IllegalArgumentException {
        if (apiClient.getApikeyAuth() == null) {
            throw new IllegalArgumentException("\"Authorization\" is required but no API key was provided. Please set \"Authorization\" with ApiClient#setApikeyAuth(String).");
        }
        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;
    }

    private okhttp3.Call deleteWebhookCall(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 = "/api/v1/webhook/delete";

        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[] { "apikeyAuth", "appIdAuth" };
        return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

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

    }


    private ApiResponse<DeleteWebhookResponse> deleteWebhookWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<DeleteWebhookResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call deleteWebhookAsync(final ApiCallback<DeleteWebhookResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteWebhookValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<DeleteWebhookResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class DeleteWebhookRequestBuilder {

        private DeleteWebhookRequestBuilder() {
        }

        /**
         * Build call for deleteWebhook
         * @param _callback ApiCallback API callback
         * @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 response </td><td>  -  </td></tr>
         </table>
         */
        public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
            return deleteWebhookCall(_callback);
        }


        /**
         * Execute deleteWebhook request
         * @return DeleteWebhookResponse
         * @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 response </td><td>  -  </td></tr>
         </table>
         */
        public DeleteWebhookResponse execute() throws ApiException {
            ApiResponse<DeleteWebhookResponse> localVarResp = deleteWebhookWithHttpInfo();
            return localVarResp.getData();
        }

        /**
         * Execute deleteWebhook request with HTTP info returned
         * @return ApiResponse&lt;DeleteWebhookResponse&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 response </td><td>  -  </td></tr>
         </table>
         */
        public ApiResponse<DeleteWebhookResponse> executeWithHttpInfo() throws ApiException {
            return deleteWebhookWithHttpInfo();
        }

        /**
         * Execute deleteWebhook request (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 summary="Response Details" border="1">
            <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
            <tr><td> 200 </td><td> Successful response </td><td>  -  </td></tr>
         </table>
         */
        public okhttp3.Call executeAsync(final ApiCallback<DeleteWebhookResponse> _callback) throws ApiException {
            return deleteWebhookAsync(_callback);
        }
    }

    /**
     * Delete Webhook
     * 
     * @return DeleteWebhookRequestBuilder
     * @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 response </td><td>  -  </td></tr>
     </table>
     */
    public DeleteWebhookRequestBuilder deleteWebhook() throws IllegalArgumentException {
        return new DeleteWebhookRequestBuilder();
    }
    private okhttp3.Call getWebhooksCall(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 = "/api/v1/webhook/fetch";

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

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

    }


    private ApiResponse<GetWebhooksResponse> getWebhooksWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<GetWebhooksResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call getWebhooksAsync(final ApiCallback<GetWebhooksResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getWebhooksValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<GetWebhooksResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class GetWebhooksRequestBuilder {

        private GetWebhooksRequestBuilder() {
        }

        /**
         * Build call for getWebhooks
         * @param _callback ApiCallback API callback
         * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * access-control-allow-origin -  <br>  * x-moesif-transaction-id -  <br>  * etag -  <br>  * vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
            return getWebhooksCall(_callback);
        }


        /**
         * Execute getWebhooks request
         * @return GetWebhooksResponse
         * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * access-control-allow-origin -  <br>  * x-moesif-transaction-id -  <br>  * etag -  <br>  * vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public GetWebhooksResponse execute() throws ApiException {
            ApiResponse<GetWebhooksResponse> localVarResp = getWebhooksWithHttpInfo();
            return localVarResp.getData();
        }

        /**
         * Execute getWebhooks request with HTTP info returned
         * @return ApiResponse&lt;GetWebhooksResponse&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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * access-control-allow-origin -  <br>  * x-moesif-transaction-id -  <br>  * etag -  <br>  * vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public ApiResponse<GetWebhooksResponse> executeWithHttpInfo() throws ApiException {
            return getWebhooksWithHttpInfo();
        }

        /**
         * Execute getWebhooks request (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 summary="Response Details" border="1">
            <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
            <tr><td> 200 </td><td> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * access-control-allow-origin -  <br>  * x-moesif-transaction-id -  <br>  * etag -  <br>  * vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call executeAsync(final ApiCallback<GetWebhooksResponse> _callback) throws ApiException {
            return getWebhooksAsync(_callback);
        }
    }

    /**
     * Fetch All Webhooks
     * 
     * @return GetWebhooksRequestBuilder
     * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * access-control-allow-origin -  <br>  * x-moesif-transaction-id -  <br>  * etag -  <br>  * vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
     </table>
     */
    public GetWebhooksRequestBuilder getWebhooks() throws IllegalArgumentException {
        return new GetWebhooksRequestBuilder();
    }
    private okhttp3.Call notifyWebhookCall(NotifyWebhookRequest notifyWebhookRequest, 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 = notifyWebhookRequest;

        // create path and map variables
        String localVarPath = "/api/v1/webhook/notify";

        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 = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

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

    @SuppressWarnings("rawtypes")
    private okhttp3.Call notifyWebhookValidateBeforeCall(NotifyWebhookRequest notifyWebhookRequest, final ApiCallback _callback) throws ApiException {
        return notifyWebhookCall(notifyWebhookRequest, _callback);

    }


    private ApiResponse<NotifyWebhookResponse> notifyWebhookWithHttpInfo(NotifyWebhookRequest notifyWebhookRequest) throws ApiException {
        okhttp3.Call localVarCall = notifyWebhookValidateBeforeCall(notifyWebhookRequest, null);
        Type localVarReturnType = new TypeToken<NotifyWebhookResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call notifyWebhookAsync(NotifyWebhookRequest notifyWebhookRequest, final ApiCallback<NotifyWebhookResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = notifyWebhookValidateBeforeCall(notifyWebhookRequest, _callback);
        Type localVarReturnType = new TypeToken<NotifyWebhookResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class NotifyWebhookRequestBuilder {
        private String subject;
        private NotifyWebhookRequestData data;

        private NotifyWebhookRequestBuilder() {
        }

        /**
         * Set subject
         * @param subject  (optional)
         * @return NotifyWebhookRequestBuilder
         */
        public NotifyWebhookRequestBuilder subject(String subject) {
            this.subject = subject;
            return this;
        }
        
        /**
         * Set data
         * @param data  (optional)
         * @return NotifyWebhookRequestBuilder
         */
        public NotifyWebhookRequestBuilder data(NotifyWebhookRequestData data) {
            this.data = data;
            return this;
        }
        
        /**
         * Build call for notifyWebhook
         * @param _callback ApiCallback API callback
         * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * Access-Control-Allow-Origin -  <br>  * x-moesif-transaction-id -  <br>  * ETag -  <br>  * Vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
            NotifyWebhookRequest notifyWebhookRequest = buildBodyParams();
            return notifyWebhookCall(notifyWebhookRequest, _callback);
        }

        private NotifyWebhookRequest buildBodyParams() {
            NotifyWebhookRequest notifyWebhookRequest = new NotifyWebhookRequest();
            notifyWebhookRequest.subject(this.subject);
            notifyWebhookRequest.data(this.data);
            return notifyWebhookRequest;
        }

        /**
         * Execute notifyWebhook request
         * @return NotifyWebhookResponse
         * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * Access-Control-Allow-Origin -  <br>  * x-moesif-transaction-id -  <br>  * ETag -  <br>  * Vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public NotifyWebhookResponse execute() throws ApiException {
            NotifyWebhookRequest notifyWebhookRequest = buildBodyParams();
            ApiResponse<NotifyWebhookResponse> localVarResp = notifyWebhookWithHttpInfo(notifyWebhookRequest);
            return localVarResp.getData();
        }

        /**
         * Execute notifyWebhook request with HTTP info returned
         * @return ApiResponse&lt;NotifyWebhookResponse&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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * Access-Control-Allow-Origin -  <br>  * x-moesif-transaction-id -  <br>  * ETag -  <br>  * Vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public ApiResponse<NotifyWebhookResponse> executeWithHttpInfo() throws ApiException {
            NotifyWebhookRequest notifyWebhookRequest = buildBodyParams();
            return notifyWebhookWithHttpInfo(notifyWebhookRequest);
        }

        /**
         * Execute notifyWebhook request (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 summary="Response Details" border="1">
            <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
            <tr><td> 200 </td><td> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * Access-Control-Allow-Origin -  <br>  * x-moesif-transaction-id -  <br>  * ETag -  <br>  * Vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call executeAsync(final ApiCallback<NotifyWebhookResponse> _callback) throws ApiException {
            NotifyWebhookRequest notifyWebhookRequest = buildBodyParams();
            return notifyWebhookAsync(notifyWebhookRequest, _callback);
        }
    }

    /**
     * Post Hook
     * 
     * @return NotifyWebhookRequestBuilder
     * @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> OK </td><td>  * Date -  <br>  * Transfer-Encoding -  <br>  * Connection -  <br>  * Access-Control-Allow-Origin -  <br>  * x-moesif-transaction-id -  <br>  * ETag -  <br>  * Vary -  <br>  * CF-Cache-Status -  <br>  * Expect-CT -  <br>  * Report-To -  <br>  * NEL -  <br>  * Server -  <br>  * CF-RAY -  <br>  * Content-Encoding -  <br>  * alt-svc -  <br>  </td></tr>
     </table>
     */
    public NotifyWebhookRequestBuilder notifyWebhook() throws IllegalArgumentException {
        return new NotifyWebhookRequestBuilder();
    }
    private okhttp3.Call subscribeServiceCall(SubscribeServiceRequest subscribeServiceRequest, 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 = subscribeServiceRequest;

        // create path and map variables
        String localVarPath = "/api/v1/webhook/subscribe";

        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 = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        if (localVarContentType != null) {
            localVarHeaderParams.put("Content-Type", localVarContentType);
        }

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

    @SuppressWarnings("rawtypes")
    private okhttp3.Call subscribeServiceValidateBeforeCall(SubscribeServiceRequest subscribeServiceRequest, final ApiCallback _callback) throws ApiException {
        return subscribeServiceCall(subscribeServiceRequest, _callback);

    }


    private ApiResponse<SubscribeServiceResponse> subscribeServiceWithHttpInfo(SubscribeServiceRequest subscribeServiceRequest) throws ApiException {
        okhttp3.Call localVarCall = subscribeServiceValidateBeforeCall(subscribeServiceRequest, null);
        Type localVarReturnType = new TypeToken<SubscribeServiceResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call subscribeServiceAsync(SubscribeServiceRequest subscribeServiceRequest, final ApiCallback<SubscribeServiceResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = subscribeServiceValidateBeforeCall(subscribeServiceRequest, _callback);
        Type localVarReturnType = new TypeToken<SubscribeServiceResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public class SubscribeServiceRequestBuilder {
        private String webhook;
        private String service;

        private SubscribeServiceRequestBuilder() {
        }

        /**
         * Set webhook
         * @param webhook  (optional)
         * @return SubscribeServiceRequestBuilder
         */
        public SubscribeServiceRequestBuilder webhook(String webhook) {
            this.webhook = webhook;
            return this;
        }
        
        /**
         * Set service
         * @param service  (optional)
         * @return SubscribeServiceRequestBuilder
         */
        public SubscribeServiceRequestBuilder service(String service) {
            this.service = service;
            return this;
        }
        
        /**
         * Build call for subscribeService
         * @param _callback ApiCallback API callback
         * @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> OK </td><td>  * X-Powered-By -  <br>  * Access-Control-Allow-Origin -  <br>  * Content-Length -  <br>  * ETag -  <br>  * Date -  <br>  * Connection -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
            SubscribeServiceRequest subscribeServiceRequest = buildBodyParams();
            return subscribeServiceCall(subscribeServiceRequest, _callback);
        }

        private SubscribeServiceRequest buildBodyParams() {
            SubscribeServiceRequest subscribeServiceRequest = new SubscribeServiceRequest();
            subscribeServiceRequest.webhook(this.webhook);
            subscribeServiceRequest.service(this.service);
            return subscribeServiceRequest;
        }

        /**
         * Execute subscribeService request
         * @return SubscribeServiceResponse
         * @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> OK </td><td>  * X-Powered-By -  <br>  * Access-Control-Allow-Origin -  <br>  * Content-Length -  <br>  * ETag -  <br>  * Date -  <br>  * Connection -  <br>  </td></tr>
         </table>
         */
        public SubscribeServiceResponse execute() throws ApiException {
            SubscribeServiceRequest subscribeServiceRequest = buildBodyParams();
            ApiResponse<SubscribeServiceResponse> localVarResp = subscribeServiceWithHttpInfo(subscribeServiceRequest);
            return localVarResp.getData();
        }

        /**
         * Execute subscribeService request with HTTP info returned
         * @return ApiResponse&lt;SubscribeServiceResponse&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> OK </td><td>  * X-Powered-By -  <br>  * Access-Control-Allow-Origin -  <br>  * Content-Length -  <br>  * ETag -  <br>  * Date -  <br>  * Connection -  <br>  </td></tr>
         </table>
         */
        public ApiResponse<SubscribeServiceResponse> executeWithHttpInfo() throws ApiException {
            SubscribeServiceRequest subscribeServiceRequest = buildBodyParams();
            return subscribeServiceWithHttpInfo(subscribeServiceRequest);
        }

        /**
         * Execute subscribeService request (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 summary="Response Details" border="1">
            <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
            <tr><td> 200 </td><td> OK </td><td>  * X-Powered-By -  <br>  * Access-Control-Allow-Origin -  <br>  * Content-Length -  <br>  * ETag -  <br>  * Date -  <br>  * Connection -  <br>  </td></tr>
         </table>
         */
        public okhttp3.Call executeAsync(final ApiCallback<SubscribeServiceResponse> _callback) throws ApiException {
            SubscribeServiceRequest subscribeServiceRequest = buildBodyParams();
            return subscribeServiceAsync(subscribeServiceRequest, _callback);
        }
    }

    /**
     * Subscribe to service
     * 
     * @return SubscribeServiceRequestBuilder
     * @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> OK </td><td>  * X-Powered-By -  <br>  * Access-Control-Allow-Origin -  <br>  * Content-Length -  <br>  * ETag -  <br>  * Date -  <br>  * Connection -  <br>  </td></tr>
     </table>
     */
    public SubscribeServiceRequestBuilder subscribeService() throws IllegalArgumentException {
        return new SubscribeServiceRequestBuilder();
    }
}
