use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class MapsApi method apiV2MapsByIdEntriesByEntryIdGet.
/**
* Get all specific map entry for a specific map
*
* @param id * @param entryId
*/
public void apiV2MapsByIdEntriesByEntryIdGet(UUID id, UUID entryId, final Response.Listener<MapEntryRecord> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2MapsByIdEntriesByEntryIdGet", new ApiException(400, "Missing the required parameter 'id' when calling apiV2MapsByIdEntriesByEntryIdGet"));
}
// verify the required parameter 'entryId' is set
if (entryId == null) {
VolleyError error = new VolleyError("Missing the required parameter 'entryId' when calling apiV2MapsByIdEntriesByEntryIdGet", new ApiException(400, "Missing the required parameter 'entryId' when calling apiV2MapsByIdEntriesByEntryIdGet"));
}
// 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 = {};
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((MapEntryRecord) ApiInvoker.deserialize(localVarResponse, "", MapEntryRecord.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 MapsApi method apiV2MapsGet.
/**
* Get all maps
*/
public void apiV2MapsGet(final Response.Listener<List<MapRecord>> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
// create path and map variables
String path = "/Api/v2/Maps".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<MapRecord>) ApiInvoker.deserialize(localVarResponse, "array", MapRecord.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 MapsApi method apiV2MapsByIdEntriesPost.
/**
* Create a new map entry in a specific map
* * Requires authorization * Requires any of the following roles: **`Admin`**, **`Developer`** If you can generate guids client-side, you can also use the PUT variant for both create and update.
* @param id \"Id\" of the map
* @param record Do not specify the \"Id\" property. It will be auto-assigned and returned in the response.
* @return UUID
*/
public UUID apiV2MapsByIdEntriesPost(UUID id, 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 apiV2MapsByIdEntriesPost", new ApiException(400, "Missing the required parameter 'id' when calling apiV2MapsByIdEntriesPost"));
}
// create path and map variables
String path = "/Api/v2/Maps/{Id}/Entries".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 = { "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, "POST", 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;
}
}
use of io.swagger.client.ApiException in project ef-app_android by eurofurence.
the class MapsApi method apiV2MapsByIdEntriesPost.
/**
* Create a new map entry in a specific map
* * Requires authorization * Requires any of the following roles: **`Admin`**, **`Developer`** If you can generate guids client-side, you can also use the PUT variant for both create and update.
* @param id \"Id\" of the map * @param record Do not specify the \"Id\" property. It will be auto-assigned and returned in the response.
*/
public void apiV2MapsByIdEntriesPost(UUID id, MapEntryRecord record, final Response.Listener<UUID> responseListener, final Response.ErrorListener errorListener) {
Object postBody = record;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2MapsByIdEntriesPost", new ApiException(400, "Missing the required parameter 'id' when calling apiV2MapsByIdEntriesPost"));
}
// create path and map variables
String path = "/Api/v2/Maps/{Id}/Entries".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 = { "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 {
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {
@Override
public void onResponse(String localVarResponse) {
try {
responseListener.onResponse((UUID) ApiInvoker.deserialize(localVarResponse, "", UUID.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 MapsApi method apiV2MapsByIdGet.
/**
* Get a specific map
*
* @param id
*/
public void apiV2MapsByIdGet(UUID id, final Response.Listener<MapRecord> responseListener, final Response.ErrorListener errorListener) {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
VolleyError error = new VolleyError("Missing the required parameter 'id' when calling apiV2MapsByIdGet", new ApiException(400, "Missing the required parameter 'id' when calling apiV2MapsByIdGet"));
}
// create path and map variables
String path = "/Api/v2/Maps/{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 {
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {
@Override
public void onResponse(String localVarResponse) {
try {
responseListener.onResponse((MapRecord) ApiInvoker.deserialize(localVarResponse, "", MapRecord.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));
}
}
Aggregations