com.hellosign.openapi.model.EmbeddedEditUrlResponseEmbedded Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hellosign-java-sdk Show documentation
Show all versions of hellosign-java-sdk Show documentation
Use the HelloSign Java SDK to connect your Java app to HelloSign's service in microseconds!
The newest version!
/*
* 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;
/**
* An embedded template object.
*/
@ApiModel(description = "An embedded template object.")
@JsonPropertyOrder({
EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EDIT_URL,
EmbeddedEditUrlResponseEmbedded.JSON_PROPERTY_EXPIRES_AT
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class EmbeddedEditUrlResponseEmbedded {
public static final String JSON_PROPERTY_EDIT_URL = "edit_url";
private String editUrl;
public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at";
private Integer expiresAt;
public EmbeddedEditUrlResponseEmbedded() {
}
public EmbeddedEditUrlResponseEmbedded editUrl(String editUrl) {
this.editUrl = editUrl;
return this;
}
/**
* A template url that can be opened in an iFrame.
* @return editUrl
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "A template url that can be opened in an iFrame.")
@JsonProperty(JSON_PROPERTY_EDIT_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getEditUrl() {
return editUrl;
}
@JsonProperty(JSON_PROPERTY_EDIT_URL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setEditUrl(String editUrl) {
this.editUrl = editUrl;
}
public EmbeddedEditUrlResponseEmbedded expiresAt(Integer expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* The specific time that the the `edit_url` link expires, in epoch.
* @return expiresAt
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The specific time that the the `edit_url` link expires, in epoch.")
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getExpiresAt() {
return expiresAt;
}
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExpiresAt(Integer expiresAt) {
this.expiresAt = expiresAt;
}
/**
* Return true if this EmbeddedEditUrlResponseEmbedded object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EmbeddedEditUrlResponseEmbedded embeddedEditUrlResponseEmbedded = (EmbeddedEditUrlResponseEmbedded) o;
return Objects.equals(this.editUrl, embeddedEditUrlResponseEmbedded.editUrl) &&
Objects.equals(this.expiresAt, embeddedEditUrlResponseEmbedded.expiresAt);
}
@Override
public int hashCode() {
return Objects.hash(editUrl, expiresAt);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EmbeddedEditUrlResponseEmbedded {\n");
sb.append(" editUrl: ").append(toIndentedString(editUrl)).append("\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append("}");
return sb.toString();
}
public Map createFormData() throws ApiException {
Map map = new HashMap<>();
boolean fileTypeFound = false;
try {
if (editUrl != null) {
if (isFileTypeOrListOfFiles(editUrl)) {
fileTypeFound = true;
}
if (editUrl.getClass().equals(java.io.File.class) ||
editUrl.getClass().equals(Integer.class) ||
editUrl.getClass().equals(String.class) ) {
map.put("edit_url", editUrl);
} else if (isListOfFile(editUrl)) {
for(int i = 0; i< getListSize(editUrl); i++) {
map.put("edit_url[" + i + "]", getFromList(editUrl, i));
}
}
else {
map.put("edit_url", JSON.getDefault().getMapper().writeValueAsString(editUrl));
}
}
if (expiresAt != null) {
if (isFileTypeOrListOfFiles(expiresAt)) {
fileTypeFound = true;
}
if (expiresAt.getClass().equals(java.io.File.class) ||
expiresAt.getClass().equals(Integer.class) ||
expiresAt.getClass().equals(String.class) ) {
map.put("expires_at", expiresAt);
} else if (isListOfFile(expiresAt)) {
for(int i = 0; i< getListSize(expiresAt); i++) {
map.put("expires_at[" + i + "]", getFromList(expiresAt, i));
}
}
else {
map.put("expires_at", JSON.getDefault().getMapper().writeValueAsString(expiresAt));
}
}
} 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