import uk.org.gss_data.pmd_drafter.api.DraftsetsApi def list() { def api = new DraftsetsApi() api.basePath = "https://production-drafter-ons-alpha.publishmydata.com" api.versionPath = "/v1" String pmd_api = "${PMD_API}" api.auth = "Basic " + pmd_api.bytes.encodeBase64() def ds = null println "Fetching draftsets..." api.draftsetsGet(null, { result -> ds = result }, { status, reason -> throw new Exception(reason) }) println ds.id return ds }