net.leanix.mtm.api.ApplicationsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leanix-mtm-sdk-java Show documentation
Show all versions of leanix-mtm-sdk-java Show documentation
SDK for Java to access leanIX MTM REST API
package net.leanix.mtm.api;
import net.leanix.dropkit.apiclient.ApiException;
import net.leanix.dropkit.apiclient.ApiClient;
import net.leanix.dropkit.apiclient.Configuration;
import net.leanix.dropkit.apiclient.Pair;
import javax.ws.rs.core.GenericType;
import net.leanix.mtm.api.models.ApplicationListResponse;
import net.leanix.mtm.api.models.ApplicationResponse;
import net.leanix.mtm.api.models.FeatureAccessRequest;
import net.leanix.mtm.api.models.FeatureAccessResponse;
import net.leanix.mtm.api.models.FeatureBundleListResponse;
import net.leanix.mtm.api.models.FeatureBundleResponse;
import net.leanix.mtm.api.models.FeatureListResponse;
import net.leanix.mtm.api.models.FeatureResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ApplicationsApi {
private ApiClient apiClient;
public ApplicationsApi() {
this(Configuration.getDefaultApiClient());
}
public ApplicationsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* accessFeature
* Checks the use permission of a feature
* @param name (required)
* @param id (required)
* @param featureId (required)
* @param body (required)
* @return FeatureAccessResponse
* @throws ApiException if fails to make API call
*/
public FeatureAccessResponse accessFeature(String name, String id, String featureId, FeatureAccessRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling accessFeature");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling accessFeature");
}
// verify the required parameter 'featureId' is set
if (featureId == null) {
throw new ApiException(400, "Missing the required parameter 'featureId' when calling accessFeature");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling accessFeature");
}
// create path and map variables
String localVarPath = "/applications/{name}/editions/{id}/features/{featureId}"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "featureId" + "\\}", apiClient.escapeString(featureId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getApplication
* Retrieve specific application by name
* @param name application name, a const like mtm (required)
* @return ApplicationResponse
* @throws ApiException if fails to make API call
*/
public ApplicationResponse getApplication(String name) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling getApplication");
}
// create path and map variables
String localVarPath = "/applications/{name}"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getApplications
* Retrieves all applications
* @return ApplicationListResponse
* @throws ApiException if fails to make API call
*/
public ApplicationListResponse getApplications() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/applications";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getEditions
* Retrieves an edition
* @param name (required)
* @param id (required)
* @return FeatureBundleResponse
* @throws ApiException if fails to make API call
*/
public FeatureBundleResponse getEdition(String name, String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling getEdition");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getEdition");
}
// create path and map variables
String localVarPath = "/applications/{name}/editions/{id}"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getEditions
* Retrieves all editions
* @param name (required)
* @return FeatureBundleListResponse
* @throws ApiException if fails to make API call
*/
public FeatureBundleListResponse getEditions(String name) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling getEditions");
}
// create path and map variables
String localVarPath = "/applications/{name}/editions"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getFeature
* Retrieves a feature
* @param name (required)
* @param id (required)
* @param featureId (required)
* @return FeatureResponse
* @throws ApiException if fails to make API call
*/
public FeatureResponse getFeature(String name, String id, String featureId) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling getFeature");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getFeature");
}
// verify the required parameter 'featureId' is set
if (featureId == null) {
throw new ApiException(400, "Missing the required parameter 'featureId' when calling getFeature");
}
// create path and map variables
String localVarPath = "/applications/{name}/editions/{id}/features/{featureId}"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()))
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "featureId" + "\\}", apiClient.escapeString(featureId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* getFeatures
* Retrieves all possible features
* @param name (required)
* @param q (optional)
* @return FeatureListResponse
* @throws ApiException if fails to make API call
*/
public FeatureListResponse getFeatures(String name, String q) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'name' is set
if (name == null) {
throw new ApiException(400, "Missing the required parameter 'name' when calling getFeatures");
}
// create path and map variables
String localVarPath = "/applications/{name}/features"
.replaceAll("\\{" + "name" + "\\}", apiClient.escapeString(name.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "q", q));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "token" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy