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

com.ziqni.admin.sdk.api.ConnectionsApiWs 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.ConnectionResponse;
import com.ziqni.admin.sdk.model.ConnectionType;
import com.ziqni.admin.sdk.model.CreateConnectionRequest;
import com.ziqni.admin.sdk.model.ModelApiResponse;
import com.ziqni.admin.sdk.model.ObjectParametersResponse;
import com.ziqni.admin.sdk.model.QueryRequest;
import com.ziqni.admin.sdk.model.UpdateConnectionRequest;
import com.ziqni.admin.sdk.model.UpdateConnectionStateRequest;

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

    private final Duration memberVarReadTimeout;
    private final StreamingClient streamingClient;

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



            /**
            * 
            * Create a new Consumer Connection in the Ziqni system
                * @param body Create a RabbitMq Consumer Connection in the Ziqni system (required)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture createConnections(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * 
            * Delete the Consumer Connection 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 deleteConnections(List id) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("id", id);
            request.put("query",queryParam);

            
                        

            

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



            /**
            * 
            * Delete a RabbitMQ Connection or a list of RabbitMQ Connections from Ziqni by unique Connection ID's or any other POST body parameters using the POST method
                * @param body Delete a RabbitMQ Connection or a list of RabbitMQ Connections from Ziqni by unique Connection 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 deleteConnectionsByQuery(QueryRequest body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * 
            * Get all the parameter for the connection based on the connection type
                * @param connectionType The connection type, RabbitMQ, Kafka, or SQS (required)
                * @return CompletableFuture<ObjectParametersResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture describeConnectionObject(ConnectionType connectionType) {
                var request = new HashMap();
            var queryParam = new HashMap();
            queryParam.put("connectionType", connectionType);
            request.put("query",queryParam);

            
                        

            

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



            /**
            * 
            * Return a list of Consumer Connections
                * @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<ConnectionResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getConnections(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/getConnections", request);
            return result;
        }



            /**
            * 
            * Retrieve a RabbitMQ Connection or a list of RabbitMQ Connections from Ziqni by unique Connection ID's or any other Post body parameters using the POST method
                * @param body Retrieve a RabbitMQ Connection or a list of RabbitMQ Connections from Ziqni by unique Connection ID's or any other Post body parameters using the POST method (optional)
                * @return CompletableFuture<ConnectionResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture getConnectionsByQuery(QueryRequest body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * 
            * Update an existing Consumer Connection in the Ziqni system
                * @param body Update the RabbitMq Consumer Connection details in the Ziqni system (required)
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture updateConnections(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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



            /**
            * Update connection status
            * Update the state of a Consumer using the POST method
                * @param body Update the state of a Consumer using the POST method (optional
                * @return CompletableFuture<ModelApiResponse>
            * @throws ApiException if fails to make API call
            */
            public CompletableFuture updateConnectionsState(List body) {
                var request = new HashMap();
            
                        

            
                        

            request.put("body",body);

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