diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/PetApi.java b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/PetApi.java index 9fa2290e63f..e0787f74767 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/PetApi.java +++ b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/PetApi.java @@ -2,8 +2,9 @@ package com.wordnik.petstore.api; import com.wordnik.client.ApiException; import com.wordnik.client.ApiInvoker; -import java.io.File; + import com.wordnik.petstore.model.Pet; +import java.io.File; import java.util.*; public class PetApi { diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/StoreApi.java b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/StoreApi.java index b855953090a..614700d9cdc 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/StoreApi.java +++ b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/StoreApi.java @@ -2,7 +2,9 @@ package com.wordnik.petstore.api; import com.wordnik.client.ApiException; import com.wordnik.client.ApiInvoker; + import com.wordnik.petstore.model.Order; +import java.io.File; import java.util.*; public class StoreApi { diff --git a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/UserApi.java b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/UserApi.java index 158bfa5abc5..06cf8d73d9d 100644 --- a/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/UserApi.java +++ b/samples/client/petstore/java/src/main/java/com/wordnik/petstore/api/UserApi.java @@ -2,7 +2,9 @@ package com.wordnik.petstore.api; import com.wordnik.client.ApiException; import com.wordnik.client.ApiInvoker; + import com.wordnik.petstore.model.User; +import java.io.File; import java.util.*; public class UserApi { @@ -21,111 +23,6 @@ public class UserApi { return basePath; } - public void createUser (User body) throws ApiException { - // verify required params are set - if(body == null ) { - throw new ApiException(400, "missing required params"); - } - // create path and map variables - String path = "/user".replaceAll("\\{format\\}","json"); - - // query params - Map queryParams = new HashMap(); - Map headerParams = new HashMap(); - Map formParams = new HashMap(); - - String[] contentTypes = { - "application/json"}; - - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - if(ex.getCode() == 404) { - return ; - } - else { - throw ex; - } - } - } - public void createUsersWithArrayInput (List body) throws ApiException { - // verify required params are set - if(body == null ) { - throw new ApiException(400, "missing required params"); - } - // create path and map variables - String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); - - // query params - Map queryParams = new HashMap(); - Map headerParams = new HashMap(); - Map formParams = new HashMap(); - - String[] contentTypes = { - "application/json"}; - - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - if(ex.getCode() == 404) { - return ; - } - else { - throw ex; - } - } - } - public void createUsersWithListInput (List body) throws ApiException { - // verify required params are set - if(body == null ) { - throw new ApiException(400, "missing required params"); - } - // create path and map variables - String path = "/user/createWithList".replaceAll("\\{format\\}","json"); - - // query params - Map queryParams = new HashMap(); - Map headerParams = new HashMap(); - Map formParams = new HashMap(); - - String[] contentTypes = { - "application/json"}; - - String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; - - try { - String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); - if(response != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - if(ex.getCode() == 404) { - return ; - } - else { - throw ex; - } - } - } public void updateUser (String username, User body) throws ApiException { // verify required params are set if(username == null || body == null ) { @@ -301,5 +198,110 @@ public class UserApi { } } } + public void createUser (User body) throws ApiException { + // verify required params are set + if(body == null ) { + throw new ApiException(400, "missing required params"); + } + // create path and map variables + String path = "/user".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + String[] contentTypes = { + "application/json"}; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + if(ex.getCode() == 404) { + return ; + } + else { + throw ex; + } + } + } + public void createUsersWithArrayInput (List body) throws ApiException { + // verify required params are set + if(body == null ) { + throw new ApiException(400, "missing required params"); + } + // create path and map variables + String path = "/user/createWithArray".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + String[] contentTypes = { + "application/json"}; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + if(ex.getCode() == 404) { + return ; + } + else { + throw ex; + } + } + } + public void createUsersWithListInput (List body) throws ApiException { + // verify required params are set + if(body == null ) { + throw new ApiException(400, "missing required params"); + } + // create path and map variables + String path = "/user/createWithList".replaceAll("\\{format\\}","json"); + + // query params + Map queryParams = new HashMap(); + Map headerParams = new HashMap(); + Map formParams = new HashMap(); + + String[] contentTypes = { + "application/json"}; + + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + + try { + String response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams, body, headerParams, formParams, contentType); + if(response != null){ + return ; + } + else { + return ; + } + } catch (ApiException ex) { + if(ex.getCode() == 404) { + return ; + } + else { + throw ex; + } + } + } }