Search in sources :

Example 16 with ApiException

use of io.swagger.client.ApiException in project ef-app_android by eurofurence.

the class ImagesApi method apiV2ImagesGet.

/**
 * Retrieves a list of all images.
 *
 * @return List<ImageRecord>
 */
public List<ImageRecord> apiV2ImagesGet() throws TimeoutException, ExecutionException, InterruptedException, ApiException {
    Object postBody = null;
    // create path and map variables
    String path = "/Api/v2/Images".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 {
        String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
        if (localVarResponse != null) {
            return (List<ImageRecord>) ApiInvoker.deserialize(localVarResponse, "array", ImageRecord.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;
    }
}
Also used : VolleyError(com.android.volley.VolleyError) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) HttpEntity(org.apache.http.HttpEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ImageRecord(io.swagger.client.model.ImageRecord) ArrayList(java.util.ArrayList) List(java.util.List) ExecutionException(java.util.concurrent.ExecutionException) Pair(io.swagger.client.Pair) ApiException(io.swagger.client.ApiException) TimeoutException(java.util.concurrent.TimeoutException)

Example 17 with ApiException

use of io.swagger.client.ApiException in project ef-app_android by eurofurence.

the class ImagesApi method apiV2ImagesByIdContentGet.

/**
 * Retrieve a single image content.
 *
 * @param id id of the requested entity
 * @return byte[]
 */
public byte[] apiV2ImagesByIdContentGet(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 apiV2ImagesByIdContentGet", new ApiException(400, "Missing the required parameter 'id' when calling apiV2ImagesByIdContentGet"));
    }
    // create path and map variables
    String path = "/Api/v2/Images/{Id}/Content".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 (byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].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;
    }
}
Also used : VolleyError(com.android.volley.VolleyError) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) HttpEntity(org.apache.http.HttpEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ExecutionException(java.util.concurrent.ExecutionException) ApiException(io.swagger.client.ApiException) Pair(io.swagger.client.Pair) TimeoutException(java.util.concurrent.TimeoutException)

Example 18 with ApiException

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.
 *
 * @return List<KnowledgeEntryRecord>
 */
public List<KnowledgeEntryRecord> apiV2KnowledgeEntriesGet() throws TimeoutException, ExecutionException, InterruptedException, ApiException {
    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 {
        String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
        if (localVarResponse != null) {
            return (List<KnowledgeEntryRecord>) ApiInvoker.deserialize(localVarResponse, "array", 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;
    }
}
Also used : VolleyError(com.android.volley.VolleyError) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) HttpEntity(org.apache.http.HttpEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ExecutionException(java.util.concurrent.ExecutionException) Pair(io.swagger.client.Pair) KnowledgeEntryRecord(io.swagger.client.model.KnowledgeEntryRecord) ApiException(io.swagger.client.ApiException) TimeoutException(java.util.concurrent.TimeoutException)

Example 19 with ApiException

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.
 *
 * @return List<KnowledgeGroupRecord>
 */
public List<KnowledgeGroupRecord> apiV2KnowledgeGroupsGet() throws TimeoutException, ExecutionException, InterruptedException, ApiException {
    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 {
        String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
        if (localVarResponse != null) {
            return (List<KnowledgeGroupRecord>) ApiInvoker.deserialize(localVarResponse, "array", 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;
    }
}
Also used : VolleyError(com.android.volley.VolleyError) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) HttpEntity(org.apache.http.HttpEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) KnowledgeGroupRecord(io.swagger.client.model.KnowledgeGroupRecord) ArrayList(java.util.ArrayList) List(java.util.List) ExecutionException(java.util.concurrent.ExecutionException) Pair(io.swagger.client.Pair) ApiException(io.swagger.client.ApiException) TimeoutException(java.util.concurrent.TimeoutException)

Example 20 with ApiException

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
 */
public void apiV2KnowledgeGroupsByIdGet(UUID id, final Response.Listener<KnowledgeGroupRecord> 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 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 {
        apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {

            @Override
            public void onResponse(String localVarResponse) {
                try {
                    responseListener.onResponse((KnowledgeGroupRecord) ApiInvoker.deserialize(localVarResponse, "", 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));
    }
}
Also used : VolleyError(com.android.volley.VolleyError) MultipartEntityBuilder(org.apache.http.entity.mime.MultipartEntityBuilder) HttpEntity(org.apache.http.HttpEntity) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) KnowledgeGroupRecord(io.swagger.client.model.KnowledgeGroupRecord) Response(com.android.volley.Response) ApiException(io.swagger.client.ApiException) Pair(io.swagger.client.Pair)

Aggregations

ApiException (io.swagger.client.ApiException)121 VolleyError (com.android.volley.VolleyError)120 Pair (io.swagger.client.Pair)120 ArrayList (java.util.ArrayList)120 HashMap (java.util.HashMap)120 HttpEntity (org.apache.http.HttpEntity)120 MultipartEntityBuilder (org.apache.http.entity.mime.MultipartEntityBuilder)120 Response (com.android.volley.Response)60 ExecutionException (java.util.concurrent.ExecutionException)60 TimeoutException (java.util.concurrent.TimeoutException)60 List (java.util.List)36 ApiSafeResultCollectTokenResponse (io.swagger.client.model.ApiSafeResultCollectTokenResponse)16 CollectTokenResponse (io.swagger.client.model.CollectTokenResponse)15 UUID (java.util.UUID)6 AnnouncementRecord (io.swagger.client.model.AnnouncementRecord)4 DealerRecord (io.swagger.client.model.DealerRecord)4 EventConferenceDayRecord (io.swagger.client.model.EventConferenceDayRecord)4 EventConferenceRoomRecord (io.swagger.client.model.EventConferenceRoomRecord)4 EventConferenceTrackRecord (io.swagger.client.model.EventConferenceTrackRecord)4 EventRecord (io.swagger.client.model.EventRecord)4