com.ziqni.admin.sdk.api.CompetitionsApiWs 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.
*
* The version of the OpenAPI document: 3.0.11
* 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 javax.ws.rs.core.GenericType;
import com.ziqni.admin.sdk.streaming.StreamingClient;
import com.ziqni.admin.sdk.streaming.EventHandler;
import com.ziqni.admin.sdk.streaming.handlers.CallbackConsumer;
import com.ziqni.admin.sdk.ApiException;
import org.springframework.messaging.simp.stomp.StompHeaders;
import com.ziqni.admin.sdk.model.CloneCompetitionResponse;
import com.ziqni.admin.sdk.model.CompetitionLeaderboardResponse;
import com.ziqni.admin.sdk.model.CompetitionResponse;
import com.ziqni.admin.sdk.model.CreateCompetitionRequest;
import com.ziqni.admin.sdk.model.CreateSimpleCompetitionRequest;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateCompetitionRequest;
import com.ziqni.admin.sdk.model.UpdateCompetitionStatusRequest;
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;
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CompetitionsApiWs {
private final Duration memberVarReadTimeout;
private final StreamingClient streamingClient;
public CompetitionsApiWs(StreamingClient streamingClient, Duration readTimeout) {
this.streamingClient = streamingClient;
this.memberVarReadTimeout = readTimeout;
}
/**
*
* Create a new Competition in the Ziqni database
* @param body Create a Competition in the Ziqni database (required)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture createCompetitions(CreateCompetitionRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/createCompetitions", request);
return result;
}
/**
*
* Create a Simple Competition in the Ziqni database
* @param body Create a Competition in the Ziqni database (required)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture createSimpleCompetitions(CreateSimpleCompetitionRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/createSimpleCompetitions", request);
return result;
}
/**
*
* Returns a list of Competitions. This assumes that competitions have first been uploaded 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<CompetitionResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture getCompetitions(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/getCompetitions", request);
return result;
}
/**
*
* Retrieve Competitions from Ziqni database by unique Competition ID's or any other POST body parameters using the POST method
* @param body Retrieve Competitions from Ziqni database by unique Competition ID's or any other POST body parameters using the POST method (optional)
* @return CompletableFuture<CompetitionResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture getCompetitionsByQuery(QueryRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getCompetitionsByQuery", request);
return result;
}
/**
* Get Competition To Clone
* Clones a Competition for the identifier provided
* @param id Unique identifier of the resource (required)
* @return CompletableFuture<CloneCompetitionResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture getCompetitionsToClone(String id) {
var request = new HashMap();
var pathParam = new HashMap();
pathParam.put("id", id);
request.put("path",pathParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getCompetitionsToClone", request);
return result;
}
/**
*
* Use /leadeboard instead. Returns a list of Leaderborads for the Competition id provided
* @param id Unique identifier of the resource (required)
* @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<CompetitionLeaderboardResponse>
* @throws ApiException if fails to make API call
* @deprecated
*/
@Deprecated
public CompletableFuture getLeaderboardByCompetitionId(String id, Integer limit, Integer skip) {
var request = new HashMap();
var queryParam = new HashMap();
queryParam.put("limit", limit);
queryParam.put("skip", skip);
request.put("query",queryParam);
var pathParam = new HashMap();
pathParam.put("id", id);
request.put("path",pathParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getLeaderboardByCompetitionId", request);
return result;
}
/**
*
* Update an existing Competition in the Ziqni database
* @param body Update a Competition in the Ziqni database. * A Competitions Id must exist in the Ziqni database for update (required)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture updateCompetitions(UpdateCompetitionRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateCompetitions", request);
return result;
}
/**
*
* Manages the Competitions state
* @param body Updates the state of the Competition (optional
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture updateCompetitionsState(List body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateCompetitionsState", 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