com.ziqni.admin.sdk.api.EntrantsApiWs 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.EntrantCountResponse;
import com.ziqni.admin.sdk.model.EntrantResponse;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateEntrantRequest;
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 EntrantsApiWs {
private final Duration memberVarReadTimeout;
private final StreamingClient streamingClient;
public EntrantsApiWs(StreamingClient streamingClient, Duration readTimeout) {
this.streamingClient = streamingClient;
this.memberVarReadTimeout = readTimeout;
}
/**
* Get entrants by query
* Retrieve ConteEntrants from Ziqni database by unique Contests ID's or any other POST body parameters using the POST method
* @param queryRequest (optional)
* @return CompletableFuture<EntrantCountResponse>
*/
public CompletableFuture exportEntrantsByQuery(QueryRequest queryRequest) {
var request = new HashMap();
request.put("body",queryRequest);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/exportEntrantsByQuery", request);
return result;
}
/**
* Get entrants by query
* Retrieve ConteEntrants from Ziqni database by unique Contests ID's or any other POST body parameters using the POST method
* @param queryRequest (optional)
* @return CompletableFuture<EntrantResponse>
*/
public CompletableFuture getEntrantsByQuery(QueryRequest queryRequest) {
var request = new HashMap();
request.put("body",queryRequest);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getEntrantsByQuery", request);
return result;
}
/**
*
* Updates the status of the Entrants for a Competition id provided
* @param body Updates the status of the Entrants (optional)
* @return CompletableFuture<ModelApiResponse>
*/
public CompletableFuture updateEntrants(UpdateEntrantRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateEntrants", 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