edu.utexas.tacc.tapis.tokens.client.gen.model.BasicResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tokens-client Show documentation
Show all versions of tokens-client Show documentation
Java client for Tokens Service
/*
* Tokens API
* Manage Tapis Tokens.
*
* The version of the OpenAPI document: 1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package edu.utexas.tacc.tapis.tokens.client.gen.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* BasicResponse
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-06-22T16:07:39.365956-05:00[America/Chicago]")
public class BasicResponse {
public static final String SERIALIZED_NAME_VERSION = "version";
@SerializedName(SERIALIZED_NAME_VERSION)
private String version;
public static final String SERIALIZED_NAME_MESSAGE = "message";
@SerializedName(SERIALIZED_NAME_MESSAGE)
private String message;
/**
* Whether the request was a success or failure.
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
SUCCESS("success"),
ERROR("error");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public BasicResponse version(String version) {
this.version = version;
return this;
}
/**
* Version of the API
* @return version
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Version of the API")
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public BasicResponse message(String message) {
this.message = message;
return this;
}
/**
* Brief description of the response
* @return message
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Brief description of the response")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public BasicResponse status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Whether the request was a success or failure.
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Whether the request was a success or failure.")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BasicResponse basicResponse = (BasicResponse) o;
return Objects.equals(this.version, basicResponse.version) &&
Objects.equals(this.message, basicResponse.message) &&
Objects.equals(this.status, basicResponse.status);
}
@Override
public int hashCode() {
return Objects.hash(version, message, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BasicResponse {\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}