io.camunda.tasklist.generated.model.VariableResponse Maven / Gradle / Ivy
The newest version!
/*
* Tasklist REST API
* Tasklist is a ready-to-use API application to rapidly implement business processes alongside user tasks in Zeebe.
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.camunda.tasklist.generated.model;
import java.util.Objects;
import java.util.Arrays;
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.camunda.tasklist.generated.model.DraftVariableValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.StringJoiner;
/**
* VariableResponse
*/
@JsonPropertyOrder({
VariableResponse.JSON_PROPERTY_ID,
VariableResponse.JSON_PROPERTY_NAME,
VariableResponse.JSON_PROPERTY_VALUE,
VariableResponse.JSON_PROPERTY_DRAFT,
VariableResponse.JSON_PROPERTY_TENANT_ID
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-12-10T08:38:14.250454645Z[Etc/UTC]", comments = "Generator version: 7.8.0")
public class VariableResponse {
public static final String JSON_PROPERTY_ID = "id";
private String id;
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public static final String JSON_PROPERTY_VALUE = "value";
private String value;
public static final String JSON_PROPERTY_DRAFT = "draft";
private DraftVariableValue draft;
public static final String JSON_PROPERTY_TENANT_ID = "tenantId";
private String tenantId;
public VariableResponse() {
}
public VariableResponse id(String id) {
this.id = id;
return this;
}
/**
* The ID of the variable
* @return id
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(String id) {
this.id = id;
}
public VariableResponse name(String name) {
this.name = name;
return this;
}
/**
* The name of the variable
* @return name
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
public VariableResponse value(String value) {
this.value = value;
return this;
}
/**
* The full value of the variable
* @return value
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getValue() {
return value;
}
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setValue(String value) {
this.value = value;
}
public VariableResponse draft(DraftVariableValue draft) {
this.draft = draft;
return this;
}
/**
* Get draft
* @return draft
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_DRAFT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public DraftVariableValue getDraft() {
return draft;
}
@JsonProperty(JSON_PROPERTY_DRAFT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDraft(DraftVariableValue draft) {
this.draft = draft;
}
public VariableResponse tenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
/**
* The tenant ID associated with the variable
* @return tenantId
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TENANT_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getTenantId() {
return tenantId;
}
@JsonProperty(JSON_PROPERTY_TENANT_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
VariableResponse variableResponse = (VariableResponse) o;
return Objects.equals(this.id, variableResponse.id) &&
Objects.equals(this.name, variableResponse.name) &&
Objects.equals(this.value, variableResponse.value) &&
Objects.equals(this.draft, variableResponse.draft) &&
Objects.equals(this.tenantId, variableResponse.tenantId);
}
@Override
public int hashCode() {
return Objects.hash(id, name, value, draft, tenantId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class VariableResponse {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
sb.append(" draft: ").append(toIndentedString(draft)).append("\n");
sb.append(" tenantId: ").append(toIndentedString(tenantId)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}
StringJoiner joiner = new StringJoiner("&");
// add `id` to the URL query string
if (getId() != null) {
try {
joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `name` to the URL query string
if (getName() != null) {
try {
joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `value` to the URL query string
if (getValue() != null) {
try {
joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
// add `draft` to the URL query string
if (getDraft() != null) {
joiner.add(getDraft().toUrlQueryString(prefix + "draft" + suffix));
}
// add `tenantId` to the URL query string
if (getTenantId() != null) {
try {
joiner.add(String.format("%stenantId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTenantId()), "UTF-8").replaceAll("\\+", "%20")));
} catch (UnsupportedEncodingException e) {
// Should never happen, UTF-8 is always supported
throw new RuntimeException(e);
}
}
return joiner.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy