package io.swagger.api; import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* import io.swagger.api.ApiUtils import io.swagger.model.File import java.util.*; @Mixin(ApiUtils) class SparqlEndpointsApi { String basePath = "https://localhost/v1" String versionPath = "/api/v1" def sparqlLiveGet ( String query, Integer timeout, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/sparql/live" // query params def queryParams = [:] def headerParams = [:] // verify required params are set if (query == null) { throw new RuntimeException("missing required params query") } if (!"null".equals(String.valueOf(query))) queryParams.put("query", String.valueOf(query)) if (!"null".equals(String.valueOf(timeout))) queryParams.put("timeout", String.valueOf(timeout)) // Also still TODO: form params, body param invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "GET", "", File.class ) } def sparqlLivePost ( String query, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/sparql/live" // query params def queryParams = [:] def headerParams = [:] // verify required params are set if (query == null) { throw new RuntimeException("missing required params query") } // Also still TODO: form params, body param invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, "POST", "", File.class ) } }