forked from loafle/openapi-generator-original
fix equals and hashcode for Android
This commit is contained in:
parent
aea6697abd
commit
7888205657
@ -38,6 +38,29 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
|
|||||||
|
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
{{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}}
|
||||||
|
return {{#vars}}({{name}} == null ? {{classVarName}}.{{name}} == null : {{name}}.equals({{classVarName}}.{{name}})){{#hasMore}} &&
|
||||||
|
{{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}}
|
||||||
|
return true;{{/hasVars}}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
{{#vars}}
|
||||||
|
result = 31 * result + ({{name}} == null ? 0: {{name}}.hashCode());{{#hasMore}}{{/hasMore}}
|
||||||
|
{{/vars}}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -38,6 +38,29 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
|
|||||||
|
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
{{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}}
|
||||||
|
return {{#vars}}({{name}} == null ? {{classVarName}}.{{name}} == null : {{name}}.equals({{classVarName}}.{{name}})){{#hasMore}} &&
|
||||||
|
{{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}}
|
||||||
|
return true;{{/hasVars}}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
{{#vars}}
|
||||||
|
result = 31 * result + ({{name}} == null ? 0: {{name}}.hashCode());{{#hasMore}}{{/hasMore}}
|
||||||
|
{{/vars}}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -7,9 +7,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:1.5.+'
|
classpath 'com.android.tools.build:gradle:1.5.+'
|
||||||
|
|
||||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Hello world!
|
|
@ -35,38 +35,10 @@ public class JsonUtil {
|
|||||||
public static Type getListTypeForDeserialization(Class cls) {
|
public static Type getListTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
if ("Animal".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Animal>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Cat".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Cat>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Category>>(){}.getType();
|
return new TypeToken<List<Category>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Dog".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Dog>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<InlineResponse200>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Model200Response".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Model200Response>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<ModelReturn>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Name".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Name>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Order>>(){}.getType();
|
return new TypeToken<List<Order>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -75,10 +47,6 @@ public class JsonUtil {
|
|||||||
return new TypeToken<List<Pet>>(){}.getType();
|
return new TypeToken<List<Pet>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<SpecialModelName>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Tag>>(){}.getType();
|
return new TypeToken<List<Tag>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -93,38 +61,10 @@ public class JsonUtil {
|
|||||||
public static Type getTypeForDeserialization(Class cls) {
|
public static Type getTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
if ("Animal".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Animal>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Cat".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Cat>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Category>(){}.getType();
|
return new TypeToken<Category>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Dog".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Dog>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<InlineResponse200>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Model200Response".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Model200Response>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<ModelReturn>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Name".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Name>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Order>(){}.getType();
|
return new TypeToken<Order>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -133,10 +73,6 @@ public class JsonUtil {
|
|||||||
return new TypeToken<Pet>(){}.getType();
|
return new TypeToken<Pet>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<SpecialModelName>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Tag>(){}.getType();
|
return new TypeToken<Tag>(){}.getType();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import io.swagger.client.model.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import io.swagger.client.model.Pet;
|
import io.swagger.client.model.Pet;
|
||||||
import io.swagger.client.model.InlineResponse200;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
@ -38,7 +37,6 @@ public class PetApi {
|
|||||||
return basePath;
|
return basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
@ -61,8 +59,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/json","application/xml"
|
"application/json","application/xml"
|
||||||
};
|
};
|
||||||
@ -76,7 +72,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -91,60 +86,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
*
|
|
||||||
* @param body Pet object in the form of byte array
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public void addPetUsingByteArray (byte[] body) throws ApiException {
|
|
||||||
Object localVarPostBody = body;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
"application/json","application/xml"
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a pet
|
* Deletes a pet
|
||||||
*
|
*
|
||||||
@ -172,11 +113,8 @@ public class PetApi {
|
|||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey));
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -190,7 +128,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -205,11 +142,10 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma seperated strings
|
||||||
* @param status Status values that need to be considered for query
|
* @param status Status values that need to be considered for filter
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
public List<Pet> findPetsByStatus (List<String> status) throws ApiException {
|
||||||
@ -226,12 +162,9 @@ public class PetApi {
|
|||||||
// form params
|
// form params
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "status", status));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -245,7 +178,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -260,7 +192,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by tags
|
* Finds Pets by tags
|
||||||
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
@ -281,12 +212,9 @@ public class PetApi {
|
|||||||
// form params
|
// form params
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("multi", "tags", tags));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -300,7 +228,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -315,7 +242,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find pet by ID
|
* Find pet by ID
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||||
@ -343,8 +269,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -358,7 +282,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -373,123 +296,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
* @return InlineResponse200
|
|
||||||
*/
|
|
||||||
public InlineResponse200 getPetByIdInObject (Long petId) throws ApiException {
|
|
||||||
Object localVarPostBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
* @return byte[]
|
|
||||||
*/
|
|
||||||
public byte[] petPetIdtestingByteArraytrueGet (Long petId) throws ApiException {
|
|
||||||
Object localVarPostBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
@ -512,8 +318,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/json","application/xml"
|
"application/json","application/xml"
|
||||||
};
|
};
|
||||||
@ -527,7 +331,6 @@ public class PetApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -542,7 +345,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a pet in the store with form data
|
* Updates a pet in the store with form data
|
||||||
*
|
*
|
||||||
@ -572,8 +374,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
};
|
};
|
||||||
@ -597,7 +397,6 @@ public class PetApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
localVarFormParams.put("name", ApiInvoker.parameterToString(name));
|
localVarFormParams.put("name", ApiInvoker.parameterToString(name));
|
||||||
localVarFormParams.put("status", ApiInvoker.parameterToString(status));
|
localVarFormParams.put("status", ApiInvoker.parameterToString(status));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -612,7 +411,6 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploads an image
|
* uploads an image
|
||||||
*
|
*
|
||||||
@ -642,8 +440,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
"multipart/form-data"
|
"multipart/form-data"
|
||||||
};
|
};
|
||||||
@ -667,7 +463,6 @@ public class PetApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -682,5 +477,4 @@ public class PetApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,8 @@ import io.swagger.client.model.*;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import io.swagger.client.model.Order;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import io.swagger.client.model.Order;
|
||||||
|
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
|
|
||||||
@ -37,7 +37,6 @@ public class StoreApi {
|
|||||||
return basePath;
|
return basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
@ -65,8 +64,6 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -80,7 +77,6 @@ public class StoreApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -95,62 +91,6 @@ public class StoreApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Finds orders by status
|
|
||||||
* A single status value can be provided as a string
|
|
||||||
* @param status Status value that needs to be considered for query
|
|
||||||
* @return List<Order>
|
|
||||||
*/
|
|
||||||
public List<Order> findOrdersByStatus (String status) throws ApiException {
|
|
||||||
Object localVarPostBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
@ -172,8 +112,6 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -187,7 +125,6 @@ public class StoreApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -202,62 +139,9 @@ public class StoreApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
|
||||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
|
||||||
* @return Object
|
|
||||||
*/
|
|
||||||
public Object getInventoryInObject () throws ApiException {
|
|
||||||
Object localVarPostBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String localVarPath = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (localVarContentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
localVarPostBody = localVarBuilder.build();
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
* @param orderId ID of pet that needs to be fetched
|
* @param orderId ID of pet that needs to be fetched
|
||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
@ -282,8 +166,6 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -297,7 +179,6 @@ public class StoreApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -312,7 +193,6 @@ public class StoreApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place an order for a pet
|
* Place an order for a pet
|
||||||
*
|
*
|
||||||
@ -335,8 +215,6 @@ public class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -350,7 +228,6 @@ public class StoreApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -365,5 +242,4 @@ public class StoreApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ public class UserApi {
|
|||||||
return basePath;
|
return basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -60,8 +59,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -75,7 +72,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -90,7 +86,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
@ -113,8 +108,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -128,7 +121,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -143,7 +135,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates list of users with given input array
|
* Creates list of users with given input array
|
||||||
*
|
*
|
||||||
@ -166,8 +157,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -181,7 +170,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -196,7 +184,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete user
|
* Delete user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -224,8 +211,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -239,7 +224,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -254,7 +238,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user by user name
|
* Get user by user name
|
||||||
*
|
*
|
||||||
@ -282,8 +265,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -297,7 +278,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -312,7 +292,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs user into the system
|
* Logs user into the system
|
||||||
*
|
*
|
||||||
@ -334,14 +313,10 @@ public class UserApi {
|
|||||||
// form params
|
// form params
|
||||||
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
Map<String, String> localVarFormParams = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username));
|
||||||
|
|
||||||
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password));
|
localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -355,7 +330,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -370,7 +344,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs out current logged in user session
|
* Logs out current logged in user session
|
||||||
*
|
*
|
||||||
@ -392,8 +365,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -407,7 +378,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -422,7 +392,6 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated user
|
* Updated user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -451,8 +420,6 @@ public class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] localVarContentTypes = {
|
String[] localVarContentTypes = {
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -466,7 +433,6 @@ public class UserApi {
|
|||||||
localVarPostBody = localVarBuilder.build();
|
localVarPostBody = localVarBuilder.build();
|
||||||
} else {
|
} else {
|
||||||
// normal form params
|
// normal form params
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -481,5 +447,4 @@ public class UserApi {
|
|||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Animal {\n");
|
|
||||||
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Animal;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Cat extends Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
@SerializedName("declawed")
|
|
||||||
private Boolean declawed = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Boolean getDeclawed() {
|
|
||||||
return declawed;
|
|
||||||
}
|
|
||||||
public void setDeclawed(Boolean declawed) {
|
|
||||||
this.declawed = declawed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Cat {\n");
|
|
||||||
sb.append(" " + super.toString()).append("\n");
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append(" declawed: ").append(declawed).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,7 +13,6 @@ public class Category {
|
|||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -24,7 +23,6 @@ public class Category {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -36,6 +34,26 @@ public class Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Category category = (Category) o;
|
||||||
|
return (id == null ? category.id == null : id.equals(category.id)) &&
|
||||||
|
(name == null ? category.name == null : name.equals(category.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Animal;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Dog extends Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
@SerializedName("breed")
|
|
||||||
private String breed = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getBreed() {
|
|
||||||
return breed;
|
|
||||||
}
|
|
||||||
public void setBreed(String breed) {
|
|
||||||
this.breed = breed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Dog {\n");
|
|
||||||
sb.append(" " + super.toString()).append("\n");
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append(" breed: ").append(breed).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Tag;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class InlineResponse200 {
|
|
||||||
|
|
||||||
@SerializedName("photoUrls")
|
|
||||||
private List<String> photoUrls = null;
|
|
||||||
@SerializedName("name")
|
|
||||||
private String name = null;
|
|
||||||
@SerializedName("id")
|
|
||||||
private Long id = null;
|
|
||||||
@SerializedName("category")
|
|
||||||
private Object category = null;
|
|
||||||
@SerializedName("tags")
|
|
||||||
private List<Tag> tags = null;
|
|
||||||
public enum StatusEnum {
|
|
||||||
available, pending, sold,
|
|
||||||
};
|
|
||||||
@SerializedName("status")
|
|
||||||
private StatusEnum status = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public List<String> getPhotoUrls() {
|
|
||||||
return photoUrls;
|
|
||||||
}
|
|
||||||
public void setPhotoUrls(List<String> photoUrls) {
|
|
||||||
this.photoUrls = photoUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Object getCategory() {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
public void setCategory(Object category) {
|
|
||||||
this.category = category;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public List<Tag> getTags() {
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
public void setTags(List<Tag> tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pet status in the store
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
|
||||||
public StatusEnum getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
public void setStatus(StatusEnum status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class InlineResponse200 {\n");
|
|
||||||
|
|
||||||
sb.append(" photoUrls: ").append(photoUrls).append("\n");
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append(" id: ").append(id).append("\n");
|
|
||||||
sb.append(" category: ").append(category).append("\n");
|
|
||||||
sb.append(" tags: ").append(tags).append("\n");
|
|
||||||
sb.append(" status: ").append(status).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing model name starting with number
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing model name starting with number")
|
|
||||||
public class Model200Response {
|
|
||||||
|
|
||||||
@SerializedName("name")
|
|
||||||
private Integer name = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(Integer name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Model200Response {\n");
|
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing reserved words
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing reserved words")
|
|
||||||
public class ModelReturn {
|
|
||||||
|
|
||||||
@SerializedName("return")
|
|
||||||
private Integer _return = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getReturn() {
|
|
||||||
return _return;
|
|
||||||
}
|
|
||||||
public void setReturn(Integer _return) {
|
|
||||||
this._return = _return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class ModelReturn {\n");
|
|
||||||
|
|
||||||
sb.append(" _return: ").append(_return).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing model name same as property name
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing model name same as property name")
|
|
||||||
public class Name {
|
|
||||||
|
|
||||||
@SerializedName("name")
|
|
||||||
private Integer name = null;
|
|
||||||
@SerializedName("snake_case")
|
|
||||||
private Integer snakeCase = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(Integer name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getSnakeCase() {
|
|
||||||
return snakeCase;
|
|
||||||
}
|
|
||||||
public void setSnakeCase(Integer snakeCase) {
|
|
||||||
this.snakeCase = snakeCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Name {\n");
|
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append(" snakeCase: ").append(snakeCase).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,7 +25,6 @@ public class Order {
|
|||||||
@SerializedName("complete")
|
@SerializedName("complete")
|
||||||
private Boolean complete = null;
|
private Boolean complete = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -36,7 +35,6 @@ public class Order {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -47,7 +45,6 @@ public class Order {
|
|||||||
this.petId = petId;
|
this.petId = petId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -58,7 +55,6 @@ public class Order {
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -69,7 +65,6 @@ public class Order {
|
|||||||
this.shipDate = shipDate;
|
this.shipDate = shipDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
||||||
**/
|
**/
|
||||||
@ -81,7 +76,6 @@ public class Order {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -93,6 +87,34 @@ public class Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Order order = (Order) o;
|
||||||
|
return (id == null ? order.id == null : id.equals(order.id)) &&
|
||||||
|
(petId == null ? order.petId == null : petId.equals(order.petId)) &&
|
||||||
|
(quantity == null ? order.quantity == null : quantity.equals(order.quantity)) &&
|
||||||
|
(shipDate == null ? order.shipDate == null : shipDate.equals(order.shipDate)) &&
|
||||||
|
(status == null ? order.status == null : status.equals(order.status)) &&
|
||||||
|
(complete == null ? order.complete == null : complete.equals(order.complete));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (petId == null ? 0: petId.hashCode());
|
||||||
|
result = 31 * result + (quantity == null ? 0: quantity.hashCode());
|
||||||
|
result = 31 * result + (shipDate == null ? 0: shipDate.hashCode());
|
||||||
|
result = 31 * result + (status == null ? 0: status.hashCode());
|
||||||
|
result = 31 * result + (complete == null ? 0: complete.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -27,7 +27,6 @@ public class Pet {
|
|||||||
@SerializedName("status")
|
@SerializedName("status")
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -38,7 +37,6 @@ public class Pet {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -49,7 +47,6 @@ public class Pet {
|
|||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@ -60,7 +57,6 @@ public class Pet {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(required = true, value = "")
|
@ApiModelProperty(required = true, value = "")
|
||||||
@ -71,7 +67,6 @@ public class Pet {
|
|||||||
this.photoUrls = photoUrls;
|
this.photoUrls = photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -82,7 +77,6 @@ public class Pet {
|
|||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
**/
|
**/
|
||||||
@ -95,6 +89,34 @@ public class Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Pet pet = (Pet) o;
|
||||||
|
return (id == null ? pet.id == null : id.equals(pet.id)) &&
|
||||||
|
(category == null ? pet.category == null : category.equals(pet.category)) &&
|
||||||
|
(name == null ? pet.name == null : name.equals(pet.name)) &&
|
||||||
|
(photoUrls == null ? pet.photoUrls == null : photoUrls.equals(pet.photoUrls)) &&
|
||||||
|
(tags == null ? pet.tags == null : tags.equals(pet.tags)) &&
|
||||||
|
(status == null ? pet.status == null : status.equals(pet.status));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (category == null ? 0: category.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
result = 31 * result + (photoUrls == null ? 0: photoUrls.hashCode());
|
||||||
|
result = 31 * result + (tags == null ? 0: tags.hashCode());
|
||||||
|
result = 31 * result + (status == null ? 0: status.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class SpecialModelName {
|
|
||||||
|
|
||||||
@SerializedName("$special[property.name]")
|
|
||||||
private Long specialPropertyName = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Long getSpecialPropertyName() {
|
|
||||||
return specialPropertyName;
|
|
||||||
}
|
|
||||||
public void setSpecialPropertyName(Long specialPropertyName) {
|
|
||||||
this.specialPropertyName = specialPropertyName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class SpecialModelName {\n");
|
|
||||||
|
|
||||||
sb.append(" specialPropertyName: ").append(specialPropertyName).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,7 +13,6 @@ public class Tag {
|
|||||||
@SerializedName("name")
|
@SerializedName("name")
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -24,7 +23,6 @@ public class Tag {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -36,6 +34,26 @@ public class Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Tag tag = (Tag) o;
|
||||||
|
return (id == null ? tag.id == null : id.equals(tag.id)) &&
|
||||||
|
(name == null ? tag.name == null : name.equals(tag.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -25,7 +25,6 @@ public class User {
|
|||||||
@SerializedName("userStatus")
|
@SerializedName("userStatus")
|
||||||
private Integer userStatus = null;
|
private Integer userStatus = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -36,7 +35,6 @@ public class User {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -47,7 +45,6 @@ public class User {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -58,7 +55,6 @@ public class User {
|
|||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -69,7 +65,6 @@ public class User {
|
|||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -80,7 +75,6 @@ public class User {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -91,7 +85,6 @@ public class User {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty(value = "")
|
@ApiModelProperty(value = "")
|
||||||
@ -102,7 +95,6 @@ public class User {
|
|||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Status
|
* User Status
|
||||||
**/
|
**/
|
||||||
@ -115,6 +107,38 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
User user = (User) o;
|
||||||
|
return (id == null ? user.id == null : id.equals(user.id)) &&
|
||||||
|
(username == null ? user.username == null : username.equals(user.username)) &&
|
||||||
|
(firstName == null ? user.firstName == null : firstName.equals(user.firstName)) &&
|
||||||
|
(lastName == null ? user.lastName == null : lastName.equals(user.lastName)) &&
|
||||||
|
(email == null ? user.email == null : email.equals(user.email)) &&
|
||||||
|
(password == null ? user.password == null : password.equals(user.password)) &&
|
||||||
|
(phone == null ? user.phone == null : phone.equals(user.phone)) &&
|
||||||
|
(userStatus == null ? user.userStatus == null : userStatus.equals(user.userStatus));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (username == null ? 0: username.hashCode());
|
||||||
|
result = 31 * result + (firstName == null ? 0: firstName.hashCode());
|
||||||
|
result = 31 * result + (lastName == null ? 0: lastName.hashCode());
|
||||||
|
result = 31 * result + (email == null ? 0: email.hashCode());
|
||||||
|
result = 31 * result + (password == null ? 0: password.hashCode());
|
||||||
|
result = 31 * result + (phone == null ? 0: phone.hashCode());
|
||||||
|
result = 31 * result + (userStatus == null ? 0: userStatus.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -1,91 +0,0 @@
|
|||||||
package io.swagger.client;
|
|
||||||
|
|
||||||
import org.junit.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
|
|
||||||
public class ApiInvokerTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParameterToPairsWhenNameIsInvalid() throws Exception {
|
|
||||||
List<Pair> pairs_a = ApiInvoker.parameterToPairs("csv", null, new Integer(1));
|
|
||||||
List<Pair> pairs_b = ApiInvoker.parameterToPairs("csv", "", new Integer(1));
|
|
||||||
|
|
||||||
assertTrue(pairs_a.isEmpty());
|
|
||||||
assertTrue(pairs_b.isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParameterToPairsWhenValueIsNull() throws Exception {
|
|
||||||
List<Pair> pairs = ApiInvoker.parameterToPairs("csv", "param-a", null);
|
|
||||||
|
|
||||||
assertTrue(pairs.isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception {
|
|
||||||
|
|
||||||
// single empty string
|
|
||||||
List<Pair> pairs = ApiInvoker.parameterToPairs("csv", "param-a", " ");
|
|
||||||
assertEquals(1, pairs.size());
|
|
||||||
|
|
||||||
// list of empty strings
|
|
||||||
List<String> strs = new ArrayList<String>();
|
|
||||||
strs.add(" ");
|
|
||||||
strs.add(" ");
|
|
||||||
strs.add(" ");
|
|
||||||
|
|
||||||
List<Pair> concatStrings = ApiInvoker.parameterToPairs("csv", "param-a", strs);
|
|
||||||
|
|
||||||
assertEquals(1, concatStrings.size());
|
|
||||||
assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParameterToPairsWhenValueIsNotCollection() throws Exception {
|
|
||||||
String name = "param-a";
|
|
||||||
Integer value = 1;
|
|
||||||
|
|
||||||
List<Pair> pairs = ApiInvoker.parameterToPairs("csv", name, value);
|
|
||||||
|
|
||||||
assertEquals(1, pairs.size());
|
|
||||||
assertEquals(value, Integer.valueOf(pairs.get(0).getValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testParameterToPairsWhenValueIsCollection() throws Exception {
|
|
||||||
Map<String, String> collectionFormatMap = new HashMap<String, String>();
|
|
||||||
collectionFormatMap.put("csv", ",");
|
|
||||||
collectionFormatMap.put("tsv", "\t");
|
|
||||||
collectionFormatMap.put("ssv", " ");
|
|
||||||
collectionFormatMap.put("pipes", "\\|");
|
|
||||||
collectionFormatMap.put("", ","); // no format, must default to csv
|
|
||||||
collectionFormatMap.put("unknown", ","); // all other formats, must default to csv
|
|
||||||
|
|
||||||
String name = "param-a";
|
|
||||||
|
|
||||||
List<Object> values = new ArrayList<Object>();
|
|
||||||
values.add("value-a");
|
|
||||||
values.add(123);
|
|
||||||
values.add(new Date());
|
|
||||||
|
|
||||||
// check for multi separately
|
|
||||||
List<Pair> multiPairs = ApiInvoker.parameterToPairs("multi", name, values);
|
|
||||||
assertEquals(values.size(), multiPairs.size());
|
|
||||||
|
|
||||||
// all other formats
|
|
||||||
for (String collectionFormat : collectionFormatMap.keySet()) {
|
|
||||||
List<Pair> pairs = ApiInvoker.parameterToPairs(collectionFormat, name, values);
|
|
||||||
|
|
||||||
assertEquals(1, pairs.size());
|
|
||||||
|
|
||||||
String delimiter = collectionFormatMap.get(collectionFormat);
|
|
||||||
String[] pairValueSplit = pairs.get(0).getValue().split(delimiter);
|
|
||||||
|
|
||||||
// must equal input values
|
|
||||||
assertEquals(values.size(), pairValueSplit.length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,164 +0,0 @@
|
|||||||
package io.swagger.petstore.test;
|
|
||||||
|
|
||||||
import io.swagger.client.api.*;
|
|
||||||
import io.swagger.client.model.*;
|
|
||||||
|
|
||||||
import io.swagger.client.ApiException;
|
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.junit.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
public class PetApiTest {
|
|
||||||
PetApi api = null;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setup() {
|
|
||||||
api = new PetApi();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateAndGetPet() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertNotNull(fetched);
|
|
||||||
assertEquals(pet.getId(), fetched.getId());
|
|
||||||
assertNotNull(fetched.getCategory());
|
|
||||||
assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePet() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
|
|
||||||
api.updatePet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertNotNull(fetched);
|
|
||||||
assertEquals(pet.getId(), fetched.getId());
|
|
||||||
assertNotNull(fetched.getCategory());
|
|
||||||
assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPetsByStatus() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
|
|
||||||
api.updatePet(pet);
|
|
||||||
|
|
||||||
List<Pet> pets = api.findPetsByStatus(Arrays.asList(new String[]{"available"}));
|
|
||||||
assertNotNull(pets);
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (Pet fetched : pets) {
|
|
||||||
if (fetched.getId().equals(pet.getId())) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assertTrue(found);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Ignore
|
|
||||||
/* ignoring the findPetByTags test below as it's very similar to
|
|
||||||
* testFindPetsByStatus and testFindPetsByTags sometimes got 500
|
|
||||||
* due to server issue, which makes the test unstable.
|
|
||||||
*/
|
|
||||||
public void testFindPetsByTags() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("monster");
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
|
|
||||||
List<Tag> tags = new ArrayList<Tag>();
|
|
||||||
Tag tag1 = new Tag();
|
|
||||||
tag1.setName("friendly");
|
|
||||||
tags.add(tag1);
|
|
||||||
pet.setTags(tags);
|
|
||||||
|
|
||||||
api.updatePet(pet);
|
|
||||||
|
|
||||||
List<Pet> pets = api.findPetsByTags(Arrays.asList(new String[]{"friendly"}));
|
|
||||||
assertNotNull(pets);
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (Pet fetched : pets) {
|
|
||||||
if (fetched.getId().equals(pet.getId())) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assertTrue(found);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePetWithForm() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("frank");
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertEquals("frank", fetched.getName());
|
|
||||||
|
|
||||||
api.updatePetWithForm(String.valueOf(fetched.getId()), "furt", null);
|
|
||||||
Pet updated = api.getPetById(fetched.getId());
|
|
||||||
assertEquals("furt", updated.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeletePet() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
api.deletePet(fetched.getId(), null);
|
|
||||||
|
|
||||||
try {
|
|
||||||
fetched = api.getPetById(fetched.getId());
|
|
||||||
fail("expected an error");
|
|
||||||
} catch (ApiException e) {
|
|
||||||
assertEquals(404, e.getCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUploadFile() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
File file = new File("hello.txt");
|
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
||||||
writer.write("Hello world!");
|
|
||||||
writer.close();
|
|
||||||
|
|
||||||
api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Pet createRandomPet() {
|
|
||||||
Pet pet = new Pet();
|
|
||||||
pet.setId(System.currentTimeMillis());
|
|
||||||
pet.setName("gorilla");
|
|
||||||
|
|
||||||
Category category = new Category();
|
|
||||||
category.setName("really-happy");
|
|
||||||
|
|
||||||
pet.setCategory(category);
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
List<String> photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"});
|
|
||||||
pet.setPhotoUrls(photos);
|
|
||||||
|
|
||||||
return pet;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
package io.swagger.petstore.test;
|
|
||||||
|
|
||||||
import io.swagger.client.api.*;
|
|
||||||
import io.swagger.client.model.*;
|
|
||||||
|
|
||||||
import io.swagger.client.ApiException;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.junit.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
public class StoreApiTest {
|
|
||||||
StoreApi api = null;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setup() {
|
|
||||||
api = new StoreApi();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testGetInventory() throws Exception {
|
|
||||||
Map<String, Integer> inventory = api.getInventory();
|
|
||||||
assertTrue(inventory.keySet().size() > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testPlaceOrder() throws Exception {
|
|
||||||
Order order = createOrder();
|
|
||||||
api.placeOrder(order);
|
|
||||||
|
|
||||||
Order fetched = api.getOrderById(String.valueOf(order.getId()));
|
|
||||||
assertEquals(order.getId(), fetched.getId());
|
|
||||||
assertEquals(order.getPetId(), fetched.getPetId());
|
|
||||||
assertEquals(order.getQuantity(), fetched.getQuantity());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeleteOrder() throws Exception {
|
|
||||||
Order order = createOrder();
|
|
||||||
api.placeOrder(order);
|
|
||||||
|
|
||||||
Order fetched = api.getOrderById(String.valueOf(order.getId()));
|
|
||||||
assertEquals(fetched.getId(), order.getId());
|
|
||||||
|
|
||||||
api.deleteOrder(String.valueOf(order.getId()));
|
|
||||||
|
|
||||||
try {
|
|
||||||
api.getOrderById(String.valueOf(order.getId()));
|
|
||||||
// fail("expected an error");
|
|
||||||
} catch (ApiException e) {
|
|
||||||
// ok
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order createOrder() {
|
|
||||||
Order order = new Order();
|
|
||||||
order.setId(new Long(System.currentTimeMillis()));
|
|
||||||
order.setPetId(new Long(200));
|
|
||||||
order.setQuantity(new Integer(13));
|
|
||||||
order.setShipDate(new java.util.Date());
|
|
||||||
order.setStatus(Order.StatusEnum.placed);
|
|
||||||
order.setComplete(true);
|
|
||||||
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,82 +0,0 @@
|
|||||||
package io.swagger.petstore.test;
|
|
||||||
|
|
||||||
import io.swagger.client.api.*;
|
|
||||||
import io.swagger.client.model.*;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import org.junit.*;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
public class UserApiTest {
|
|
||||||
UserApi api = null;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setup() {
|
|
||||||
api = new UserApi();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateUser() throws Exception {
|
|
||||||
User user = createUser();
|
|
||||||
|
|
||||||
api.createUser(user);
|
|
||||||
|
|
||||||
User fetched = api.getUserByName(user.getUsername());
|
|
||||||
assertEquals(user.getId(), fetched.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateUsersWithArray() throws Exception {
|
|
||||||
User user1 = createUser();
|
|
||||||
user1.setUsername("abc123");
|
|
||||||
User user2 = createUser();
|
|
||||||
user2.setUsername("123abc");
|
|
||||||
|
|
||||||
api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2}));
|
|
||||||
|
|
||||||
User fetched = api.getUserByName(user1.getUsername());
|
|
||||||
assertEquals(user1.getId(), fetched.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateUsersWithList() throws Exception {
|
|
||||||
User user1 = createUser();
|
|
||||||
user1.setUsername("abc123");
|
|
||||||
User user2 = createUser();
|
|
||||||
user2.setUsername("123abc");
|
|
||||||
|
|
||||||
api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2}));
|
|
||||||
|
|
||||||
User fetched = api.getUserByName(user1.getUsername());
|
|
||||||
assertEquals(user1.getId(), fetched.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testLoginUser() throws Exception {
|
|
||||||
User user = createUser();
|
|
||||||
api.createUser(user);
|
|
||||||
|
|
||||||
String token = api.loginUser(user.getUsername(), user.getPassword());
|
|
||||||
assertTrue(token.startsWith("logged in user session:"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void logoutUser() throws Exception {
|
|
||||||
api.logoutUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
private User createUser() {
|
|
||||||
User user = new User();
|
|
||||||
user.setId(System.currentTimeMillis());
|
|
||||||
user.setUsername("fred");
|
|
||||||
user.setFirstName("Fred");
|
|
||||||
user.setLastName("Meyer");
|
|
||||||
user.setEmail("fred@fredmeyer.com");
|
|
||||||
user.setPassword("xxXXxx");
|
|
||||||
user.setPhone("408-867-5309");
|
|
||||||
user.setUserStatus(123);
|
|
||||||
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
|
@ -189,14 +189,9 @@ public class ApiInvoker {
|
|||||||
|
|
||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
INSTANCE.authentications = new HashMap<String, Authentication>();
|
INSTANCE.authentications = new HashMap<String, Authentication>();
|
||||||
|
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||||
// TODO: comment out below as OAuth does not exist
|
// TODO: comment out below as OAuth does not exist
|
||||||
//INSTANCE.authentications.put("petstore_auth", new OAuth());
|
//INSTANCE.authentications.put("petstore_auth", new OAuth());
|
||||||
INSTANCE.authentications.put("test_api_client_id", new ApiKeyAuth("header", "x-test_api_client_id"));
|
|
||||||
INSTANCE.authentications.put("test_api_client_secret", new ApiKeyAuth("header", "x-test_api_client_secret"));
|
|
||||||
INSTANCE.authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
|
||||||
INSTANCE.authentications.put("test_http_basic", new HttpBasicAuth());
|
|
||||||
INSTANCE.authentications.put("test_api_key_query", new ApiKeyAuth("query", "test_api_key_query"));
|
|
||||||
INSTANCE.authentications.put("test_api_key_header", new ApiKeyAuth("header", "test_api_key_header"));
|
|
||||||
// Prevent the authentications from being modified.
|
// Prevent the authentications from being modified.
|
||||||
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
|
INSTANCE.authentications = Collections.unmodifiableMap(INSTANCE.authentications);
|
||||||
}
|
}
|
||||||
|
@ -35,42 +35,10 @@ public class JsonUtil {
|
|||||||
public static Type getListTypeForDeserialization(Class cls) {
|
public static Type getListTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
if ("Animal".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Animal>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Cat".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Cat>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Category>>(){}.getType();
|
return new TypeToken<List<Category>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Dog".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Dog>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("FormatTest".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<FormatTest>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<InlineResponse200>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Model200Response".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Model200Response>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<ModelReturn>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Name".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<Name>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Order>>(){}.getType();
|
return new TypeToken<List<Order>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -79,10 +47,6 @@ public class JsonUtil {
|
|||||||
return new TypeToken<List<Pet>>(){}.getType();
|
return new TypeToken<List<Pet>>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<List<SpecialModelName>>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<List<Tag>>(){}.getType();
|
return new TypeToken<List<Tag>>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -97,42 +61,10 @@ public class JsonUtil {
|
|||||||
public static Type getTypeForDeserialization(Class cls) {
|
public static Type getTypeForDeserialization(Class cls) {
|
||||||
String className = cls.getSimpleName();
|
String className = cls.getSimpleName();
|
||||||
|
|
||||||
if ("Animal".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Animal>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Cat".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Cat>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Category".equalsIgnoreCase(className)) {
|
if ("Category".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Category>(){}.getType();
|
return new TypeToken<Category>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("Dog".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Dog>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("FormatTest".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<FormatTest>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("InlineResponse200".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<InlineResponse200>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Model200Response".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Model200Response>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("ModelReturn".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<ModelReturn>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Name".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<Name>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Order".equalsIgnoreCase(className)) {
|
if ("Order".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Order>(){}.getType();
|
return new TypeToken<Order>(){}.getType();
|
||||||
}
|
}
|
||||||
@ -141,10 +73,6 @@ public class JsonUtil {
|
|||||||
return new TypeToken<Pet>(){}.getType();
|
return new TypeToken<Pet>(){}.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("SpecialModelName".equalsIgnoreCase(className)) {
|
|
||||||
return new TypeToken<SpecialModelName>(){}.getType();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("Tag".equalsIgnoreCase(className)) {
|
if ("Tag".equalsIgnoreCase(className)) {
|
||||||
return new TypeToken<Tag>(){}.getType();
|
return new TypeToken<Tag>(){}.getType();
|
||||||
}
|
}
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
package io.swagger.client;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import io.swagger.client.model.*;
|
|
||||||
|
|
||||||
public class Responses {
|
|
||||||
|
|
||||||
|
|
||||||
public static interface UserResponse {
|
|
||||||
public void onResponse(User user);
|
|
||||||
}
|
|
||||||
public static interface UserListResponse {
|
|
||||||
public void onResponse(List<User> userList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static interface CategoryResponse {
|
|
||||||
public void onResponse(Category category);
|
|
||||||
}
|
|
||||||
public static interface CategoryListResponse {
|
|
||||||
public void onResponse(List<Category> categoryList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static interface PetResponse {
|
|
||||||
public void onResponse(Pet pet);
|
|
||||||
}
|
|
||||||
public static interface PetListResponse {
|
|
||||||
public void onResponse(List<Pet> petList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static interface TagResponse {
|
|
||||||
public void onResponse(Tag tag);
|
|
||||||
}
|
|
||||||
public static interface TagListResponse {
|
|
||||||
public void onResponse(List<Tag> tagList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static interface OrderResponse {
|
|
||||||
public void onResponse(Order order);
|
|
||||||
}
|
|
||||||
public static interface OrderListResponse {
|
|
||||||
public void onResponse(List<Order> orderList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static interface StringResponse {
|
|
||||||
public void onResponse(String response);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface StringListResponse {
|
|
||||||
public void onResponse(List<String> stringList);
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,7 +12,6 @@ import com.android.volley.Response;
|
|||||||
import com.android.volley.VolleyError;
|
import com.android.volley.VolleyError;
|
||||||
|
|
||||||
import io.swagger.client.model.Pet;
|
import io.swagger.client.model.Pet;
|
||||||
import io.swagger.client.model.InlineResponse200;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
@ -131,127 +130,6 @@ public class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
"application/json","application/xml"
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String localVarResponse) {
|
|
||||||
responseListener.onResponse(localVarResponse);
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
errorListener.onErrorResponse(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
*
|
|
||||||
* @param body Pet object in the form of byte array
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public void addPetUsingByteArray (byte[] body) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
|
||||||
Object postBody = body;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
"application/json","application/xml"
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return ;
|
|
||||||
} else {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
if(ex.getCause() instanceof VolleyError) {
|
|
||||||
VolleyError volleyError = (VolleyError)ex.getCause();
|
|
||||||
if (volleyError.networkResponse != null) {
|
|
||||||
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw ex;
|
|
||||||
} catch (TimeoutException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
*
|
|
||||||
* @param body Pet object in the form of byte array
|
|
||||||
*/
|
|
||||||
public void addPetUsingByteArray (byte[] body, final Response.Listener<String> responseListener, final Response.ErrorListener errorListener) {
|
|
||||||
Object postBody = body;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet?testing_byte_array=true".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
String[] contentTypes = {
|
||||||
"application/json","application/xml"
|
"application/json","application/xml"
|
||||||
};
|
};
|
||||||
@ -425,8 +303,8 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma seperated strings
|
||||||
* @param status Status values that need to be considered for query
|
* @param status Status values that need to be considered for filter
|
||||||
* @return List<Pet>
|
* @return List<Pet>
|
||||||
*/
|
*/
|
||||||
public List<Pet> findPetsByStatus (List<String> status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
public List<Pet> findPetsByStatus (List<String> status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
||||||
@ -490,8 +368,8 @@ public class PetApi {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds Pets by status
|
* Finds Pets by status
|
||||||
* Multiple status values can be provided with comma separated strings
|
* Multiple status values can be provided with comma seperated strings
|
||||||
* @param status Status values that need to be considered for query
|
* @param status Status values that need to be considered for filter
|
||||||
*/
|
*/
|
||||||
public void findPetsByStatus (List<String> status, final Response.Listener<List<Pet>> responseListener, final Response.ErrorListener errorListener) {
|
public void findPetsByStatus (List<String> status, final Response.Listener<List<Pet>> responseListener, final Response.ErrorListener errorListener) {
|
||||||
Object postBody = null;
|
Object postBody = null;
|
||||||
@ -721,7 +599,7 @@ public class PetApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] authNames = new String[] { "api_key", "petstore_auth" };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
@ -791,7 +669,7 @@ public class PetApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
String[] authNames = new String[] { "api_key", "petstore_auth" };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
@ -815,280 +693,6 @@ public class PetApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
* @return InlineResponse200
|
|
||||||
*/
|
|
||||||
public InlineResponse200 getPetByIdInObject (Long petId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetByIdInObject",
|
|
||||||
new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
if(ex.getCause() instanceof VolleyError) {
|
|
||||||
VolleyError volleyError = (VolleyError)ex.getCause();
|
|
||||||
if (volleyError.networkResponse != null) {
|
|
||||||
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw ex;
|
|
||||||
} catch (TimeoutException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
*/
|
|
||||||
public void getPetByIdInObject (Long petId, final Response.Listener<InlineResponse200> responseListener, final Response.ErrorListener errorListener) {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling getPetByIdInObject",
|
|
||||||
new ApiException(400, "Missing the required parameter 'petId' when calling getPetByIdInObject"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet/{petId}?response=inline_arbitrary_object".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String localVarResponse) {
|
|
||||||
try {
|
|
||||||
responseListener.onResponse((InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class));
|
|
||||||
} catch (ApiException exception) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(exception));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
errorListener.onErrorResponse(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
* @return byte[]
|
|
||||||
*/
|
|
||||||
public byte[] petPetIdtestingByteArraytrueGet (Long petId) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet",
|
|
||||||
new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].class);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
if(ex.getCause() instanceof VolleyError) {
|
|
||||||
VolleyError volleyError = (VolleyError)ex.getCause();
|
|
||||||
if (volleyError.networkResponse != null) {
|
|
||||||
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw ex;
|
|
||||||
} catch (TimeoutException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* @param petId ID of pet that needs to be fetched
|
|
||||||
*/
|
|
||||||
public void petPetIdtestingByteArraytrueGet (Long petId, final Response.Listener<byte[]> responseListener, final Response.ErrorListener errorListener) {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// verify the required parameter 'petId' is set
|
|
||||||
if (petId == null) {
|
|
||||||
VolleyError error = new VolleyError("Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet",
|
|
||||||
new ApiException(400, "Missing the required parameter 'petId' when calling petPetIdtestingByteArraytrueGet"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/pet/{petId}?testing_byte_array=true".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString()));
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "petstore_auth", "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String localVarResponse) {
|
|
||||||
try {
|
|
||||||
responseListener.onResponse((byte[]) ApiInvoker.deserialize(localVarResponse, "", byte[].class));
|
|
||||||
} catch (ApiException exception) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(exception));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
errorListener.onErrorResponse(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Update an existing pet
|
* Update an existing pet
|
||||||
*
|
*
|
||||||
* @param body Pet object that needs to be added to the store
|
* @param body Pet object that needs to be added to the store
|
||||||
|
@ -11,8 +11,8 @@ import java.util.*;
|
|||||||
import com.android.volley.Response;
|
import com.android.volley.Response;
|
||||||
import com.android.volley.VolleyError;
|
import com.android.volley.VolleyError;
|
||||||
|
|
||||||
import io.swagger.client.model.Order;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import io.swagger.client.model.Order;
|
||||||
|
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
@ -178,133 +178,6 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Finds orders by status
|
|
||||||
* A single status value can be provided as a string
|
|
||||||
* @param status Status value that needs to be considered for query
|
|
||||||
* @return List<Order>
|
|
||||||
*/
|
|
||||||
public List<Order> findOrdersByStatus (String status) throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
if(ex.getCause() instanceof VolleyError) {
|
|
||||||
VolleyError volleyError = (VolleyError)ex.getCause();
|
|
||||||
if (volleyError.networkResponse != null) {
|
|
||||||
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw ex;
|
|
||||||
} catch (TimeoutException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finds orders by status
|
|
||||||
* A single status value can be provided as a string
|
|
||||||
* @param status Status value that needs to be considered for query
|
|
||||||
*/
|
|
||||||
public void findOrdersByStatus (String status, final Response.Listener<List<Order>> responseListener, final Response.ErrorListener errorListener) {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/store/findByStatus".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
queryParams.addAll(ApiInvoker.parameterToPairs("", "status", status));
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String localVarResponse) {
|
|
||||||
try {
|
|
||||||
responseListener.onResponse((List<Order>) ApiInvoker.deserialize(localVarResponse, "array", Order.class));
|
|
||||||
} catch (ApiException exception) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(exception));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
errorListener.onErrorResponse(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns pet inventories by status
|
* Returns pet inventories by status
|
||||||
* Returns a map of status codes to quantities
|
* Returns a map of status codes to quantities
|
||||||
* @return Map<String, Integer>
|
* @return Map<String, Integer>
|
||||||
@ -429,130 +302,6 @@ public class StoreApi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
|
||||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
|
||||||
* @return Object
|
|
||||||
*/
|
|
||||||
public Object getInventoryInObject () throws TimeoutException, ExecutionException, InterruptedException, ApiException {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
|
||||||
if(localVarResponse != null){
|
|
||||||
return (Object) ApiInvoker.deserialize(localVarResponse, "", Object.class);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
if(ex.getCause() instanceof VolleyError) {
|
|
||||||
VolleyError volleyError = (VolleyError)ex.getCause();
|
|
||||||
if (volleyError.networkResponse != null) {
|
|
||||||
throw new ApiException(volleyError.networkResponse.statusCode, volleyError.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw ex;
|
|
||||||
} catch (TimeoutException ex) {
|
|
||||||
throw ex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fake endpoint to test arbitrary object return by 'Get inventory'
|
|
||||||
* Returns an arbitrary object which is actually a map of status codes to quantities
|
|
||||||
|
|
||||||
*/
|
|
||||||
public void getInventoryInObject (final Response.Listener<Object> responseListener, final Response.ErrorListener errorListener) {
|
|
||||||
Object postBody = null;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create path and map variables
|
|
||||||
String path = "/store/inventory?response=arbitrary_object".replaceAll("\\{format\\}","json");
|
|
||||||
|
|
||||||
// query params
|
|
||||||
List<Pair> queryParams = new ArrayList<Pair>();
|
|
||||||
// header params
|
|
||||||
Map<String, String> headerParams = new HashMap<String, String>();
|
|
||||||
// form params
|
|
||||||
Map<String, String> formParams = new HashMap<String, String>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String[] contentTypes = {
|
|
||||||
|
|
||||||
};
|
|
||||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
|
||||||
|
|
||||||
if (contentType.startsWith("multipart/form-data")) {
|
|
||||||
// file uploading
|
|
||||||
MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();
|
|
||||||
|
|
||||||
|
|
||||||
HttpEntity httpEntity = localVarBuilder.build();
|
|
||||||
postBody = httpEntity;
|
|
||||||
} else {
|
|
||||||
// normal form params
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] authNames = new String[] { "api_key" };
|
|
||||||
|
|
||||||
try {
|
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
|
||||||
new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String localVarResponse) {
|
|
||||||
try {
|
|
||||||
responseListener.onResponse((Object) ApiInvoker.deserialize(localVarResponse, "", Object.class));
|
|
||||||
} catch (ApiException exception) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(exception));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
errorListener.onErrorResponse(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (ApiException ex) {
|
|
||||||
errorListener.onErrorResponse(new VolleyError(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Find purchase order by ID
|
* Find purchase order by ID
|
||||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
* @param orderId ID of pet that needs to be fetched
|
* @param orderId ID of pet that needs to be fetched
|
||||||
@ -596,7 +345,7 @@ public class StoreApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
@ -666,7 +415,7 @@ public class StoreApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_key_query", "test_api_key_header" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
@ -727,7 +476,7 @@ public class StoreApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
@ -791,7 +540,7 @@ public class StoreApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_api_client_id", "test_api_client_secret" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
|
@ -451,7 +451,7 @@ public class UserApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_http_basic" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
String localVarResponse = apiInvoker.invokeAPI (basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames);
|
||||||
@ -521,7 +521,7 @@ public class UserApi {
|
|||||||
// normal form params
|
// normal form params
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] authNames = new String[] { "test_http_basic" };
|
String[] authNames = new String[] { };
|
||||||
|
|
||||||
try {
|
try {
|
||||||
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
apiInvoker.invokeAPI(basePath, path, "DELETE", queryParams, postBody, headerParams, formParams, contentType, authNames,
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Animal {\n");
|
|
||||||
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Animal;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Cat extends Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
@SerializedName("declawed")
|
|
||||||
private Boolean declawed = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Boolean getDeclawed() {
|
|
||||||
return declawed;
|
|
||||||
}
|
|
||||||
public void setDeclawed(Boolean declawed) {
|
|
||||||
this.declawed = declawed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Cat {\n");
|
|
||||||
sb.append(" " + super.toString()).append("\n");
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append(" declawed: ").append(declawed).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -34,6 +34,27 @@ public class Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Category category = (Category) o;
|
||||||
|
return (id == null ? category.id == null : id.equals(category.id)) &&
|
||||||
|
(name == null ? category.name == null : name.equals(category.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Animal;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class Dog extends Animal {
|
|
||||||
|
|
||||||
@SerializedName("className")
|
|
||||||
private String className = null;
|
|
||||||
@SerializedName("breed")
|
|
||||||
private String breed = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getBreed() {
|
|
||||||
return breed;
|
|
||||||
}
|
|
||||||
public void setBreed(String breed) {
|
|
||||||
this.breed = breed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Dog {\n");
|
|
||||||
sb.append(" " + super.toString()).append("\n");
|
|
||||||
sb.append(" className: ").append(className).append("\n");
|
|
||||||
sb.append(" breed: ").append(breed).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,179 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class FormatTest {
|
|
||||||
|
|
||||||
@SerializedName("integer")
|
|
||||||
private Integer integer = null;
|
|
||||||
@SerializedName("int32")
|
|
||||||
private Integer int32 = null;
|
|
||||||
@SerializedName("int64")
|
|
||||||
private Long int64 = null;
|
|
||||||
@SerializedName("number")
|
|
||||||
private BigDecimal number = null;
|
|
||||||
@SerializedName("float")
|
|
||||||
private Float _float = null;
|
|
||||||
@SerializedName("double")
|
|
||||||
private Double _double = null;
|
|
||||||
@SerializedName("string")
|
|
||||||
private String string = null;
|
|
||||||
@SerializedName("byte")
|
|
||||||
private byte[] _byte = null;
|
|
||||||
@SerializedName("binary")
|
|
||||||
private byte[] binary = null;
|
|
||||||
@SerializedName("date")
|
|
||||||
private Date date = null;
|
|
||||||
@SerializedName("dateTime")
|
|
||||||
private Date dateTime = null;
|
|
||||||
@SerializedName("password")
|
|
||||||
private String password = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getInteger() {
|
|
||||||
return integer;
|
|
||||||
}
|
|
||||||
public void setInteger(Integer integer) {
|
|
||||||
this.integer = integer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getInt32() {
|
|
||||||
return int32;
|
|
||||||
}
|
|
||||||
public void setInt32(Integer int32) {
|
|
||||||
this.int32 = int32;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Long getInt64() {
|
|
||||||
return int64;
|
|
||||||
}
|
|
||||||
public void setInt64(Long int64) {
|
|
||||||
this.int64 = int64;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public BigDecimal getNumber() {
|
|
||||||
return number;
|
|
||||||
}
|
|
||||||
public void setNumber(BigDecimal number) {
|
|
||||||
this.number = number;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Float getFloat() {
|
|
||||||
return _float;
|
|
||||||
}
|
|
||||||
public void setFloat(Float _float) {
|
|
||||||
this._float = _float;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Double getDouble() {
|
|
||||||
return _double;
|
|
||||||
}
|
|
||||||
public void setDouble(Double _double) {
|
|
||||||
this._double = _double;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getString() {
|
|
||||||
return string;
|
|
||||||
}
|
|
||||||
public void setString(String string) {
|
|
||||||
this.string = string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public byte[] getByte() {
|
|
||||||
return _byte;
|
|
||||||
}
|
|
||||||
public void setByte(byte[] _byte) {
|
|
||||||
this._byte = _byte;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public byte[] getBinary() {
|
|
||||||
return binary;
|
|
||||||
}
|
|
||||||
public void setBinary(byte[] binary) {
|
|
||||||
this.binary = binary;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Date getDate() {
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
public void setDate(Date date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Date getDateTime() {
|
|
||||||
return dateTime;
|
|
||||||
}
|
|
||||||
public void setDateTime(Date dateTime) {
|
|
||||||
this.dateTime = dateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
public void setPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class FormatTest {\n");
|
|
||||||
|
|
||||||
sb.append(" integer: ").append(integer).append("\n");
|
|
||||||
sb.append(" int32: ").append(int32).append("\n");
|
|
||||||
sb.append(" int64: ").append(int64).append("\n");
|
|
||||||
sb.append(" number: ").append(number).append("\n");
|
|
||||||
sb.append(" _float: ").append(_float).append("\n");
|
|
||||||
sb.append(" _double: ").append(_double).append("\n");
|
|
||||||
sb.append(" string: ").append(string).append("\n");
|
|
||||||
sb.append(" _byte: ").append(_byte).append("\n");
|
|
||||||
sb.append(" binary: ").append(binary).append("\n");
|
|
||||||
sb.append(" date: ").append(date).append("\n");
|
|
||||||
sb.append(" dateTime: ").append(dateTime).append("\n");
|
|
||||||
sb.append(" password: ").append(password).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,105 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
import io.swagger.client.model.Tag;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class InlineResponse200 {
|
|
||||||
|
|
||||||
@SerializedName("photoUrls")
|
|
||||||
private List<String> photoUrls = null;
|
|
||||||
@SerializedName("name")
|
|
||||||
private String name = null;
|
|
||||||
@SerializedName("id")
|
|
||||||
private Long id = null;
|
|
||||||
@SerializedName("category")
|
|
||||||
private Object category = null;
|
|
||||||
@SerializedName("tags")
|
|
||||||
private List<Tag> tags = null;
|
|
||||||
public enum StatusEnum {
|
|
||||||
available, pending, sold,
|
|
||||||
};
|
|
||||||
@SerializedName("status")
|
|
||||||
private StatusEnum status = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public List<String> getPhotoUrls() {
|
|
||||||
return photoUrls;
|
|
||||||
}
|
|
||||||
public void setPhotoUrls(List<String> photoUrls) {
|
|
||||||
this.photoUrls = photoUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Object getCategory() {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
public void setCategory(Object category) {
|
|
||||||
this.category = category;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public List<Tag> getTags() {
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
public void setTags(List<Tag> tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pet status in the store
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
|
||||||
public StatusEnum getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
public void setStatus(StatusEnum status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class InlineResponse200 {\n");
|
|
||||||
|
|
||||||
sb.append(" photoUrls: ").append(photoUrls).append("\n");
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append(" id: ").append(id).append("\n");
|
|
||||||
sb.append(" category: ").append(category).append("\n");
|
|
||||||
sb.append(" tags: ").append(tags).append("\n");
|
|
||||||
sb.append(" status: ").append(status).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing model name starting with number
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing model name starting with number")
|
|
||||||
public class Model200Response {
|
|
||||||
|
|
||||||
@SerializedName("name")
|
|
||||||
private Integer name = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(Integer name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Model200Response {\n");
|
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing reserved words
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing reserved words")
|
|
||||||
public class ModelReturn {
|
|
||||||
|
|
||||||
@SerializedName("return")
|
|
||||||
private Integer _return = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getReturn() {
|
|
||||||
return _return;
|
|
||||||
}
|
|
||||||
public void setReturn(Integer _return) {
|
|
||||||
this._return = _return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class ModelReturn {\n");
|
|
||||||
|
|
||||||
sb.append(" _return: ").append(_return).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Model for testing model name same as property name
|
|
||||||
**/
|
|
||||||
@ApiModel(description = "Model for testing model name same as property name")
|
|
||||||
public class Name {
|
|
||||||
|
|
||||||
@SerializedName("name")
|
|
||||||
private Integer name = null;
|
|
||||||
@SerializedName("snake_case")
|
|
||||||
private Integer snakeCase = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
public Integer getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(Integer name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Integer getSnakeCase() {
|
|
||||||
return snakeCase;
|
|
||||||
}
|
|
||||||
public void setSnakeCase(Integer snakeCase) {
|
|
||||||
this.snakeCase = snakeCase;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Name {\n");
|
|
||||||
|
|
||||||
sb.append(" name: ").append(name).append("\n");
|
|
||||||
sb.append(" snakeCase: ").append(snakeCase).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -87,6 +87,35 @@ public class Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Order order = (Order) o;
|
||||||
|
return (id == null ? order.id == null : id.equals(order.id)) &&
|
||||||
|
(petId == null ? order.petId == null : petId.equals(order.petId)) &&
|
||||||
|
(quantity == null ? order.quantity == null : quantity.equals(order.quantity)) &&
|
||||||
|
(shipDate == null ? order.shipDate == null : shipDate.equals(order.shipDate)) &&
|
||||||
|
(status == null ? order.status == null : status.equals(order.status)) &&
|
||||||
|
(complete == null ? order.complete == null : complete.equals(order.complete));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (petId == null ? 0: petId.hashCode());
|
||||||
|
result = 31 * result + (quantity == null ? 0: quantity.hashCode());
|
||||||
|
result = 31 * result + (shipDate == null ? 0: shipDate.hashCode());
|
||||||
|
result = 31 * result + (status == null ? 0: status.hashCode());
|
||||||
|
result = 31 * result + (complete == null ? 0: complete.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -89,6 +89,35 @@ public class Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Pet pet = (Pet) o;
|
||||||
|
return (id == null ? pet.id == null : id.equals(pet.id)) &&
|
||||||
|
(category == null ? pet.category == null : category.equals(pet.category)) &&
|
||||||
|
(name == null ? pet.name == null : name.equals(pet.name)) &&
|
||||||
|
(photoUrls == null ? pet.photoUrls == null : photoUrls.equals(pet.photoUrls)) &&
|
||||||
|
(tags == null ? pet.tags == null : tags.equals(pet.tags)) &&
|
||||||
|
(status == null ? pet.status == null : status.equals(pet.status));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (category == null ? 0: category.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
result = 31 * result + (photoUrls == null ? 0: photoUrls.hashCode());
|
||||||
|
result = 31 * result + (tags == null ? 0: tags.hashCode());
|
||||||
|
result = 31 * result + (status == null ? 0: status.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package io.swagger.client.model;
|
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
|
|
||||||
@ApiModel(description = "")
|
|
||||||
public class SpecialModelName {
|
|
||||||
|
|
||||||
@SerializedName("$special[property.name]")
|
|
||||||
private Long specialPropertyName = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
public Long getSpecialPropertyName() {
|
|
||||||
return specialPropertyName;
|
|
||||||
}
|
|
||||||
public void setSpecialPropertyName(Long specialPropertyName) {
|
|
||||||
this.specialPropertyName = specialPropertyName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class SpecialModelName {\n");
|
|
||||||
|
|
||||||
sb.append(" specialPropertyName: ").append(specialPropertyName).append("\n");
|
|
||||||
sb.append("}\n");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@ -34,6 +34,27 @@ public class Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Tag tag = (Tag) o;
|
||||||
|
return (id == null ? tag.id == null : id.equals(tag.id)) &&
|
||||||
|
(name == null ? tag.name == null : name.equals(tag.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (name == null ? 0: name.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -107,6 +107,39 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
User user = (User) o;
|
||||||
|
return (id == null ? user.id == null : id.equals(user.id)) &&
|
||||||
|
(username == null ? user.username == null : username.equals(user.username)) &&
|
||||||
|
(firstName == null ? user.firstName == null : firstName.equals(user.firstName)) &&
|
||||||
|
(lastName == null ? user.lastName == null : lastName.equals(user.lastName)) &&
|
||||||
|
(email == null ? user.email == null : email.equals(user.email)) &&
|
||||||
|
(password == null ? user.password == null : password.equals(user.password)) &&
|
||||||
|
(phone == null ? user.phone == null : phone.equals(user.phone)) &&
|
||||||
|
(userStatus == null ? user.userStatus == null : userStatus.equals(user.userStatus));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = 17;
|
||||||
|
result = 31 * result + (id == null ? 0: id.hashCode());
|
||||||
|
result = 31 * result + (username == null ? 0: username.hashCode());
|
||||||
|
result = 31 * result + (firstName == null ? 0: firstName.hashCode());
|
||||||
|
result = 31 * result + (lastName == null ? 0: lastName.hashCode());
|
||||||
|
result = 31 * result + (email == null ? 0: email.hashCode());
|
||||||
|
result = 31 * result + (password == null ? 0: password.hashCode());
|
||||||
|
result = 31 * result + (phone == null ? 0: phone.hashCode());
|
||||||
|
result = 31 * result + (userStatus == null ? 0: userStatus.hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -1,394 +0,0 @@
|
|||||||
package es.shyri.swagger.android.volley.petstore.full;
|
|
||||||
|
|
||||||
import com.android.volley.ExecutorDelivery;
|
|
||||||
import com.android.volley.Network;
|
|
||||||
import com.android.volley.Response;
|
|
||||||
import com.android.volley.VolleyError;
|
|
||||||
import com.android.volley.toolbox.BasicNetwork;
|
|
||||||
import com.android.volley.toolbox.HttpStack;
|
|
||||||
import com.android.volley.toolbox.HurlStack;
|
|
||||||
import com.android.volley.toolbox.NoCache;
|
|
||||||
|
|
||||||
import net.jodah.concurrentunit.Waiter;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.robolectric.RobolectricTestRunner;
|
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
|
|
||||||
import io.swagger.client.ApiException;
|
|
||||||
import io.swagger.client.ApiInvoker;
|
|
||||||
import io.swagger.client.api.PetApi;
|
|
||||||
import io.swagger.client.model.Category;
|
|
||||||
import io.swagger.client.model.Pet;
|
|
||||||
|
|
||||||
import static com.ibm.icu.impl.Assert.fail;
|
|
||||||
import static junit.framework.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
|
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner.class)
|
|
||||||
public class PetApiTest {
|
|
||||||
PetApi api = null;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setup() {
|
|
||||||
HttpStack stack = new HurlStack();
|
|
||||||
Network network = new BasicNetwork(stack);
|
|
||||||
ApiInvoker.initializeInstance(new NoCache(), network, 4, new ExecutorDelivery(Executors.newSingleThreadExecutor()), 30);
|
|
||||||
api = new PetApi();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateAndGetPet() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
final Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.getPetById(pet.getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet response) {
|
|
||||||
Pet fetched = response;
|
|
||||||
waiter.assertNotNull(fetched);
|
|
||||||
waiter.assertEquals(pet.getId(), fetched.getId());
|
|
||||||
waiter.assertNotNull(fetched.getCategory());
|
|
||||||
waiter.assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePet() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
|
|
||||||
final Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
|
|
||||||
api.updatePet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.getPetById(pet.getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet fetched) {
|
|
||||||
waiter.assertNotNull(fetched);
|
|
||||||
waiter.assertEquals(pet.getId(), fetched.getId());
|
|
||||||
waiter.assertNotNull(fetched.getCategory());
|
|
||||||
waiter.assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPetsByStatus() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
final Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
|
|
||||||
api.updatePet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.findPetsByStatus(Arrays.asList(new String[]{"available"}), new Response.Listener<List<Pet>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(List<Pet> pets) {
|
|
||||||
waiter.assertNotNull(pets);
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (Pet fetched : pets) {
|
|
||||||
if (fetched.getId().equals(pet.getId())) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
waiter.assertTrue(found);
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePetWithForm() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
final Pet pet = createRandomPet();
|
|
||||||
pet.setName("frank");
|
|
||||||
|
|
||||||
api.addPet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
final Pet[] fetched = new Pet[1];
|
|
||||||
|
|
||||||
api.getPetById(pet.getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet petResponse) {
|
|
||||||
fetched[0] = petResponse;
|
|
||||||
waiter.assertEquals("frank", fetched[0].getName());
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.updatePetWithForm(String.valueOf(fetched[0].getId()), "furt", null, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.getPetById(fetched[0].getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet updated) {
|
|
||||||
waiter.assertEquals("furt", updated.getName());
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeletePet() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
final Pet[] fetched = new Pet[1];
|
|
||||||
|
|
||||||
api.getPetById(pet.getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet response) {
|
|
||||||
fetched[0] = response;
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
api.deletePet(fetched[0].getId(), "special-key", new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
|
|
||||||
api.getPetById(fetched[0].getId(), new Response.Listener<Pet>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Pet response) {
|
|
||||||
waiter.fail("expected an error");
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
waiter.assertEquals(404, error.networkResponse.statusCode);
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
waiter.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUploadFile() throws Exception {
|
|
||||||
final Waiter waiter = new Waiter();
|
|
||||||
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet, new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
|
|
||||||
File file = new File("hello.txt");
|
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
||||||
writer.write("Hello world!");
|
|
||||||
writer.close();
|
|
||||||
|
|
||||||
api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath()), new Response.Listener<String>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(String response) {
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
}, createErrorListener(waiter));
|
|
||||||
|
|
||||||
waiter.await();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testCreateAndGetPetSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertNotNull(fetched);
|
|
||||||
assertEquals(pet.getId(), fetched.getId());
|
|
||||||
assertNotNull(fetched.getCategory());
|
|
||||||
assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePetSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
|
|
||||||
api.updatePet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertNotNull(fetched);
|
|
||||||
assertEquals(pet.getId(), fetched.getId());
|
|
||||||
assertNotNull(fetched.getCategory());
|
|
||||||
assertEquals(fetched.getCategory().getName(), pet.getCategory().getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFindPetsByStatusSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("programmer");
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
|
|
||||||
api.updatePet(pet);
|
|
||||||
|
|
||||||
List<Pet> pets = api.findPetsByStatus(Arrays.asList(new String[]{"available"}));
|
|
||||||
assertNotNull(pets);
|
|
||||||
|
|
||||||
boolean found = false;
|
|
||||||
for (Pet fetched : pets) {
|
|
||||||
if (fetched.getId().equals(pet.getId())) {
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assertTrue(found);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUpdatePetWithFormSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
pet.setName("frank");
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
assertEquals("frank", fetched.getName());
|
|
||||||
|
|
||||||
api.updatePetWithForm(String.valueOf(fetched.getId()), "furt", null);
|
|
||||||
Pet updated = api.getPetById(fetched.getId());
|
|
||||||
assertEquals("furt", updated.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testDeletePetSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
Pet fetched = api.getPetById(pet.getId());
|
|
||||||
api.deletePet(fetched.getId(), null);
|
|
||||||
|
|
||||||
try {
|
|
||||||
fetched = api.getPetById(fetched.getId());
|
|
||||||
fail("expected an error");
|
|
||||||
} catch (ApiException e) {
|
|
||||||
assertEquals(404, e.getCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testUploadFileSync() throws Exception {
|
|
||||||
Pet pet = createRandomPet();
|
|
||||||
api.addPet(pet);
|
|
||||||
|
|
||||||
File file = new File("hello.txt");
|
|
||||||
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
|
|
||||||
writer.write("Hello world!");
|
|
||||||
writer.close();
|
|
||||||
|
|
||||||
api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Pet createRandomPet() {
|
|
||||||
Pet pet = new Pet();
|
|
||||||
pet.setId(System.currentTimeMillis());
|
|
||||||
pet.setName("gorilla");
|
|
||||||
|
|
||||||
Category category = new Category();
|
|
||||||
category.setName("really-happy");
|
|
||||||
|
|
||||||
pet.setCategory(category);
|
|
||||||
pet.setStatus(Pet.StatusEnum.available);
|
|
||||||
List<String> photos = Arrays.asList(new String[]{"http://foo.bar.com/1", "http://foo.bar.com/2"});
|
|
||||||
pet.setPhotoUrls(photos);
|
|
||||||
|
|
||||||
return pet;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Response.ErrorListener createErrorListener(final Waiter waiter) {
|
|
||||||
return new Response.ErrorListener() {
|
|
||||||
@Override
|
|
||||||
public void onErrorResponse(VolleyError error) {
|
|
||||||
error.printStackTrace();
|
|
||||||
waiter.fail(error.getMessage());
|
|
||||||
waiter.resume();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user