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

import java.util.*;

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

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

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

        

        // Also still TODO: form params, body param

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

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

        if (!"null".equals(String.valueOf(displayName)))
            queryParams.put("display-name", String.valueOf(displayName))
if (!"null".equals(String.valueOf(description)))
            queryParams.put("description", String.valueOf(description))


        // Also still TODO: form params, body param

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