Newer
Older
drafter-groovy / src / main / groovy / io / swagger / api / UpdatingDataApi.groovy
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.AsyncJob
import io.swagger.model.Draftset

import java.util.*;

@Mixin(ApiUtils)
class UpdatingDataApi {
    String basePath = "https://localhost/v1"
    String versionPath = "/api/v1"

    def draftsetIdChangesDelete ( String id, String graph, Closure onSuccess, Closure onFailure)  {
        // create path and map path parameters (TODO)
        String resourcePath = "/draftset/{id}/changes"

        // query params
        def queryParams = [:]
        def headerParams = [:]
    
        // verify required params are set
        if (id == null) {
            throw new RuntimeException("missing required params id")
        }
        // verify required params are set
        if (graph == null) {
            throw new RuntimeException("missing required params graph")
        }

        if (!"null".equals(String.valueOf(graph)))
            queryParams.put("graph", String.valueOf(graph))


        // Also still TODO: form params, body param

        invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams,
                    "DELETE", "",
                    Draftset.class )
                    
    }
    def draftsetIdDataDelete ( String id, String data, String graph, Closure onSuccess, Closure onFailure)  {
        // create path and map path parameters (TODO)
        String resourcePath = "/draftset/{id}/data"

        // query params
        def queryParams = [:]
        def headerParams = [:]
    
        // verify required params are set
        if (id == null) {
            throw new RuntimeException("missing required params id")
        }
        // verify required params are set
        if (data == null) {
            throw new RuntimeException("missing required params data")
        }

        if (!"null".equals(String.valueOf(graph)))
            queryParams.put("graph", String.valueOf(graph))


        // Also still TODO: form params, body param

        invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams,
                    "DELETE", "",
                    AsyncJob.class )
                    
    }
    def draftsetIdDataPut ( String id, String data, String graph, Closure onSuccess, Closure onFailure)  {
        // create path and map path parameters (TODO)
        String resourcePath = "/draftset/{id}/data"

        // query params
        def queryParams = [:]
        def headerParams = [:]
    
        // verify required params are set
        if (id == null) {
            throw new RuntimeException("missing required params id")
        }
        // verify required params are set
        if (data == null) {
            throw new RuntimeException("missing required params data")
        }

        if (!"null".equals(String.valueOf(graph)))
            queryParams.put("graph", String.valueOf(graph))


        // Also still TODO: form params, body param

        invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams,
                    "PUT", "",
                    AsyncJob.class )
                    
    }
    def draftsetIdGraphDelete ( String id, String graph, Boolean silent, Closure onSuccess, Closure onFailure)  {
        // create path and map path parameters (TODO)
        String resourcePath = "/draftset/{id}/graph"

        // query params
        def queryParams = [:]
        def headerParams = [:]
    
        // verify required params are set
        if (id == null) {
            throw new RuntimeException("missing required params id")
        }
        // verify required params are set
        if (graph == null) {
            throw new RuntimeException("missing required params graph")
        }

        if (!"null".equals(String.valueOf(graph)))
            queryParams.put("graph", String.valueOf(graph))
if (!"null".equals(String.valueOf(silent)))
            queryParams.put("silent", String.valueOf(silent))


        // Also still TODO: form params, body param

        invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams,
                    "DELETE", "",
                    Draftset.class )
                    
    }
    def draftsetIdGraphPut ( String id, String graph, Closure onSuccess, Closure onFailure)  {
        // create path and map path parameters (TODO)
        String resourcePath = "/draftset/{id}/graph"

        // query params
        def queryParams = [:]
        def headerParams = [:]
    
        // verify required params are set
        if (id == null) {
            throw new RuntimeException("missing required params id")
        }
        // verify required params are set
        if (graph == null) {
            throw new RuntimeException("missing required params graph")
        }

        if (!"null".equals(String.valueOf(graph)))
            queryParams.put("graph", String.valueOf(graph))


        // Also still TODO: form params, body param

        invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams,
                    "PUT", "",
                    AsyncJob.class )
                    
    }
}