All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.konfigthis.carbonai.client.api.DataSourcesApiGenerated Maven / Gradle / Ivy

Go to download

Connect external data to LLMs, no matter the source. This library was generated by https://konfigthis.com

There is a newer version: 0.1.51
Show newest version
/*
 * 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.GenericSuccessResponse;
import com.konfigthis.carbonai.client.model.OrderDir;
import com.konfigthis.carbonai.client.model.OrganizationUserDataSourceFilters;
import com.konfigthis.carbonai.client.model.OrganizationUserDataSourceOrderByColumns;
import com.konfigthis.carbonai.client.model.OrganizationUserDataSourceQueryInput;
import com.konfigthis.carbonai.client.model.OrganizationUserDataSourceResponse;
import com.konfigthis.carbonai.client.model.Pagination;
import com.konfigthis.carbonai.client.model.RevokeAccessTokenInput;

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 DataSourcesApiGenerated {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

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

    public DataSourcesApiGenerated(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 queryUserDataSourcesCall(OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput, 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 = organizationUserDataSourceQueryInput;

        // create path and map variables
        String localVarPath = "/user_data_sources";

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

    @SuppressWarnings("rawtypes")
    private okhttp3.Call queryUserDataSourcesValidateBeforeCall(OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput, final ApiCallback _callback) throws ApiException {
        // verify the required parameter 'organizationUserDataSourceQueryInput' is set
        if (organizationUserDataSourceQueryInput == null) {
            throw new ApiException("Missing the required parameter 'organizationUserDataSourceQueryInput' when calling queryUserDataSources(Async)");
        }

        return queryUserDataSourcesCall(organizationUserDataSourceQueryInput, _callback);

    }


    private ApiResponse queryUserDataSourcesWithHttpInfo(OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput) throws ApiException {
        okhttp3.Call localVarCall = queryUserDataSourcesValidateBeforeCall(organizationUserDataSourceQueryInput, null);
        Type localVarReturnType = new TypeToken(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    private okhttp3.Call queryUserDataSourcesAsync(OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput, final ApiCallback _callback) throws ApiException {

        okhttp3.Call localVarCall = queryUserDataSourcesValidateBeforeCall(organizationUserDataSourceQueryInput, _callback);
        Type localVarReturnType = new TypeToken(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }

    public abstract class QueryUserDataSourcesRequestBuilderGenerated {
        Pagination pagination;
        OrganizationUserDataSourceOrderByColumns orderBy;
        OrderDir orderDir;
        OrganizationUserDataSourceFilters filters;

        public QueryUserDataSourcesRequestBuilderGenerated() {
        }

        /**
         * Set pagination
         * @param pagination  (optional)
         * @return DataSourcesApi.QueryUserDataSourcesRequestBuilder
         */
        public DataSourcesApi.QueryUserDataSourcesRequestBuilder pagination(Pagination pagination) {
            this.pagination = pagination;
            return (DataSourcesApi.QueryUserDataSourcesRequestBuilder) this;
        }
        
        /**
         * Set orderBy
         * @param orderBy  (optional)
         * @return DataSourcesApi.QueryUserDataSourcesRequestBuilder
         */
        public DataSourcesApi.QueryUserDataSourcesRequestBuilder orderBy(OrganizationUserDataSourceOrderByColumns orderBy) {
            this.orderBy = orderBy;
            return (DataSourcesApi.QueryUserDataSourcesRequestBuilder) this;
        }
        
        /**
         * Set orderDir
         * @param orderDir  (optional)
         * @return DataSourcesApi.QueryUserDataSourcesRequestBuilder
         */
        public DataSourcesApi.QueryUserDataSourcesRequestBuilder orderDir(OrderDir orderDir) {
            this.orderDir = orderDir;
            return (DataSourcesApi.QueryUserDataSourcesRequestBuilder) this;
        }
        
        /**
         * Set filters
         * @param filters  (optional)
         * @return DataSourcesApi.QueryUserDataSourcesRequestBuilder
         */
        public DataSourcesApi.QueryUserDataSourcesRequestBuilder filters(OrganizationUserDataSourceFilters filters) {
            this.filters = filters;
            return (DataSourcesApi.QueryUserDataSourcesRequestBuilder) this;
        }
        
        /**
         * Build call for queryUserDataSources
         * @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 { OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput = buildBodyParams(); return queryUserDataSourcesCall(organizationUserDataSourceQueryInput, _callback); } private OrganizationUserDataSourceQueryInput buildBodyParams() { OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput = new OrganizationUserDataSourceQueryInput(); organizationUserDataSourceQueryInput.pagination(this.pagination); organizationUserDataSourceQueryInput.orderBy(this.orderBy); organizationUserDataSourceQueryInput.orderDir(this.orderDir); organizationUserDataSourceQueryInput.filters(this.filters); return organizationUserDataSourceQueryInput; } /** * Execute queryUserDataSources request * @return OrganizationUserDataSourceResponse * @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 OrganizationUserDataSourceResponse execute() throws ApiException { OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput = buildBodyParams(); ApiResponse localVarResp = queryUserDataSourcesWithHttpInfo(organizationUserDataSourceQueryInput); return localVarResp.getResponseBody(); } /** * Execute queryUserDataSources request with HTTP info returned * @return ApiResponse<OrganizationUserDataSourceResponse> * @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 { OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput = buildBodyParams(); return queryUserDataSourcesWithHttpInfo(organizationUserDataSourceQueryInput); } /** * Execute queryUserDataSources 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
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { OrganizationUserDataSourceQueryInput organizationUserDataSourceQueryInput = buildBodyParams(); return queryUserDataSourcesAsync(organizationUserDataSourceQueryInput, _callback); } } /** * User Data Sources * * @param organizationUserDataSourceQueryInput (required) * @return QueryUserDataSourcesRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public DataSourcesApi.QueryUserDataSourcesRequestBuilder queryUserDataSources() throws IllegalArgumentException { return ((DataSourcesApi) this).new QueryUserDataSourcesRequestBuilder(); } private okhttp3.Call revokeAccessTokenCall(RevokeAccessTokenInput revokeAccessTokenInput, 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 = revokeAccessTokenInput; // create path and map variables String localVarPath = "/revoke_access_token"; 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[] { "accessToken", "apiKey", "customerId" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call revokeAccessTokenValidateBeforeCall(RevokeAccessTokenInput revokeAccessTokenInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'revokeAccessTokenInput' is set if (revokeAccessTokenInput == null) { throw new ApiException("Missing the required parameter 'revokeAccessTokenInput' when calling revokeAccessToken(Async)"); } return revokeAccessTokenCall(revokeAccessTokenInput, _callback); } private ApiResponse revokeAccessTokenWithHttpInfo(RevokeAccessTokenInput revokeAccessTokenInput) throws ApiException { okhttp3.Call localVarCall = revokeAccessTokenValidateBeforeCall(revokeAccessTokenInput, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call revokeAccessTokenAsync(RevokeAccessTokenInput revokeAccessTokenInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = revokeAccessTokenValidateBeforeCall(revokeAccessTokenInput, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class RevokeAccessTokenRequestBuilderGenerated { final Integer dataSourceId; public RevokeAccessTokenRequestBuilderGenerated(Integer dataSourceId) { this.dataSourceId = dataSourceId; } /** * Build call for revokeAccessToken * @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 { RevokeAccessTokenInput revokeAccessTokenInput = buildBodyParams(); return revokeAccessTokenCall(revokeAccessTokenInput, _callback); } private RevokeAccessTokenInput buildBodyParams() { RevokeAccessTokenInput revokeAccessTokenInput = new RevokeAccessTokenInput(); revokeAccessTokenInput.dataSourceId(this.dataSourceId); return revokeAccessTokenInput; } /** * Execute revokeAccessToken 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 { RevokeAccessTokenInput revokeAccessTokenInput = buildBodyParams(); ApiResponse localVarResp = revokeAccessTokenWithHttpInfo(revokeAccessTokenInput); return localVarResp.getResponseBody(); } /** * Execute revokeAccessToken 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 { RevokeAccessTokenInput revokeAccessTokenInput = buildBodyParams(); return revokeAccessTokenWithHttpInfo(revokeAccessTokenInput); } /** * Execute revokeAccessToken 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
Status Code Description Response Headers
200 Successful Response -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { RevokeAccessTokenInput revokeAccessTokenInput = buildBodyParams(); return revokeAccessTokenAsync(revokeAccessTokenInput, _callback); } } /** * Revoke Access Token * * @param revokeAccessTokenInput (required) * @return RevokeAccessTokenRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public DataSourcesApi.RevokeAccessTokenRequestBuilder revokeAccessToken(Integer dataSourceId) throws IllegalArgumentException { if (dataSourceId == null) throw new IllegalArgumentException("\"dataSourceId\" is required but got null"); return ((DataSourcesApi) this).new RevokeAccessTokenRequestBuilder(dataSourceId); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy