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

com.ziqni.admin.sdk.api.AchievementsApiWs Maven / Gradle / Ivy

There is a newer version: 1.0.21
Show newest version
/*
 * ZIQNI Admin API
 * Ziqni Application Services are used to manage and configure spaces.
 *
 * The version of the OpenAPI document: 3.0.1
 * 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.AchievementIssuedResponse;
import com.ziqni.admin.sdk.model.AchievementLiveStatusRequest;
import com.ziqni.admin.sdk.model.AchievementResponse;
import com.ziqni.admin.sdk.model.CloneAchievementResponse;
import com.ziqni.admin.sdk.model.CreateAchievementRequest;
import com.ziqni.admin.sdk.model.MemberAchievementIssuedResponse;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateAchievementRequest;

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 AchievementsApiWs {

    private final Duration memberVarReadTimeout;
    private final StreamingClient streamingClient;

    public AchievementsApiWs(StreamingClient streamingClient, Duration readTimeout) {
    this.streamingClient = streamingClient;
    this.memberVarReadTimeout = readTimeout;
    }



            /**
            * Create Achievements
            * Create Achievements in the Ziqni database
                * @param body Create Achievements in the Ziqni database (required)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture createAchievements(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/createAchievements", request);
            return result;
        }



            /**
            * Delete Achievements
            * Delete Achievements for a given identifier specified
                * @param id The unique identifiers of the resources (optional
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture deleteAchievements(List id) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("id", id);
            request.put("query",queryParam);

            
                        

            

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteAchievements", request);
            return result;
        }



            /**
            * 
            * Delete Achievements from Ziqni database by unique Achievements ID's or any other POST body parameters using the POST method
                * @param body Delete Achievements from Ziqni database by unique Achievements ID's or any other Post body parameters using the POST method (optional)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture deleteAchievementsByQuery(QueryRequest body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteAchievementsByQuery", request);
            return result;
        }



            /**
            * 
            * Clones an Achievement for the identifier provided
                * @param id Unique identifier of the resource (required)
                * @return CompletableFuture<CloneAchievementResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getAchievementToClone(String id) {
                var request = new HashMap();
            
                        

            var pathParam = new HashMap();
            pathParam.put("id", id);
            request.put("path",pathParam);

            

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getAchievementToClone", request);
            return result;
        }



            /**
            * Get Achievements
            * Returns a list of Achievements. This assumes that achievements 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<AchievementResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getAchievements(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/getAchievements", request);
            return result;
        }



            /**
            * 
            * Retrieve Achievements from Ziqni database by unique Achievements ID's or any other POST body parameters using the POST method
                * @param body Retrieve Achievements from Ziqni database by unique Achievements ID's or any other Post body parameters using the POST method (optional)
                * @return CompletableFuture<AchievementResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getAchievementsByQuery(QueryRequest body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getAchievementsByQuery", request);
            return result;
        }



            /**
            * NOT AVAILABLE IN CURRENT RELEASE
            * Receive a list of Antecedent Achievements for the Achievement identified 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<AchievementResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getAntecendentsForAchievement(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/getAntecendentsForAchievement", request);
            return result;
        }



            /**
            * 
            * Receive a count of Issued Achievements by identifier provided
                * @param id Unique identifier of the resource (required)
                * @return CompletableFuture<AchievementIssuedResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getIssuedAchievementsCountById(String id) {
                var request = new HashMap();
            
                        

            var pathParam = new HashMap();
            pathParam.put("id", id);
            request.put("path",pathParam);

            

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getIssuedAchievementsCountById", request);
            return result;
        }



            /**
            * 
            * Receive a list of members that had an Achievement issued for the Achievement identified provided
                * @param id Unique identifier of the resource (required)
                * @param memberId Id of a member (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<MemberAchievementIssuedResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getMembersAchievementsDetails(String id, String memberId, Integer limit, Integer skip) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("memberId", memberId);
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/getMembersAchievementsDetails", request);
            return result;
        }



            /**
            * Update Achievements
            * Update existing Achievements in the Ziqni database
                * @param body Update Achievements in the Ziqni database. * An Achievement Id must exist in the Ziqni database for update (required)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture updateAchievements(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateAchievements", request);
            return result;
        }



            /**
            * 
            * Manage the state of achievement - Draft, Live, Archived
                * @param body Updates the state of the Achievement (optional
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture updateAchievementsLiveStatus(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateAchievementsLiveStatus", 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 - 2024 Weber Informatics LLC | Privacy Policy