
com.squareup.connect.models.Error Maven / Gradle / Ivy
/*
* Square Connect API
* Client library for accessing the Square Connect APIs
*
* OpenAPI spec version: 2.0
* Contact: [email protected]
*
* 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 com.squareup.connect.models;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Represents an error encountered during a request to the Connect API. See [Handling errors](#handlingerrors) for more information.
*/
@ApiModel(description = "Represents an error encountered during a request to the Connect API. See [Handling errors](#handlingerrors) for more information.")
public class Error {
@JsonProperty("category")
private String category = null;
@JsonProperty("code")
private String code = null;
@JsonProperty("detail")
private String detail = null;
@JsonProperty("field")
private String field = null;
public Error category(String category) {
this.category = category;
return this;
}
/**
* The high-level category for the error. See `ErrorCategory` for possible values. See [ErrorCategory](#type-errorcategory) for possible values
* @return category
**/
@ApiModelProperty(required = true, value = "The high-level category for the error. See `ErrorCategory` for possible values. See [ErrorCategory](#type-errorcategory) for possible values")
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public Error code(String code) {
this.code = code;
return this;
}
/**
* The specific code of the error. See `ErrorCode` for possible values See [ErrorCode](#type-errorcode) for possible values
* @return code
**/
@ApiModelProperty(required = true, value = "The specific code of the error. See `ErrorCode` for possible values See [ErrorCode](#type-errorcode) for possible values")
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Error detail(String detail) {
this.detail = detail;
return this;
}
/**
* A human-readable description of the error for debugging purposes.
* @return detail
**/
@ApiModelProperty(value = "A human-readable description of the error for debugging purposes.")
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public Error field(String field) {
this.field = field;
return this;
}
/**
* The name of the field provided in the original request (if any) that the error pertains to.
* @return field
**/
@ApiModelProperty(value = "The name of the field provided in the original request (if any) that the error pertains to.")
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Error error = (Error) o;
return Objects.equals(this.category, error.category) &&
Objects.equals(this.code, error.code) &&
Objects.equals(this.detail, error.detail) &&
Objects.equals(this.field, error.field);
}
@Override
public int hashCode() {
return Objects.hash(category, code, detail, field);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Error {\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" detail: ").append(toIndentedString(detail)).append("\n");
sb.append(" field: ").append(toIndentedString(field)).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