Search in sources :

Example 61 with ApiException

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

the class FursuitsApi method apiV2FursuitsCollectingGamePlayerParticipationCollectionEntriesGet.

/**
 *   * Requires authorization     * Requires any of the following roles: **`Attendee`**
 * @return List<PlayerCollectionEntry>
 */
public List<PlayerCollectionEntry> apiV2FursuitsCollectingGamePlayerParticipationCollectionEntriesGet() throws TimeoutException, ExecutionException, InterruptedException, ApiException {
    Object postBody = null;
    // create path and map variables
    String path = "/Api/v2/Fursuits/CollectingGame/PlayerParticipation/CollectionEntries".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[] { "Bearer" };
    try {
        String localVarResponse = apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
        if (localVarResponse != null) {
            return (List<PlayerCollectionEntry>) ApiInvoker.deserialize(localVarResponse, "array", PlayerCollectionEntry.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) PlayerCollectionEntry(io.swagger.client.model.PlayerCollectionEntry) 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 62 with ApiException

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

the class FursuitsApi method apiV2FursuitsBadgesGet.

/**
 * Return all Fursuit Badge Registrations
 *   * Requires authorization     * Requires any of the following roles: **&#x60;Developer&#x60;**, **&#x60;FursuitBadgeSystem&#x60;**, **&#x60;System&#x60;**  **Not meant to be consumed by the mobile apps**
 */
public void apiV2FursuitsBadgesGet(final Response.Listener<List<FursuitBadgeRecord>> responseListener, final Response.ErrorListener errorListener) {
    Object postBody = null;
    // create path and map variables
    String path = "/Api/v2/Fursuits/Badges".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[] { "Bearer" };
    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<FursuitBadgeRecord>) ApiInvoker.deserialize(localVarResponse, "array", FursuitBadgeRecord.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 : FursuitBadgeRecord(io.swagger.client.model.FursuitBadgeRecord) 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) Response(com.android.volley.Response) CollectTokenResponse(io.swagger.client.model.CollectTokenResponse) ApiSafeResultCollectTokenResponse(io.swagger.client.model.ApiSafeResultCollectTokenResponse) ArrayList(java.util.ArrayList) List(java.util.List) Pair(io.swagger.client.Pair) ApiException(io.swagger.client.ApiException)

Example 63 with ApiException

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

the class FursuitsApi method apiV2FursuitsCollectingGameFursuitParticpationBadgesByFursuitBadgeIdTokenPost.

/**
 * Register (link/assign) a valid, unused token to a fursuit badge.
 *   * Requires authorization     * Requires any of the following roles: **&#x60;Attendee&#x60;**
 * @param fursuitBadgeId    * @param tokenValue
 */
public void apiV2FursuitsCollectingGameFursuitParticpationBadgesByFursuitBadgeIdTokenPost(UUID fursuitBadgeId, String tokenValue, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
    Object postBody = tokenValue;
    // verify the required parameter 'fursuitBadgeId' is set
    if (fursuitBadgeId == null) {
        VolleyError error = new VolleyError("Missing the required parameter 'fursuitBadgeId' when calling apiV2FursuitsCollectingGameFursuitParticpationBadgesByFursuitBadgeIdTokenPost", new ApiException(400, "Missing the required parameter 'fursuitBadgeId' when calling apiV2FursuitsCollectingGameFursuitParticpationBadgesByFursuitBadgeIdTokenPost"));
    }
    // create path and map variables
    String path = "/Api/v2/Fursuits/CollectingGame/FursuitParticpation/Badges/{FursuitBadgeId}/Token".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "FursuitBadgeId" + "\\}", apiInvoker.escapeString(fursuitBadgeId.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) {
                responseListener.onResponse(localVarResponse);
            }
        }, 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) Response(com.android.volley.Response) CollectTokenResponse(io.swagger.client.model.CollectTokenResponse) ApiSafeResultCollectTokenResponse(io.swagger.client.model.ApiSafeResultCollectTokenResponse) ApiException(io.swagger.client.ApiException) Pair(io.swagger.client.Pair)

Example 64 with ApiException

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

the class FursuitsApi method apiV2FursuitsCollectingGamePlayerParticipationCollectTokenSafePost.

/**
 *   * Requires authorization     * Requires any of the following roles: **&#x60;Attendee&#x60;**
 * @param tokenValue
 */
public void apiV2FursuitsCollectingGamePlayerParticipationCollectTokenSafePost(String tokenValue, final Response.Listener<ApiSafeResultCollectTokenResponse> responseListener, final Response.ErrorListener errorListener) {
    Object postBody = tokenValue;
    // create path and map variables
    String path = "/Api/v2/Fursuits/CollectingGame/PlayerParticipation/CollectToken:safe".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 = { "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((ApiSafeResultCollectTokenResponse) ApiInvoker.deserialize(localVarResponse, "", ApiSafeResultCollectTokenResponse.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) Response(com.android.volley.Response) CollectTokenResponse(io.swagger.client.model.CollectTokenResponse) ApiSafeResultCollectTokenResponse(io.swagger.client.model.ApiSafeResultCollectTokenResponse) ApiSafeResultCollectTokenResponse(io.swagger.client.model.ApiSafeResultCollectTokenResponse) Pair(io.swagger.client.Pair) ApiException(io.swagger.client.ApiException)

Example 65 with ApiException

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

the class FursuitsApi method apiV2FursuitsCollectingGamePlayerParticipationCollectionEntriesGet.

/**
 *   * Requires authorization     * Requires any of the following roles: **&#x60;Attendee&#x60;**
 */
public void apiV2FursuitsCollectingGamePlayerParticipationCollectionEntriesGet(final Response.Listener<List<PlayerCollectionEntry>> responseListener, final Response.ErrorListener errorListener) {
    Object postBody = null;
    // create path and map variables
    String path = "/Api/v2/Fursuits/CollectingGame/PlayerParticipation/CollectionEntries".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[] { "Bearer" };
    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<PlayerCollectionEntry>) ApiInvoker.deserialize(localVarResponse, "array", PlayerCollectionEntry.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) Response(com.android.volley.Response) CollectTokenResponse(io.swagger.client.model.CollectTokenResponse) ApiSafeResultCollectTokenResponse(io.swagger.client.model.ApiSafeResultCollectTokenResponse) PlayerCollectionEntry(io.swagger.client.model.PlayerCollectionEntry) ArrayList(java.util.ArrayList) List(java.util.List) Pair(io.swagger.client.Pair) ApiException(io.swagger.client.ApiException)

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