com.hellosign.openapi.model.SubUnclaimedDraftSigner Maven / Gradle / Ivy
/*
* HelloSign API
* HelloSign v3 API
*
* The version of the OpenAPI document: 3.0.0
* 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 com.hellosign.openapi.model;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.hellosign.openapi.JSON;
import com.hellosign.openapi.ApiException;
/**
* SubUnclaimedDraftSigner
*/
@JsonPropertyOrder({
SubUnclaimedDraftSigner.JSON_PROPERTY_EMAIL_ADDRESS,
SubUnclaimedDraftSigner.JSON_PROPERTY_NAME,
SubUnclaimedDraftSigner.JSON_PROPERTY_ORDER
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SubUnclaimedDraftSigner {
public static final String JSON_PROPERTY_EMAIL_ADDRESS = "email_address";
private String emailAddress;
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public static final String JSON_PROPERTY_ORDER = "order";
private Integer order;
public SubUnclaimedDraftSigner() {
}
public SubUnclaimedDraftSigner emailAddress(String emailAddress) {
this.emailAddress = emailAddress;
return this;
}
/**
* The email address of the signer.
* @return emailAddress
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The email address of the signer.")
@JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getEmailAddress() {
return emailAddress;
}
@JsonProperty(JSON_PROPERTY_EMAIL_ADDRESS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public SubUnclaimedDraftSigner name(String name) {
this.name = name;
return this;
}
/**
* The name of the signer.
* @return name
**/
@javax.annotation.Nonnull
@ApiModelProperty(required = true, value = "The name of the signer.")
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setName(String name) {
this.name = name;
}
public SubUnclaimedDraftSigner order(Integer order) {
this.order = order;
return this;
}
/**
* The order the signer is required to sign in.
* @return order
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The order the signer is required to sign in.")
@JsonProperty(JSON_PROPERTY_ORDER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getOrder() {
return order;
}
@JsonProperty(JSON_PROPERTY_ORDER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setOrder(Integer order) {
this.order = order;
}
/**
* Return true if this SubUnclaimedDraftSigner object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SubUnclaimedDraftSigner subUnclaimedDraftSigner = (SubUnclaimedDraftSigner) o;
return Objects.equals(this.emailAddress, subUnclaimedDraftSigner.emailAddress) &&
Objects.equals(this.name, subUnclaimedDraftSigner.name) &&
Objects.equals(this.order, subUnclaimedDraftSigner.order);
}
@Override
public int hashCode() {
return Objects.hash(emailAddress, name, order);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SubUnclaimedDraftSigner {\n");
sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" order: ").append(toIndentedString(order)).append("\n");
sb.append("}");
return sb.toString();
}
public Map createFormData() throws ApiException {
Map map = new HashMap<>();
boolean fileTypeFound = false;
try {
if (emailAddress != null) {
if (isFileTypeOrListOfFiles(emailAddress)) {
fileTypeFound = true;
}
if (emailAddress.getClass().equals(java.io.File.class) ||
emailAddress.getClass().equals(Integer.class) ||
emailAddress.getClass().equals(String.class) ) {
map.put("email_address", emailAddress);
} else if (isListOfFile(emailAddress)) {
for(int i = 0; i< getListSize(emailAddress); i++) {
map.put("email_address[" + i + "]", getFromList(emailAddress, i));
}
}
else {
map.put("email_address", JSON.getDefault().getMapper().writeValueAsString(emailAddress));
}
}
if (name != null) {
if (isFileTypeOrListOfFiles(name)) {
fileTypeFound = true;
}
if (name.getClass().equals(java.io.File.class) ||
name.getClass().equals(Integer.class) ||
name.getClass().equals(String.class) ) {
map.put("name", name);
} else if (isListOfFile(name)) {
for(int i = 0; i< getListSize(name); i++) {
map.put("name[" + i + "]", getFromList(name, i));
}
}
else {
map.put("name", JSON.getDefault().getMapper().writeValueAsString(name));
}
}
if (order != null) {
if (isFileTypeOrListOfFiles(order)) {
fileTypeFound = true;
}
if (order.getClass().equals(java.io.File.class) ||
order.getClass().equals(Integer.class) ||
order.getClass().equals(String.class) ) {
map.put("order", order);
} else if (isListOfFile(order)) {
for(int i = 0; i< getListSize(order); i++) {
map.put("order[" + i + "]", getFromList(order, i));
}
}
else {
map.put("order", JSON.getDefault().getMapper().writeValueAsString(order));
}
}
} catch (Exception e) {
throw new ApiException(e);
}
return fileTypeFound ? map : new HashMap<>();
}
private boolean isFileTypeOrListOfFiles(Object obj) throws Exception {
return obj.getClass().equals(java.io.File.class) || isListOfFile(obj);
}
private boolean isListOfFile(Object obj) throws Exception {
return obj instanceof java.util.List && !isListEmpty(obj) && getFromList(obj, 0) instanceof java.io.File;
}
private boolean isListEmpty(Object obj) throws Exception {
return (boolean) Class.forName(java.util.List.class.getName()).getMethod("isEmpty").invoke(obj);
}
private Object getFromList(Object obj, int index) throws Exception {
return Class.forName(java.util.List.class.getName()).getMethod("get", int.class).invoke(obj, index);
}
private int getListSize(Object obj) throws Exception {
return (int) Class.forName(java.util.List.class.getName()).getMethod("size").invoke(obj);
}
/**
* 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 ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy