use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class KnowledgeEntriesApi method apiV2KnowledgeEntriesByIdGet.
/**
* Retrieve a single knowledge entry.
*
* @param id id of the requested entity
* @return KnowledgeEntryRecord
*/
public KnowledgeEntryRecord apiV2KnowledgeEntriesByIdGet(UUID id) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2KnowledgeEntriesByIdGet", new ApiException(400, "Missing the required parameter 'id' when calling apiV2KnowledgeEntriesByIdGet"));
}
// create path and map variables
String path = "/Api/v2/KnowledgeEntries/{Id}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "id" + "\\}", apiInvoker.escapeString(id.toString()));
// query params
List<Pair> queryParams = new ArrayList<Pair>();
// header params
Map<String, String> headerParams = new HashMap<String, String>();
// form params
Map<String, String> formParams = new HashMap<String, String>();
String[] contentTypes = {};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
if (contentType.startsWith("multipart/form-data")) {
// file uploading
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
HttpEntity httpEntity = localVarBuilder.build();
postBody = httpEntity;
} else {
// normal form params
}
String[] authNames = new String[] {};
try {
String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
if (localVarResponse != null) {
return (KnowledgeEntryRecord) ApiInvoker.deserialize(localVarResponse, "", KnowledgeEntryRecord.class);
} else {
return null;
}
} catch (ApiException ex) {
throw ex;
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
if (ex.getCause() instanceof VolleyError) {
VolleyError volleyError = (VolleyError) ex.getCause();
if (volleyError.networkResponse != null) {
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
}
}
throw ex;
} catch (TimeoutException ex) {
throw ex;
}
}
use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class KnowledgeEntriesApi method apiV2KnowledgeEntriesGet.
/**
* Retrieves a list of all knowledge entries.
*/
public void apiV2KnowledgeEntriesGet(final Response.Listener<List<KnowledgeEntryRecord>> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
// create path and map variables
String path = "/Api/v2/KnowledgeEntries".replaceAll("\\{format\\}", "json");
// query params
List<Pair> queryParams = new ArrayList<Pair>();
// header params
Map<String, String> headerParams = new HashMap<String, String>();
// form params
Map<String, String> formParams = new HashMap<String, String>();
String[] contentTypes = {};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
if (contentType.startsWith("multipart/form-data")) {
// file uploading
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
HttpEntity httpEntity = localVarBuilder.build();
postBody = httpEntity;
} else {
// normal form params
}
String[] authNames = new String[] {};
try {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {
@Override
public void onResponse(String localVarResponse) {
try {
responseListener.onResponse((List<KnowledgeEntryRecord>) ApiInvoker.deserialize(localVarResponse, "array", KnowledgeEntryRecord.class));
} catch (ApiException exception) {
errorListener.onErrorResponse(new VolleyError(exception));
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
errorListener.onErrorResponse(error);
}
});
} catch (ApiException ex) {
errorListener.onErrorResponse(new VolleyError(ex));
}
}
use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class KnowledgeGroupsApi method apiV2KnowledgeGroupsGet.
/**
* Retrieves a list of all knowledge groups.
*/
public void apiV2KnowledgeGroupsGet(final Response.Listener<List<KnowledgeGroupRecord>> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
// create path and map variables
String path = "/Api/v2/KnowledgeGroups".replaceAll("\\{format\\}", "json");
// query params
List<Pair> queryParams = new ArrayList<Pair>();
// header params
Map<String, String> headerParams = new HashMap<String, String>();
// form params
Map<String, String> formParams = new HashMap<String, String>();
String[] contentTypes = {};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
if (contentType.startsWith("multipart/form-data")) {
// file uploading
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
HttpEntity httpEntity = localVarBuilder.build();
postBody = httpEntity;
} else {
// normal form params
}
String[] authNames = new String[] {};
try {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {
@Override
public void onResponse(String localVarResponse) {
try {
responseListener.onResponse((List<KnowledgeGroupRecord>) ApiInvoker.deserialize(localVarResponse, "array", KnowledgeGroupRecord.class));
} catch (ApiException exception) {
errorListener.onErrorResponse(new VolleyError(exception));
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
errorListener.onErrorResponse(error);
}
});
} catch (ApiException ex) {
errorListener.onErrorResponse(new VolleyError(ex));
}
}
use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class KnowledgeGroupsApi method apiV2KnowledgeGroupsByIdGet.
/**
* Retrieve a single knowledge group.
*
* @param id id of the requested entity
* @return KnowledgeGroupRecord
*/
public KnowledgeGroupRecord apiV2KnowledgeGroupsByIdGet(UUID id) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2KnowledgeGroupsByIdGet", new ApiException(400, "Missing the required parameter 'id' when calling apiV2KnowledgeGroupsByIdGet"));
}
// create path and map variables
String path = "/Api/v2/KnowledgeGroups/{Id}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "id" + "\\}", apiInvoker.escapeString(id.toString()));
// query params
List<Pair> queryParams = new ArrayList<Pair>();
// header params
Map<String, String> headerParams = new HashMap<String, String>();
// form params
Map<String, String> formParams = new HashMap<String, String>();
String[] contentTypes = {};
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
if (contentType.startsWith("multipart/form-data")) {
// file uploading
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
HttpEntity httpEntity = localVarBuilder.build();
postBody = httpEntity;
} else {
// normal form params
}
String[] authNames = new String[] {};
try {
String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
if (localVarResponse != null) {
return (KnowledgeGroupRecord) ApiInvoker.deserialize(localVarResponse, "", KnowledgeGroupRecord.class);
} else {
return null;
}
} catch (ApiException ex) {
throw ex;
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
if (ex.getCause() instanceof VolleyError) {
VolleyError volleyError = (VolleyError) ex.getCause();
if (volleyError.networkResponse != null) {
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
}
}
throw ex;
} catch (TimeoutException ex) {
throw ex;
}
}
use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class MapsApi method apiV2MapsByIdEntriesByEntryIdPut.
/**
* Create or Update an existing map entry in a specific map
* * Requires authorization * Requires any of the following roles: **`Admin`**, **`Developer`** This both works for updating an existing entry and creating a new entry. The id property of the model (request body) must match the {EntryId} part of the uri.
* @param id \"Id\" of the map.
* @param entryId \"Id\" of the entry that gets inserted.
* @param record \"Id\" property must match the {EntryId} part of the uri
* @return UUID
*/
public UUID apiV2MapsByIdEntriesByEntryIdPut(UUID id, UUID entryId, MapEntryRecord record) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
Object postBody = record;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2MapsByIdEntriesByEntryIdPut", new ApiException(400, "Missing the required parameter 'id' when calling apiV2MapsByIdEntriesByEntryIdPut"));
}
// verify the required parameter 'entryId' is set
if (entryId == null) {
VolleyError error = new VolleyError("Missing the required parameter 'entryId' when calling apiV2MapsByIdEntriesByEntryIdPut", new ApiException(400, "Missing the required parameter 'entryId' when calling apiV2MapsByIdEntriesByEntryIdPut"));
}
// create path and map variables
String path = "/Api/v2/Maps/{Id}/Entries/{EntryId}".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "Id" + "\\}", apiInvoker.escapeString(id.toString())).replaceAll("\\{" + "EntryId" + "\\}", apiInvoker.escapeString(entryId.toString()));
// query params
List<Pair> queryParams = new ArrayList<Pair>();
// header params
Map<String, String> headerParams = new HashMap<String, String>();
// form params
Map<String, String> formParams = new HashMap<String, String>();
String[] contentTypes = { "application/json", "text/json", "application/json-patch+json" };
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
if (contentType.startsWith("multipart/form-data")) {
// file uploading
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
HttpEntity httpEntity = localVarBuilder.build();
postBody = httpEntity;
} else {
// normal form params
}
String[] authNames = new String[] { "Bearer" };
try {
String localVarResponse = apiInvoker.invokeAPI(basePath, path, "PUT", queryParams, postBody, headerParams, formParams, contentType, authNames);
if (localVarResponse != null) {
return (UUID) ApiInvoker.deserialize(localVarResponse, "", UUID.class);
} else {
return null;
}
} catch (ApiException ex) {
throw ex;
} catch (InterruptedException ex) {
throw ex;
} catch (ExecutionException ex) {
if (ex.getCause() instanceof VolleyError) {
VolleyError volleyError = (VolleyError) ex.getCause();
if (volleyError.networkResponse != null) {
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
}
}
throw ex;
} catch (TimeoutException ex) {
throw ex;
}
}
Aggregations