io.dataspray.stream.control.client.OrganizationApi Maven / Gradle / Ivy
The newest version!
/*
* DataSpray API
* DataSpray API documentation for controlling and development.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.dataspray.stream.control.client;
import io.dataspray.stream.control.client.ApiCallback;
import io.dataspray.stream.control.client.ApiClient;
import io.dataspray.stream.control.client.ApiException;
import io.dataspray.stream.control.client.ApiResponse;
import io.dataspray.stream.control.client.Configuration;
import io.dataspray.stream.control.client.Pair;
import io.dataspray.stream.control.client.ProgressRequestBody;
import io.dataspray.stream.control.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OrganizationApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public OrganizationApi() {
this(Configuration.getDefaultApiClient());
}
public OrganizationApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
/**
* Build call for createOrganization
* @param organizationName (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public okhttp3.Call createOrganizationCall(String organizationName, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/organizations/create";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (organizationName != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("organizationName", organizationName));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Authorizer" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createOrganizationValidateBeforeCall(String organizationName, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'organizationName' is set
if (organizationName == null) {
throw new ApiException("Missing the required parameter 'organizationName' when calling createOrganization(Async)");
}
return createOrganizationCall(organizationName, _callback);
}
/**
*
*
* @param organizationName (required)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void createOrganization(String organizationName) throws ApiException {
createOrganizationWithHttpInfo(organizationName);
}
/**
*
*
* @param organizationName (required)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse createOrganizationWithHttpInfo(String organizationName) throws ApiException {
okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(organizationName, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
*
* @param organizationName (required)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public okhttp3.Call createOrganizationAsync(String organizationName, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(organizationName, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for inviteToOrganization
* @param organizationName (required)
* @param email (required)
* @param username (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public okhttp3.Call inviteToOrganizationCall(String organizationName, String email, String username, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/v1/organization/{organizationName}/invite"
.replace("{" + "organizationName" + "}", localVarApiClient.escapeString(organizationName.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (email != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
}
if (username != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username));
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "Authorizer" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call inviteToOrganizationValidateBeforeCall(String organizationName, String email, String username, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'organizationName' is set
if (organizationName == null) {
throw new ApiException("Missing the required parameter 'organizationName' when calling inviteToOrganization(Async)");
}
// verify the required parameter 'email' is set
if (email == null) {
throw new ApiException("Missing the required parameter 'email' when calling inviteToOrganization(Async)");
}
return inviteToOrganizationCall(organizationName, email, username, _callback);
}
/**
*
*
* @param organizationName (required)
* @param email (required)
* @param username (optional)
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public void inviteToOrganization(String organizationName, String email, String username) throws ApiException {
inviteToOrganizationWithHttpInfo(organizationName, email, username);
}
/**
*
*
* @param organizationName (required)
* @param email (required)
* @param username (optional)
* @return ApiResponse<Void>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse inviteToOrganizationWithHttpInfo(String organizationName, String email, String username) throws ApiException {
okhttp3.Call localVarCall = inviteToOrganizationValidateBeforeCall(organizationName, email, username, null);
return localVarApiClient.execute(localVarCall);
}
/**
* (asynchronously)
*
* @param organizationName (required)
* @param email (required)
* @param username (optional)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
*/
public okhttp3.Call inviteToOrganizationAsync(String organizationName, String email, String username, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = inviteToOrganizationValidateBeforeCall(organizationName, email, username, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy