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

com.ziqni.admin.sdk.api.FileObjectsApiWs 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.CreateFileObjectRequest;
import java.io.File;
import com.ziqni.admin.sdk.model.FileObjectsResponse;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateFileObjectRequest;

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

    private final Duration memberVarReadTimeout;
    private final StreamingClient streamingClient;

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



            /**
            * 
            * 
                * @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 createFileObjects(CreateFileObjectRequest body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * 
            * 
                * @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 deleteFileObjects(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/deleteFileObjects", request);
            return result;
        }



            /**
            * 
            * Delete file objects by query
                * @param id The unique identifiers of the resources (optional
                * @param body Delete file objects inside a repository from Ziqni by unique file by unique object 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 deleteFileObjectsByQuery(List id, QueryRequest body) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("id", id);
            request.put("query",queryParam);

            
                        

            request.put("body",body);

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



            /**
            * 
            * Download file objects from your Ziqni space
                * @param path The canonical path of the file to download (optional)
                * @return CompletableFuture<File>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture downloadFileObjects(String path) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("path", path);
            request.put("query",queryParam);

            
                        

            

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



            /**
            * 
            * Returns a list of file objects
                * @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
                * @param download  (optional)
                * @return CompletableFuture<FileObjectsResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getFileObjects(Integer limit, Integer skip, List id, String download) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("limit", limit);
queryParam.put("skip", skip);
queryParam.put("id", id);
queryParam.put("download", download);
            request.put("query",queryParam);

            
                        

            

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



            /**
            * 
            * Retrieve file objects by query
                * @param id The unique identifiers of the resources (optional
                * @param body Retrieve file objects inside a repository from Ziqni by unique file object ID's or any other POST body parameters using the POST method (optional)
                * @return CompletableFuture<FileObjectsResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getFileObjectsByQuery(List id, QueryRequest body) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("id", id);
            request.put("query",queryParam);

            
                        

            request.put("body",body);

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



            /**
            * 
            * Create or update file objects and binaries in your Ziqni space
                * @param parentFolderPath The folder to save these file in. (optional)
                * @param repositoryId  (optional)
                * @param templateToSave  (optional)
                * @param templateName  (optional)
                * @param tags  (optional)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture saveTemplates(String parentFolderPath, String repositoryId, String templateToSave, String templateName, String tags) {
                var request = new HashMap();
            
                        

            
                        

            

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



            /**
            * 
            * 
                * @param body Update a file object in your Ziqni space. (required)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture updateFileObjects(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * 
            * Create or update file objects and binaries in your Ziqni space
                * @param parentFolderPath The folder to save these file in. (optional)
                * @param files The files to upload (optional
                * @param repositoryId  (optional)
                * @param tags  (optional)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture uploadFileObjects(String parentFolderPath, List files, String repositoryId, String tags) {
                var request = new HashMap();
            
                        

            
                        

            

            CompletableFuture result = this.streamingClient.sendWithApiCallback("/aapi/uploadFileObjects", 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