com.ziqni.admin.sdk.api.ApiKeysApiWs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ziqni-admin-sdk Show documentation
Show all versions of ziqni-admin-sdk Show documentation
ZIQNI Admin SDK Java Client
/*
* ZIQNI Admin API
* Ziqni Application Services are used to manage and configure spaces. Change log: 2024-02-27 Added rewards reduced to the LeaderboardEntry response
*
* The version of the OpenAPI document: 3.0.17
* 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.ziqni.admin.sdk.api;
import com.ziqni.admin.sdk.streaming.StreamingClient;
import com.ziqni.admin.sdk.streaming.handlers.EventHandler;
import com.ziqni.admin.sdk.streaming.handlers.CallbackConsumer;
import com.ziqni.admin.sdk.ApiException;
import com.ziqni.admin.sdk.streaming.stomp.StompHeaders;
import com.ziqni.admin.sdk.model.ApiKeyResponse;
import com.ziqni.admin.sdk.model.CreateApiKeyRequest;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateApiKeyRequest;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ziqni.admin.sdk.model.*;
import java.time.Duration;
import java.util.*;
//asyncNative:true
import java.util.concurrent.CompletableFuture;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.util.function.BiConsumer;
public class ApiKeysApiWs {
private final Duration memberVarReadTimeout;
private final StreamingClient streamingClient;
public ApiKeysApiWs(StreamingClient streamingClient, Duration readTimeout) {
this.streamingClient = streamingClient;
this.memberVarReadTimeout = readTimeout;
}
/**
* Delete api keys
* Create a new Api key in the Ziqni system
* @param body Create an Api key in the Ziqni system (required)
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture createApiKeys(CreateApiKeyRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/createApiKeys", request);
return result;
}
/**
* Delete api keys
* Delete Api keys for a given identifier specified
* @param id The unique identifiers of the resources (optional
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture deleteApiKeys(List id) {
var request = new HashMap();
var queryParam = new HashMap();
queryParam.put("id", id);
request.put("query",queryParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteApiKeys", request);
return result;
}
/**
* Delete api keys by id
* Delete the Api key for a given identifier specified
* @param id Unique identifier of the resource (required)
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture deleteApiKeysById(String id) {
var request = new HashMap();
var pathParam = new HashMap();
pathParam.put("id", id);
request.put("path",pathParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteApiKeysById", request);
return result;
}
/**
* Delete api keys by query
* Delete an Api key or a list of Api keys from Ziqni by query
* @param body Delete an Api key or a list of Api keys from Ziqni by unique Api key ID's or any other POST body parameters using the POST method (optional)
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture deleteApiKeysByQuery(QueryRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteApiKeysByQuery", request);
return result;
}
/**
* Get api keys
* Returns a list of Api keys. This assumes that api keys have first been created via a POST request or web console
* @param id The unique identifiers of the resources (optional
* @param limit Limit the returned total records found (optional)
* @param skip Skip the returned records found and return the next batch of records (optional)
* @return CompletableFuture<ApiKeyResponse>
*/
public CompletableFuture getApiKeys(List id, Integer limit, Integer skip) {
var request = new HashMap();
var queryParam = new HashMap();
queryParam.put("id", id);
queryParam.put("limit", limit);
queryParam.put("skip", skip);
request.put("query",queryParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getApiKeys", request);
return result;
}
/**
* Get api keys by id
* Returns an Api key by identifier provided. This assumes that api keys have first been created via a POST request or web console
* @param id Unique identifier of the resource (required)
* @return CompletableFuture<ApiKeyResponse>
*/
public CompletableFuture getApiKeysById(String id) {
var request = new HashMap();
var pathParam = new HashMap();
pathParam.put("id", id);
request.put("path",pathParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getApiKeysById", request);
return result;
}
/**
* Get api keys by query
* Retrieve an Api key or a list of Api keys by query
* @param body Retrieve an Api key or a list of Api keys from Ziqni by unique Api key ID's or any other POST body parameters using the POST method (optional)
* @return CompletableFuture<ApiKeyResponse>
*/
public CompletableFuture getApiKeysByQuery(QueryRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getApiKeysByQuery", request);
return result;
}
/**
* Update api keys
* Update an existing Api key in the Ziqni system
* @param body Update an Api key in the Ziqni system. * Any Put body Parameters that are excluded in the Request body field will be considered as empty and updated with an empty field (required)
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture updateApiKeys(UpdateApiKeyRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateApiKeys", request);
return result;
}
private ApiException getApiException(String operationId, HttpResponse response) {
String message = formatExceptionMessage(operationId, response.statusCode(), response.body());
return new ApiException(response.statusCode(), message, response.headers(), response.body());
}
private String formatExceptionMessage(String operationId, int statusCode, String body) {
if (body == null || body.isEmpty()) {
body = "[no body]";
}
return operationId + " call failed with: " + statusCode + " - " + body;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy