All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nem.symbol.sdk.openapi.okhttp_gson.api.MosaicRoutesApi Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
/*
 * Catapult REST Endpoints
 * OpenAPI Specification of catapult-rest 1.1.2
 *
 * The version of the OpenAPI document: 0.9.4
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.nem.symbol.sdk.openapi.okhttp_gson.api;

import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiCallback;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiClient;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiException;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiResponse;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.Configuration;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.Pair;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ProgressRequestBody;
import io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.nem.symbol.sdk.openapi.okhttp_gson.model.ModelError;
import io.nem.symbol.sdk.openapi.okhttp_gson.model.MosaicIds;
import io.nem.symbol.sdk.openapi.okhttp_gson.model.MosaicInfoDTO;
import io.nem.symbol.sdk.openapi.okhttp_gson.model.MosaicPage;
import io.nem.symbol.sdk.openapi.okhttp_gson.model.Order;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MosaicRoutesApi {
    private ApiClient localVarApiClient;

    public MosaicRoutesApi() {
        this(Configuration.getDefaultApiClient());
    }

    public MosaicRoutesApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for getMosaic
     * @param mosaicId Mosaic identifier. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/ public okhttp3.Call getMosaicCall(String mosaicId, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/mosaics/{mosaicId}" .replaceAll("\\{" + "mosaicId" + "\\}", localVarApiClient.escapeString(mosaicId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getMosaicValidateBeforeCall(String mosaicId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'mosaicId' is set if (mosaicId == null) { throw new ApiException("Missing the required parameter 'mosaicId' when calling getMosaic(Async)"); } okhttp3.Call localVarCall = getMosaicCall(mosaicId, _callback); return localVarCall; } /** * Get mosaic information * Gets the mosaic definition for a given mosaic identifier. * @param mosaicId Mosaic identifier. (required) * @return MosaicInfoDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/ public MosaicInfoDTO getMosaic(String mosaicId) throws ApiException { ApiResponse localVarResp = getMosaicWithHttpInfo(mosaicId); return localVarResp.getData(); } /** * Get mosaic information * Gets the mosaic definition for a given mosaic identifier. * @param mosaicId Mosaic identifier. (required) * @return ApiResponse<MosaicInfoDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/ public ApiResponse getMosaicWithHttpInfo(String mosaicId) throws ApiException { okhttp3.Call localVarCall = getMosaicValidateBeforeCall(mosaicId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get mosaic information (asynchronously) * Gets the mosaic definition for a given mosaic identifier. * @param mosaicId Mosaic identifier. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/ public okhttp3.Call getMosaicAsync(String mosaicId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getMosaicValidateBeforeCall(mosaicId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getMosaics * @param mosaicIds (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/ public okhttp3.Call getMosaicsCall(MosaicIds mosaicIds, final ApiCallback _callback) throws ApiException { Object localVarPostBody = mosaicIds; // create path and map variables String localVarPath = "/mosaics"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getMosaicsValidateBeforeCall(MosaicIds mosaicIds, final ApiCallback _callback) throws ApiException { // verify the required parameter 'mosaicIds' is set if (mosaicIds == null) { throw new ApiException("Missing the required parameter 'mosaicIds' when calling getMosaics(Async)"); } okhttp3.Call localVarCall = getMosaicsCall(mosaicIds, _callback); return localVarCall; } /** * Get mosaics information for an array of mosaics * Gets an array of mosaic definition. * @param mosaicIds (required) * @return List<MosaicInfoDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/ public List getMosaics(MosaicIds mosaicIds) throws ApiException { ApiResponse> localVarResp = getMosaicsWithHttpInfo(mosaicIds); return localVarResp.getData(); } /** * Get mosaics information for an array of mosaics * Gets an array of mosaic definition. * @param mosaicIds (required) * @return ApiResponse<List<MosaicInfoDTO>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/ public ApiResponse> getMosaicsWithHttpInfo(MosaicIds mosaicIds) throws ApiException { okhttp3.Call localVarCall = getMosaicsValidateBeforeCall(mosaicIds, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get mosaics information for an array of mosaics (asynchronously) * Gets an array of mosaic definition. * @param mosaicIds (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/ public okhttp3.Call getMosaicsAsync(MosaicIds mosaicIds, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getMosaicsValidateBeforeCall(mosaicIds, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for searchMosaics * @param ownerAddress Filter by owner address. (optional) * @param pageSize Select the number of entries to return. (optional, default to 10) * @param pageNumber Filter by page number. (optional, default to 1) * @param offset Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional) * @param order Sort responses in ascending or descending order based on the collection property set on the param ``orderBy``. If the request does not specify ``orderBy``, REST returns the collection ordered by id. (optional, default to desc) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 success -
409 InvalidArgument -
*/ public okhttp3.Call searchMosaicsCall(String ownerAddress, Integer pageSize, Integer pageNumber, String offset, Order order, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables String localVarPath = "/mosaics"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (ownerAddress != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("ownerAddress", ownerAddress)); } if (pageSize != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageSize", pageSize)); } if (pageNumber != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pageNumber", pageNumber)); } if (offset != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset)); } if (order != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("order", order)); } Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] { }; return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call searchMosaicsValidateBeforeCall(String ownerAddress, Integer pageSize, Integer pageNumber, String offset, Order order, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = searchMosaicsCall(ownerAddress, pageSize, pageNumber, offset, order, _callback); return localVarCall; } /** * Get mosaics * Gets an array of mosaics. * @param ownerAddress Filter by owner address. (optional) * @param pageSize Select the number of entries to return. (optional, default to 10) * @param pageNumber Filter by page number. (optional, default to 1) * @param offset Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional) * @param order Sort responses in ascending or descending order based on the collection property set on the param ``orderBy``. If the request does not specify ``orderBy``, REST returns the collection ordered by id. (optional, default to desc) * @return MosaicPage * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
409 InvalidArgument -
*/ public MosaicPage searchMosaics(String ownerAddress, Integer pageSize, Integer pageNumber, String offset, Order order) throws ApiException { ApiResponse localVarResp = searchMosaicsWithHttpInfo(ownerAddress, pageSize, pageNumber, offset, order); return localVarResp.getData(); } /** * Get mosaics * Gets an array of mosaics. * @param ownerAddress Filter by owner address. (optional) * @param pageSize Select the number of entries to return. (optional, default to 10) * @param pageNumber Filter by page number. (optional, default to 1) * @param offset Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional) * @param order Sort responses in ascending or descending order based on the collection property set on the param ``orderBy``. If the request does not specify ``orderBy``, REST returns the collection ordered by id. (optional, default to desc) * @return ApiResponse<MosaicPage> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 success -
409 InvalidArgument -
*/ public ApiResponse searchMosaicsWithHttpInfo(String ownerAddress, Integer pageSize, Integer pageNumber, String offset, Order order) throws ApiException { okhttp3.Call localVarCall = searchMosaicsValidateBeforeCall(ownerAddress, pageSize, pageNumber, offset, order, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get mosaics (asynchronously) * Gets an array of mosaics. * @param ownerAddress Filter by owner address. (optional) * @param pageSize Select the number of entries to return. (optional, default to 10) * @param pageNumber Filter by page number. (optional, default to 1) * @param offset Entry id at which to start pagination. If the ordering parameter is set to -id, the elements returned precede the identifier. Otherwise, newer elements with respect to the id are returned. (optional) * @param order Sort responses in ascending or descending order based on the collection property set on the param ``orderBy``. If the request does not specify ``orderBy``, REST returns the collection ordered by id. (optional, default to desc) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 success -
409 InvalidArgument -
*/ public okhttp3.Call searchMosaicsAsync(String ownerAddress, Integer pageSize, Integer pageNumber, String offset, Order order, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = searchMosaicsValidateBeforeCall(ownerAddress, pageSize, pageNumber, offset, order, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy