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

com.configcat.publicapi.java.client.api.FeatureFlagsSettingsApi Maven / Gradle / Ivy

/*
 * ConfigCat Public Management API
 * The purpose of this API is to access the ConfigCat platform programmatically. You can **Create**, **Read**, **Update** and **Delete** any entities like **Feature Flags, Configs, Environments** or **Products** within ConfigCat.  **Base API URL**: https://api.configcat.com  If you prefer the swagger documentation, you can find it here: [Swagger UI](https://api.configcat.com/swagger).  The API is based on HTTP REST, uses resource-oriented URLs, status codes and supports JSON  format.   **Important:** Do not use this API for accessing and evaluating feature flag values. Use the [SDKs](https://configcat.com/docs/sdk-reference/overview) or the [ConfigCat Proxy](https://configcat.com/docs/advanced/proxy/proxy-overview/) instead.  # OpenAPI Specification  The complete specification is publicly available in the following formats:  - [OpenAPI v3](https://api.configcat.com/docs/v1/swagger.json) - [Swagger v2](https://api.configcat.com/docs/v1/swagger.v2.json)  You can use it to generate client libraries in various languages with [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) or [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) to interact with this API.  # Authentication This API uses the [Basic HTTP Authentication Scheme](https://en.wikipedia.org/wiki/Basic_access_authentication).     # Throttling and rate limits All the rate limited API calls are returning information about the current rate limit period in the following HTTP headers:  | Header | Description | | :- | :- | | X-Rate-Limit-Remaining | The maximum number of requests remaining in the current rate limit period. | | X-Rate-Limit-Reset     | The time when the current rate limit period resets.        |  When the rate limit is exceeded by a request, the API returns with a `HTTP 429 - Too many requests` status along with a `Retry-After` HTTP header.
 *
 * The version of the OpenAPI document: v1
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.configcat.publicapi.java.client.api;


import com.configcat.publicapi.java.client.ApiCallback;
import com.configcat.publicapi.java.client.ApiClient;
import com.configcat.publicapi.java.client.ApiException;
import com.configcat.publicapi.java.client.ApiResponse;
import com.configcat.publicapi.java.client.Configuration;
import com.configcat.publicapi.java.client.Pair;
import com.configcat.publicapi.java.client.model.CreateSettingInitialValues;
import com.configcat.publicapi.java.client.model.JsonPatchOperation;
import com.configcat.publicapi.java.client.model.ReplaceSettingModel;
import com.configcat.publicapi.java.client.model.SettingModel;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

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

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

    public FeatureFlagsSettingsApi(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 createSetting
     *
     * @param configId The identifier of the Config. (required)
     * @param createSettingInitialValues (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
     *     
     * 
     * 
     * 
     * 
     * 
     * 
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call createSettingCall( UUID configId, CreateSettingInitialValues createSettingInitialValues, 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 = createSettingInitialValues; // create path and map variables String localVarPath = "/v1/configs/{configId}/settings" .replace( "{" + "configId" + "}", localVarApiClient.escapeString(configId.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 = { "application/json", "text/json", "application/*+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createSettingValidateBeforeCall( UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { // verify the required parameter 'configId' is set if (configId == null) { throw new ApiException( "Missing the required parameter 'configId' when calling createSetting(Async)"); } // verify the required parameter 'createSettingInitialValues' is set if (createSettingInitialValues == null) { throw new ApiException( "Missing the required parameter 'createSettingInitialValues' when calling" + " createSetting(Async)"); } return createSettingCall(configId, createSettingInitialValues, _callback); } /** * Create Flag This endpoint creates a new Feature Flag or Setting in a specified Config * identified by the `configId` parameter. **Important:** The `key` * attribute must be unique within the given Config. * * @param configId The identifier of the Config. (required) * @param createSettingInitialValues (required) * @return SettingModel * @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
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public SettingModel createSetting( UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { ApiResponse localVarResp = createSettingWithHttpInfo(configId, createSettingInitialValues); return localVarResp.getData(); } /** * Create Flag This endpoint creates a new Feature Flag or Setting in a specified Config * identified by the `configId` parameter. **Important:** The `key` * attribute must be unique within the given Config. * * @param configId The identifier of the Config. (required) * @param createSettingInitialValues (required) * @return ApiResponse<SettingModel> * @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
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse createSettingWithHttpInfo( UUID configId, CreateSettingInitialValues createSettingInitialValues) throws ApiException { okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Create Flag (asynchronously) This endpoint creates a new Feature Flag or Setting in a * specified Config identified by the `configId` parameter. **Important:** The * `key` attribute must be unique within the given Config. * * @param configId The identifier of the Config. (required) * @param createSettingInitialValues (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 * * * * * * *
Status Code Description Response Headers
201 When the creation was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call createSettingAsync( UUID configId, CreateSettingInitialValues createSettingInitialValues, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createSettingValidateBeforeCall(configId, createSettingInitialValues, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteSetting * * @param settingId The identifier of the Setting. (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 * * * * * * *
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call deleteSettingCall(Integer settingId, 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 = "/v1/settings/{settingId}" .replace( "{" + "settingId" + "}", localVarApiClient.escapeString(settingId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); 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[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteSettingValidateBeforeCall( Integer settingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settingId' is set if (settingId == null) { throw new ApiException( "Missing the required parameter 'settingId' when calling deleteSetting(Async)"); } return deleteSettingCall(settingId, _callback); } /** * Delete Flag This endpoint removes a Feature Flag or Setting from a specified Config, * identified by the `configId` parameter. * * @param settingId The identifier of the Setting. (required) * @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
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public void deleteSetting(Integer settingId) throws ApiException { deleteSettingWithHttpInfo(settingId); } /** * Delete Flag This endpoint removes a Feature Flag or Setting from a specified Config, * identified by the `configId` parameter. * * @param settingId The identifier of the Setting. (required) * @return ApiResponse<Void> * @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
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse deleteSettingWithHttpInfo(Integer settingId) throws ApiException { okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, null); return localVarApiClient.execute(localVarCall); } /** * Delete Flag (asynchronously) This endpoint removes a Feature Flag or Setting from a specified * Config, identified by the `configId` parameter. * * @param settingId The identifier of the Setting. (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 * * * * * * *
Status Code Description Response Headers
204 When the delete was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call deleteSettingAsync(Integer settingId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteSettingValidateBeforeCall(settingId, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for getSetting * * @param settingId The identifier of the Setting. (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 * * * * * * *
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call getSettingCall(Integer settingId, 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 = "/v1/settings/{settingId}" .replace( "{" + "settingId" + "}", localVarApiClient.escapeString(settingId.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[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSettingValidateBeforeCall( Integer settingId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settingId' is set if (settingId == null) { throw new ApiException( "Missing the required parameter 'settingId' when calling getSetting(Async)"); } return getSettingCall(settingId, _callback); } /** * Get Flag This endpoint returns the metadata attributes of a Feature Flag or Setting * identified by the `settingId` parameter. * * @param settingId The identifier of the Setting. (required) * @return SettingModel * @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 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public SettingModel getSetting(Integer settingId) throws ApiException { ApiResponse localVarResp = getSettingWithHttpInfo(settingId); return localVarResp.getData(); } /** * Get Flag This endpoint returns the metadata attributes of a Feature Flag or Setting * identified by the `settingId` parameter. * * @param settingId The identifier of the Setting. (required) * @return ApiResponse<SettingModel> * @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 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse getSettingWithHttpInfo(Integer settingId) throws ApiException { okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get Flag (asynchronously) This endpoint returns the metadata attributes of a Feature Flag or * Setting identified by the `settingId` parameter. * * @param settingId The identifier of the Setting. (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 * * * * * * *
Status Code Description Response Headers
200 When everything is ok, the setting data returned. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call getSettingAsync( Integer settingId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getSettingValidateBeforeCall(settingId, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getSettings * * @param configId The identifier of the Config. (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 * * * * * * *
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call getSettingsCall(UUID configId, 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 = "/v1/configs/{configId}/settings" .replace( "{" + "configId" + "}", localVarApiClient.escapeString(configId.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[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getSettingsValidateBeforeCall(UUID configId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'configId' is set if (configId == null) { throw new ApiException( "Missing the required parameter 'configId' when calling getSettings(Async)"); } return getSettingsCall(configId, _callback); } /** * List Flags This endpoint returns the list of the Feature Flags and Settings defined in a * specified Config, identified by the `configId` parameter. * * @param configId The identifier of the Config. (required) * @return List<SettingModel> * @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 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public List getSettings(UUID configId) throws ApiException { ApiResponse> localVarResp = getSettingsWithHttpInfo(configId); return localVarResp.getData(); } /** * List Flags This endpoint returns the list of the Feature Flags and Settings defined in a * specified Config, identified by the `configId` parameter. * * @param configId The identifier of the Config. (required) * @return ApiResponse<List<SettingModel>> * @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 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse> getSettingsWithHttpInfo(UUID configId) throws ApiException { okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, null); Type localVarReturnType = new TypeToken>() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * List Flags (asynchronously) This endpoint returns the list of the Feature Flags and Settings * defined in a specified Config, identified by the `configId` parameter. * * @param configId The identifier of the Config. (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 * * * * * * *
Status Code Description Response Headers
200 -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call getSettingsAsync( UUID configId, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getSettingsValidateBeforeCall(configId, _callback); Type localVarReturnType = new TypeToken>() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for replaceSetting * * @param settingId The identifier of the Setting. (required) * @param replaceSettingModel (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 * * * * * * *
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call replaceSettingCall( Integer settingId, ReplaceSettingModel replaceSettingModel, 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 = replaceSettingModel; // create path and map variables String localVarPath = "/v1/settings/{settingId}" .replace( "{" + "settingId" + "}", localVarApiClient.escapeString(settingId.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 = { "application/json", "text/json", "application/*+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call replaceSettingValidateBeforeCall( Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settingId' is set if (settingId == null) { throw new ApiException( "Missing the required parameter 'settingId' when calling" + " replaceSetting(Async)"); } // verify the required parameter 'replaceSettingModel' is set if (replaceSettingModel == null) { throw new ApiException( "Missing the required parameter 'replaceSettingModel' when calling" + " replaceSetting(Async)"); } return replaceSettingCall(settingId, replaceSettingModel, _callback); } /** * Replace Flag This endpoint replaces the whole value of a Feature Flag or Setting identified * by the `settingId` parameter. **Important:** As this endpoint is doing a complete * replace, it's important to set every other attribute that you don't want to change in * its original state. Not listing one means it will reset. * * @param settingId The identifier of the Setting. (required) * @param replaceSettingModel (required) * @return SettingModel * @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 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public SettingModel replaceSetting(Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { ApiResponse localVarResp = replaceSettingWithHttpInfo(settingId, replaceSettingModel); return localVarResp.getData(); } /** * Replace Flag This endpoint replaces the whole value of a Feature Flag or Setting identified * by the `settingId` parameter. **Important:** As this endpoint is doing a complete * replace, it's important to set every other attribute that you don't want to change in * its original state. Not listing one means it will reset. * * @param settingId The identifier of the Setting. (required) * @param replaceSettingModel (required) * @return ApiResponse<SettingModel> * @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 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse replaceSettingWithHttpInfo( Integer settingId, ReplaceSettingModel replaceSettingModel) throws ApiException { okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Replace Flag (asynchronously) This endpoint replaces the whole value of a Feature Flag or * Setting identified by the `settingId` parameter. **Important:** As this endpoint is * doing a complete replace, it's important to set every other attribute that you don't * want to change in its original state. Not listing one means it will reset. * * @param settingId The identifier of the Setting. (required) * @param replaceSettingModel (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 * * * * * * *
Status Code Description Response Headers
200 When the replace was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call replaceSettingAsync( Integer settingId, ReplaceSettingModel replaceSettingModel, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = replaceSettingValidateBeforeCall(settingId, replaceSettingModel, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateSetting * * @param settingId The identifier of the Setting. (required) * @param jsonPatchOperation (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 * * * * * * *
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call updateSettingCall( Integer settingId, List jsonPatchOperation, 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 = jsonPatchOperation; // create path and map variables String localVarPath = "/v1/settings/{settingId}" .replace( "{" + "settingId" + "}", localVarApiClient.escapeString(settingId.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 = { "application/json", "text/json", "application/*+json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] {"Basic"}; return localVarApiClient.buildCall( basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateSettingValidateBeforeCall( Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { // verify the required parameter 'settingId' is set if (settingId == null) { throw new ApiException( "Missing the required parameter 'settingId' when calling updateSetting(Async)"); } // verify the required parameter 'jsonPatchOperation' is set if (jsonPatchOperation == null) { throw new ApiException( "Missing the required parameter 'jsonPatchOperation' when calling" + " updateSetting(Async)"); } return updateSettingCall(settingId, jsonPatchOperation, _callback); } /** * Update Flag This endpoint updates the metadata of a Feature Flag or Setting with a collection * of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the * `name`, `hint` and `tags` attributes are modifiable by this * endpoint. The `tags` attribute is a simple collection of the [tag * IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is * that you can describe individual update operations on a resource without touching attributes * that you don't want to change. For example: We have the following resource. * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"Tihs is a naem with soem * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" } ] } ``` If we send an update request body as below (it * changes the `name` and adds the already existing tag with the id `2`): * ```json [ { \"op\": \"replace\", \"path\": * \"/name\", \"value\": \"This is the name without typos.\" }, { * \"op\": \"add\", \"path\": \"/tags/-\", * \"value\": 2 } ] ``` Only the `name` and `tags` * are updated and all the other attributes remain unchanged. So we get a response like this: * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"This is the name without * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" }, { \"tagId\": 2, \"name\": \"another * tag\", \"color\": \"koala\" } ] } ``` * * @param settingId The identifier of the Setting. (required) * @param jsonPatchOperation (required) * @return SettingModel * @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 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public SettingModel updateSetting( Integer settingId, List jsonPatchOperation) throws ApiException { ApiResponse localVarResp = updateSettingWithHttpInfo(settingId, jsonPatchOperation); return localVarResp.getData(); } /** * Update Flag This endpoint updates the metadata of a Feature Flag or Setting with a collection * of [JSON Patch](https://jsonpatch.com) operations in a specified Config. Only the * `name`, `hint` and `tags` attributes are modifiable by this * endpoint. The `tags` attribute is a simple collection of the [tag * IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is * that you can describe individual update operations on a resource without touching attributes * that you don't want to change. For example: We have the following resource. * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"Tihs is a naem with soem * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" } ] } ``` If we send an update request body as below (it * changes the `name` and adds the already existing tag with the id `2`): * ```json [ { \"op\": \"replace\", \"path\": * \"/name\", \"value\": \"This is the name without typos.\" }, { * \"op\": \"add\", \"path\": \"/tags/-\", * \"value\": 2 } ] ``` Only the `name` and `tags` * are updated and all the other attributes remain unchanged. So we get a response like this: * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"This is the name without * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" }, { \"tagId\": 2, \"name\": \"another * tag\", \"color\": \"koala\" } ] } ``` * * @param settingId The identifier of the Setting. (required) * @param jsonPatchOperation (required) * @return ApiResponse<SettingModel> * @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 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public ApiResponse updateSettingWithHttpInfo( Integer settingId, List jsonPatchOperation) throws ApiException { okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, null); Type localVarReturnType = new TypeToken() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Update Flag (asynchronously) This endpoint updates the metadata of a Feature Flag or Setting * with a collection of [JSON Patch](https://jsonpatch.com) operations in a specified Config. * Only the `name`, `hint` and `tags` attributes are modifiable by * this endpoint. The `tags` attribute is a simple collection of the [tag * IDs](#operation/get-tags) attached to the given setting. The advantage of using JSON Patch is * that you can describe individual update operations on a resource without touching attributes * that you don't want to change. For example: We have the following resource. * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"Tihs is a naem with soem * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" } ] } ``` If we send an update request body as below (it * changes the `name` and adds the already existing tag with the id `2`): * ```json [ { \"op\": \"replace\", \"path\": * \"/name\", \"value\": \"This is the name without typos.\" }, { * \"op\": \"add\", \"path\": \"/tags/-\", * \"value\": 2 } ] ``` Only the `name` and `tags` * are updated and all the other attributes remain unchanged. So we get a response like this: * ```json { \"settingId\": 5345, \"key\": * \"myGrandFeature\", \"name\": \"This is the name without * typos.\", \"hint\": \"This flag controls my grandioso feature.\", * \"settingType\": \"boolean\", \"tags\": [ { * \"tagId\": 0, \"name\": \"sample tag\", \"color\": * \"whale\" }, { \"tagId\": 2, \"name\": \"another * tag\", \"color\": \"koala\" } ] } ``` * * @param settingId The identifier of the Setting. (required) * @param jsonPatchOperation (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 * * * * * * *
Status Code Description Response Headers
200 When the update was successful. -
400 Bad request. -
404 Not found. -
429 Too many requests. In case of the request rate exceeds the rate limits. -
*/ public okhttp3.Call updateSettingAsync( Integer settingId, List jsonPatchOperation, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateSettingValidateBeforeCall(settingId, jsonPatchOperation, _callback); Type localVarReturnType = new TypeToken() {}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy