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

com.konfigthis.carbonai.client.api.OrganizationsApiGenerated 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.34
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.DataSourceConfiguration;
import com.konfigthis.carbonai.client.model.GenericSuccessResponse;
import com.konfigthis.carbonai.client.model.OrganizationResponse;
import com.konfigthis.carbonai.client.model.UpdateOrganizationInput;
import com.konfigthis.carbonai.client.model.UserConfigurationNullable;

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

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

    public OrganizationsApiGenerated(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 getCall(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 = "/organization";

        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, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

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

    }


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

    private okhttp3.Call getAsync(final ApiCallback _callback) throws ApiException {

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

    public abstract class GetRequestBuilderGenerated {

        public GetRequestBuilderGenerated() {
        }

        /**
         * Build call for get
         * @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 getCall(_callback); } /** * Execute get request * @return OrganizationResponse * @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 OrganizationResponse execute() throws ApiException { ApiResponse localVarResp = getWithHttpInfo(); return localVarResp.getResponseBody(); } /** * Execute get request with HTTP info returned * @return ApiResponse<OrganizationResponse> * @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 getWithHttpInfo(); } /** * Execute get 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 { return getAsync(_callback); } } /** * Get Organization * * @return GetRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public OrganizationsApi.GetRequestBuilder get() throws IllegalArgumentException { return ((OrganizationsApi) this).new GetRequestBuilder(); } private okhttp3.Call updateCall(UpdateOrganizationInput updateOrganizationInput, 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 = updateOrganizationInput; // create path and map variables String localVarPath = "/organization/update"; 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 updateValidateBeforeCall(UpdateOrganizationInput updateOrganizationInput, final ApiCallback _callback) throws ApiException { // verify the required parameter 'updateOrganizationInput' is set if (updateOrganizationInput == null) { throw new ApiException("Missing the required parameter 'updateOrganizationInput' when calling update(Async)"); } return updateCall(updateOrganizationInput, _callback); } private ApiResponse updateWithHttpInfo(UpdateOrganizationInput updateOrganizationInput) throws ApiException { okhttp3.Call localVarCall = updateValidateBeforeCall(updateOrganizationInput, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateAsync(UpdateOrganizationInput updateOrganizationInput, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateValidateBeforeCall(updateOrganizationInput, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class UpdateRequestBuilderGenerated { UserConfigurationNullable globalUserConfig; Map dataSourceConfigs; public UpdateRequestBuilderGenerated() { } /** * Set globalUserConfig * @param globalUserConfig (optional) * @return OrganizationsApi.UpdateRequestBuilder */ public OrganizationsApi.UpdateRequestBuilder globalUserConfig(UserConfigurationNullable globalUserConfig) { this.globalUserConfig = globalUserConfig; return (OrganizationsApi.UpdateRequestBuilder) this; } /** * Set dataSourceConfigs * @param dataSourceConfigs Used to set organization level defaults for configuration related to data sources. (optional) * @return OrganizationsApi.UpdateRequestBuilder */ public OrganizationsApi.UpdateRequestBuilder dataSourceConfigs(Map dataSourceConfigs) { this.dataSourceConfigs = dataSourceConfigs; return (OrganizationsApi.UpdateRequestBuilder) this; } /** * Build call for update * @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 { UpdateOrganizationInput updateOrganizationInput = buildBodyParams(); return updateCall(updateOrganizationInput, _callback); } private UpdateOrganizationInput buildBodyParams() { UpdateOrganizationInput updateOrganizationInput = new UpdateOrganizationInput(); updateOrganizationInput.globalUserConfig(this.globalUserConfig); updateOrganizationInput.dataSourceConfigs(this.dataSourceConfigs); return updateOrganizationInput; } /** * Execute update 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 { UpdateOrganizationInput updateOrganizationInput = buildBodyParams(); ApiResponse localVarResp = updateWithHttpInfo(updateOrganizationInput); return localVarResp.getResponseBody(); } /** * Execute update 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 { UpdateOrganizationInput updateOrganizationInput = buildBodyParams(); return updateWithHttpInfo(updateOrganizationInput); } /** * Execute update 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 { UpdateOrganizationInput updateOrganizationInput = buildBodyParams(); return updateAsync(updateOrganizationInput, _callback); } } /** * Update Organization * * @param updateOrganizationInput (required) * @return UpdateRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public OrganizationsApi.UpdateRequestBuilder update() throws IllegalArgumentException { return ((OrganizationsApi) this).new UpdateRequestBuilder(); } private okhttp3.Call updateStatsCall(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 = "/organization/statistics"; 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateStatsValidateBeforeCall(final ApiCallback _callback) throws ApiException { return updateStatsCall(_callback); } private ApiResponse updateStatsWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = updateStatsValidateBeforeCall(null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call updateStatsAsync(final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateStatsValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class UpdateStatsRequestBuilderGenerated { public UpdateStatsRequestBuilderGenerated() { } /** * Build call for updateStats * @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 updateStatsCall(_callback); } /** * Execute updateStats 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 = updateStatsWithHttpInfo(); return localVarResp.getResponseBody(); } /** * Execute updateStats 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 updateStatsWithHttpInfo(); } /** * Execute updateStats 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 { return updateStatsAsync(_callback); } } /** * Update Organization Statistics * Use this endpoint to reaggregate the statistics for an organization, for example aggregate_file_size. The reaggregation process is asyncronous so a webhook will be sent with the event type being FILE_STATISTICS_AGGREGATED to notify when the process is complee. After this aggregation is complete, the updated statistics can be retrieved using the /organization endpoint. The response of /organization willalso contain a timestamp of the last time the statistics were reaggregated. * @return UpdateStatsRequestBuilder * @http.response.details
Status Code Description Response Headers
200 Successful Response -
*/ public OrganizationsApi.UpdateStatsRequestBuilder updateStats() throws IllegalArgumentException { return ((OrganizationsApi) this).new UpdateStatsRequestBuilder(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy