io.swagger.client.model.SalesTax Maven / Gradle / Ivy
/*
* Qualpay Platform API
* This document describes the Qualpay Platform API.
*
* OpenAPI spec version: 1.1.9
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.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;
/**
* SalesTax
*/
public class SalesTax {
/**
* <strong>Format: </strong>Variable length, up to 10 AN<br><strong>Description: </strong>Sales Tax type. Possible values are <br><strong>RATE<strong> The value field contains the tax rate. The system will automatically calculate the tax amount based on the rate. <br><strong>AMOUNT<strong> The value field contains the tax amount.
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
RATE("RATE"),
AMOUNT("AMOUNT");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String text) {
for (TypeEnum b : TypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("type")
private TypeEnum type = null;
@SerializedName("value")
private Double value = null;
public SalesTax type(TypeEnum type) {
this.type = type;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 10 AN<br><strong>Description: </strong>Sales Tax type. Possible values are <br><strong>RATE<strong> The value field contains the tax rate. The system will automatically calculate the tax amount based on the rate. <br><strong>AMOUNT<strong> The value field contains the tax amount.
* @return type
**/
@ApiModelProperty(example = "RATE", value = "Format: Variable length, up to 10 AN
Description: Sales Tax type. Possible values are
RATE The value field contains the tax rate. The system will automatically calculate the tax amount based on the rate.
AMOUNT The value field contains the tax amount.")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public SalesTax value(Double value) {
this.value = value;
return this;
}
/**
* <strong>Format: </strong>Variable length, up to 7,5 N<br><strong>Description: </strong>Sales Tax value.If type is RATE, set this field to the sales tax rate. The system will automatically calculate the sales tax amount (amt_tax) based on the rate. <br>If type is AMOUNT, set this field to the sales tax amount.
* @return value
**/
@ApiModelProperty(example = "2.345", value = "Format: Variable length, up to 7,5 N
Description: Sales Tax value.If type is RATE, set this field to the sales tax rate. The system will automatically calculate the sales tax amount (amt_tax) based on the rate.
If type is AMOUNT, set this field to the sales tax amount.")
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SalesTax salesTax = (SalesTax) o;
return Objects.equals(this.type, salesTax.type) &&
Objects.equals(this.value, salesTax.value);
}
@Override
public int hashCode() {
return Objects.hash(type, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SalesTax {\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).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 ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy