Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Carbon
* Connect external data to LLMs, no matter the source.
*
* 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.carbonai.client.api;
import com.konfigthis.carbonai.client.ApiCallback;
import com.konfigthis.carbonai.client.ApiClient;
import com.konfigthis.carbonai.client.ApiException;
import com.konfigthis.carbonai.client.ApiResponse;
import com.konfigthis.carbonai.client.Configuration;
import com.konfigthis.carbonai.client.Pair;
import com.konfigthis.carbonai.client.ProgressRequestBody;
import com.konfigthis.carbonai.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.konfigthis.carbonai.client.model.AddWebhookProps;
import com.konfigthis.carbonai.client.model.GenericSuccessResponse;
import com.konfigthis.carbonai.client.model.OrderDir;
import com.konfigthis.carbonai.client.model.Pagination;
import com.konfigthis.carbonai.client.model.Webhook;
import com.konfigthis.carbonai.client.model.WebhookFilters;
import com.konfigthis.carbonai.client.model.WebhookOrderByColumns;
import com.konfigthis.carbonai.client.model.WebhookQueryInput;
import com.konfigthis.carbonai.client.model.WebhookQueryResponse;
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 WebhooksApiGenerated {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public WebhooksApiGenerated() throws IllegalArgumentException {
this(Configuration.getDefaultApiClient());
}
public WebhooksApiGenerated(ApiClient apiClient) throws IllegalArgumentException {
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 addUrlCall(AddWebhookProps addWebhookProps, 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 = addWebhookProps;
// create path and map variables
String localVarPath = "/add_webhook";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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[] { "apiKey" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addUrlValidateBeforeCall(AddWebhookProps addWebhookProps, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'addWebhookProps' is set
if (addWebhookProps == null) {
throw new ApiException("Missing the required parameter 'addWebhookProps' when calling addUrl(Async)");
}
return addUrlCall(addWebhookProps, _callback);
}
private ApiResponse addUrlWithHttpInfo(AddWebhookProps addWebhookProps) throws ApiException {
okhttp3.Call localVarCall = addUrlValidateBeforeCall(addWebhookProps, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call addUrlAsync(AddWebhookProps addWebhookProps, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addUrlValidateBeforeCall(addWebhookProps, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class AddUrlRequestBuilderGenerated {
final String url;
public AddUrlRequestBuilderGenerated(String url) {
this.url = url;
}
/**
* Build call for addUrl
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
AddWebhookProps addWebhookProps = buildBodyParams();
return addUrlCall(addWebhookProps, _callback);
}
private AddWebhookProps buildBodyParams() {
AddWebhookProps addWebhookProps = new AddWebhookProps();
addWebhookProps.url(this.url);
return addWebhookProps;
}
/**
* Execute addUrl request
* @return Webhook
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public Webhook execute() throws ApiException {
AddWebhookProps addWebhookProps = buildBodyParams();
ApiResponse localVarResp = addUrlWithHttpInfo(addWebhookProps);
return localVarResp.getResponseBody();
}
/**
* Execute addUrl request with HTTP info returned
* @return ApiResponse<Webhook>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
AddWebhookProps addWebhookProps = buildBodyParams();
return addUrlWithHttpInfo(addWebhookProps);
}
/**
* Execute addUrl 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
*/
public WebhooksApi.AddUrlRequestBuilder addUrl(String url) throws IllegalArgumentException {
if (url == null) throw new IllegalArgumentException("\"url\" is required but got null");
return ((WebhooksApi) this).new AddUrlRequestBuilder(url);
}
private okhttp3.Call deleteUrlCall(Integer webhookId, 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 = "/delete_webhook/{webhook_id}"
.replace("{" + "webhook_id" + "}", localVarApiClient.escapeString(webhookId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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[] { "apiKey" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteUrlValidateBeforeCall(Integer webhookId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookId' is set
if (webhookId == null) {
throw new ApiException("Missing the required parameter 'webhookId' when calling deleteUrl(Async)");
}
return deleteUrlCall(webhookId, _callback);
}
private ApiResponse deleteUrlWithHttpInfo(Integer webhookId) throws ApiException {
okhttp3.Call localVarCall = deleteUrlValidateBeforeCall(webhookId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteUrlAsync(Integer webhookId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteUrlValidateBeforeCall(webhookId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class DeleteUrlRequestBuilderGenerated {
final Integer webhookId;
public DeleteUrlRequestBuilderGenerated(Integer webhookId) {
this.webhookId = webhookId;
}
/**
* Build call for deleteUrl
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteUrlCall(webhookId, _callback);
}
/**
* Execute deleteUrl request
* @return GenericSuccessResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public GenericSuccessResponse execute() throws ApiException {
ApiResponse localVarResp = deleteUrlWithHttpInfo(webhookId);
return localVarResp.getResponseBody();
}
/**
* Execute deleteUrl request with HTTP info returned
* @return ApiResponse<GenericSuccessResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteUrlWithHttpInfo(webhookId);
}
/**
* Execute deleteUrl 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
*/
public WebhooksApi.DeleteUrlRequestBuilder deleteUrl(Integer webhookId) throws IllegalArgumentException {
if (webhookId == null) throw new IllegalArgumentException("\"webhookId\" is required but got null");
return ((WebhooksApi) this).new DeleteUrlRequestBuilder(webhookId);
}
private okhttp3.Call urlsCall(WebhookQueryInput webhookQueryInput, 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 = webhookQueryInput;
// create path and map variables
String localVarPath = "/webhooks";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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[] { "apiKey" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call urlsValidateBeforeCall(WebhookQueryInput webhookQueryInput, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'webhookQueryInput' is set
if (webhookQueryInput == null) {
throw new ApiException("Missing the required parameter 'webhookQueryInput' when calling urls(Async)");
}
return urlsCall(webhookQueryInput, _callback);
}
private ApiResponse urlsWithHttpInfo(WebhookQueryInput webhookQueryInput) throws ApiException {
okhttp3.Call localVarCall = urlsValidateBeforeCall(webhookQueryInput, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call urlsAsync(WebhookQueryInput webhookQueryInput, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = urlsValidateBeforeCall(webhookQueryInput, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class UrlsRequestBuilderGenerated {
Pagination pagination;
WebhookOrderByColumns orderBy;
OrderDir orderDir;
WebhookFilters filters;
public UrlsRequestBuilderGenerated() {
}
/**
* Set pagination
* @param pagination (optional)
* @return WebhooksApi.UrlsRequestBuilder
*/
public WebhooksApi.UrlsRequestBuilder pagination(Pagination pagination) {
this.pagination = pagination;
return (WebhooksApi.UrlsRequestBuilder) this;
}
/**
* Set orderBy
* @param orderBy (optional)
* @return WebhooksApi.UrlsRequestBuilder
*/
public WebhooksApi.UrlsRequestBuilder orderBy(WebhookOrderByColumns orderBy) {
this.orderBy = orderBy;
return (WebhooksApi.UrlsRequestBuilder) this;
}
/**
* Set orderDir
* @param orderDir (optional)
* @return WebhooksApi.UrlsRequestBuilder
*/
public WebhooksApi.UrlsRequestBuilder orderDir(OrderDir orderDir) {
this.orderDir = orderDir;
return (WebhooksApi.UrlsRequestBuilder) this;
}
/**
* Set filters
* @param filters (optional)
* @return WebhooksApi.UrlsRequestBuilder
*/
public WebhooksApi.UrlsRequestBuilder filters(WebhookFilters filters) {
this.filters = filters;
return (WebhooksApi.UrlsRequestBuilder) this;
}
/**
* Build call for urls
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
WebhookQueryInput webhookQueryInput = buildBodyParams();
return urlsCall(webhookQueryInput, _callback);
}
private WebhookQueryInput buildBodyParams() {
WebhookQueryInput webhookQueryInput = new WebhookQueryInput();
webhookQueryInput.pagination(this.pagination);
webhookQueryInput.orderBy(this.orderBy);
webhookQueryInput.orderDir(this.orderDir);
webhookQueryInput.filters(this.filters);
return webhookQueryInput;
}
/**
* Execute urls request
* @return WebhookQueryResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public WebhookQueryResponse execute() throws ApiException {
WebhookQueryInput webhookQueryInput = buildBodyParams();
ApiResponse localVarResp = urlsWithHttpInfo(webhookQueryInput);
return localVarResp.getResponseBody();
}
/**
* Execute urls request with HTTP info returned
* @return ApiResponse<WebhookQueryResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
200
Successful Response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
WebhookQueryInput webhookQueryInput = buildBodyParams();
return urlsWithHttpInfo(webhookQueryInput);
}
/**
* Execute urls 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