mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
add new files for retrofit2rx
This commit is contained in:
parent
fc982d1205
commit
8f2573f8a7
@ -1,6 +1,6 @@
|
||||
package io.swagger.client;
|
||||
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-27T10:03:29.641+02:00")
|
||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-04-28T23:45:14.234+08:00")
|
||||
public class StringUtil {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
|
@ -9,6 +9,7 @@ import retrofit2.http.*;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -37,7 +38,7 @@ public interface FakeApi {
|
||||
@FormUrlEncoded
|
||||
@POST("fake")
|
||||
Observable<Void> testEndpointParameters(
|
||||
@Field("number") String number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password
|
||||
@Field("number") BigDecimal number, @Field("double") Double _double, @Field("string") String string, @Field("byte") byte[] _byte, @Field("integer") Integer integer, @Field("int32") Integer int32, @Field("int64") Long int64, @Field("float") Float _float, @Field("binary") byte[] binary, @Field("date") Date date, @Field("dateTime") Date dateTime, @Field("password") String password
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ import retrofit2.http.*;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import io.swagger.client.model.ModelApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.ModelApiResponse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -0,0 +1,50 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class EnumClass {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumClass enumClass = (EnumClass) o;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumClass {\n");
|
||||
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class EnumTest {
|
||||
|
||||
|
||||
/**
|
||||
* Gets or Sets enumString
|
||||
*/
|
||||
public enum EnumStringEnum {
|
||||
@SerializedName("UPPER")
|
||||
UPPER("UPPER"),
|
||||
|
||||
@SerializedName("lower")
|
||||
LOWER("lower");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("enum_string")
|
||||
private EnumStringEnum enumString = null;
|
||||
|
||||
|
||||
/**
|
||||
* Gets or Sets enumInteger
|
||||
*/
|
||||
public enum EnumIntegerEnum {
|
||||
@SerializedName("1")
|
||||
NUMBER_1(1),
|
||||
|
||||
@SerializedName("-1")
|
||||
NUMBER_MINUS_1(-1);
|
||||
|
||||
private Integer value;
|
||||
|
||||
EnumIntegerEnum(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("enum_integer")
|
||||
private EnumIntegerEnum enumInteger = null;
|
||||
|
||||
|
||||
/**
|
||||
* Gets or Sets enumNumber
|
||||
*/
|
||||
public enum EnumNumberEnum {
|
||||
@SerializedName("1.1")
|
||||
NUMBER_1_DOT_1(1.1),
|
||||
|
||||
@SerializedName("-1.2")
|
||||
NUMBER_MINUS_1_DOT_2(-1.2);
|
||||
|
||||
private Double value;
|
||||
|
||||
EnumNumberEnum(Double value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("enum_number")
|
||||
private EnumNumberEnum enumNumber = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
public void setEnumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
public void setEnumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
public void setEnumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumTest enumTest = (EnumTest) o;
|
||||
return Objects.equals(enumString, enumTest.enumString) &&
|
||||
Objects.equals(enumInteger, enumTest.enumInteger) &&
|
||||
Objects.equals(enumNumber, enumTest.enumNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enumString, enumInteger, enumNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumTest {\n");
|
||||
|
||||
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
|
||||
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
|
||||
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@ -47,6 +48,9 @@ public class FormatTest {
|
||||
@SerializedName("dateTime")
|
||||
private Date dateTime = null;
|
||||
|
||||
@SerializedName("uuid")
|
||||
private UUID uuid = null;
|
||||
|
||||
@SerializedName("password")
|
||||
private String password = null;
|
||||
|
||||
@ -170,6 +174,16 @@ public class FormatTest {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@ -201,12 +215,13 @@ public class FormatTest {
|
||||
Objects.equals(binary, formatTest.binary) &&
|
||||
Objects.equals(date, formatTest.date) &&
|
||||
Objects.equals(dateTime, formatTest.dateTime) &&
|
||||
Objects.equals(uuid, formatTest.uuid) &&
|
||||
Objects.equals(password, formatTest.password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, password);
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -225,6 +240,7 @@ public class FormatTest {
|
||||
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
@ -26,28 +26,31 @@ public class Order {
|
||||
private Date shipDate = null;
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("placed")
|
||||
PLACED("placed"),
|
||||
/**
|
||||
* Order Status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
@SerializedName("placed")
|
||||
PLACED("placed"),
|
||||
|
||||
@SerializedName("approved")
|
||||
APPROVED("approved"),
|
||||
@SerializedName("approved")
|
||||
APPROVED("approved"),
|
||||
|
||||
@SerializedName("delivered")
|
||||
DELIVERED("delivered");
|
||||
@SerializedName("delivered")
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
|
@ -32,28 +32,31 @@ public class Pet {
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
AVAILABLE("available"),
|
||||
/**
|
||||
* pet status in the store
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
@SerializedName("available")
|
||||
AVAILABLE("available"),
|
||||
|
||||
@SerializedName("pending")
|
||||
PENDING("pending"),
|
||||
@SerializedName("pending")
|
||||
PENDING("pending"),
|
||||
|
||||
@SerializedName("sold")
|
||||
SOLD("sold");
|
||||
@SerializedName("sold")
|
||||
SOLD("sold");
|
||||
|
||||
private String value;
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("status")
|
||||
private StatusEnum status = null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user