com.ziqni.admin.sdk.api.FileRepositoriesApiWs 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.CreateRepositoryRequest;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.RepositoryResponse;
import com.ziqni.admin.sdk.model.UpdateRepositoryRequest;
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 FileRepositoriesApiWs {
private final Duration memberVarReadTimeout;
private final StreamingClient streamingClient;
public FileRepositoriesApiWs(StreamingClient streamingClient, Duration readTimeout) {
this.streamingClient = streamingClient;
this.memberVarReadTimeout = readTimeout;
}
/**
*
* Create a new file object repository in your Ziqni space
* @param body Create a new file object repository in your Ziqni space (required)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture createFileRepositories(List body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/createFileRepositories", request);
return result;
}
/**
*
* Delete the file repository for a given identifier specified
* @param id The unique identifiers of the resources (optional
* @param permanent Permanently delete the file object. Default is false (optional)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture deleteFileRepositories(List id, Boolean permanent) {
var request = new HashMap();
var queryParam = new HashMap();
queryParam.put("id", id);
queryParam.put("permanent", permanent);
request.put("query",queryParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteFileRepositories", request);
return result;
}
/**
*
* Delete repositories nby query. Delete repositories by query and/or unique repository ID's or any other body parameters
* @param body Delete repositories from a Ziqni space by unique repository 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 deleteFileRepositoriesByQuery(QueryRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/deleteFileRepositoriesByQuery", request);
return result;
}
/**
*
* Returns a list of file object repositories. This assumes that repositories have first been uploaded via a POST request or web console
* @param limit Limit the returned total records found (optional)
* @param skip Skip the returned records found and return the next batch of records (optional)
* @param id The unique identifiers of the resources (optional
* @return CompletableFuture<RepositoryResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture getFileRepositories(Integer limit, Integer skip, List id) {
var request = new HashMap();
var queryParam = new HashMap();
queryParam.put("limit", limit);
queryParam.put("skip", skip);
queryParam.put("id", id);
request.put("query",queryParam);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getFileRepositories", request);
return result;
}
/**
*
* Find file object repositories by query
* @param body Retrieve file object repositories from Ziqni by unique repository ID's or any other POST body parameters using the POST method (optional)
* @return CompletableFuture<RepositoryResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture getFileRepositoriesByQuery(QueryRequest body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/getFileRepositoriesByQuery", request);
return result;
}
/**
*
* Update a file object repository in your Ziqni space.
* @param body Update a file object repository in your Ziqni space. (required)
* @return CompletableFuture<ModelApiResponse>
* @throws ApiException if fails to make API call
*/
public CompletableFuture updateFileRepositories(List body) {
var request = new HashMap();
request.put("body",body);
CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/updateFileRepositories", 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