diff --git a/docs/IssueFormField.md b/docs/IssueFormField.md new file mode 100644 index 0000000..7139bf4 --- /dev/null +++ b/docs/IssueFormField.md @@ -0,0 +1,9 @@ +# IssueFormField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | **Map<String, Object>** | | [optional] +**id** | **String** | | [optional] +**type** | **String** | | [optional] +**validations** | **Map<String, Object>** | | [optional] diff --git a/docs/IssueTemplate.md b/docs/IssueTemplate.md index 9654e92..0bf8be3 100644 --- a/docs/IssueTemplate.md +++ b/docs/IssueTemplate.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **about** | **String** | | [optional] +**body** | [**List<IssueFormField>**](IssueFormField.md) | | [optional] **content** | **String** | | [optional] **fileName** | **String** | | [optional] **labels** | **List<String>** | | [optional] diff --git a/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java b/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java new file mode 100644 index 0000000..c186285 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java @@ -0,0 +1,173 @@ +/* + * Gitea API. + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape | Safe}} + * + * + * 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 org.gitnex.tea4j.v2.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** IssueFormField represents a form field */ +@Schema(description = "IssueFormField represents a form field") +public class IssueFormField implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("attributes") + private Map attributes = null; + + @SerializedName("id") + private String id = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("validations") + private Map validations = null; + + public IssueFormField attributes(Map attributes) { + this.attributes = attributes; + return this; + } + + public IssueFormField putAttributesItem(String key, Object attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Get attributes + * + * @return attributes + */ + @Schema(description = "") + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public IssueFormField id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @Schema(description = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IssueFormField type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public IssueFormField validations(Map validations) { + this.validations = validations; + return this; + } + + public IssueFormField putValidationsItem(String key, Object validationsItem) { + if (this.validations == null) { + this.validations = new HashMap<>(); + } + this.validations.put(key, validationsItem); + return this; + } + + /** + * Get validations + * + * @return validations + */ + @Schema(description = "") + public Map getValidations() { + return validations; + } + + public void setValidations(Map validations) { + this.validations = validations; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueFormField issueFormField = (IssueFormField) o; + return Objects.equals(this.attributes, issueFormField.attributes) + && Objects.equals(this.id, issueFormField.id) + && Objects.equals(this.type, issueFormField.type) + && Objects.equals(this.validations, issueFormField.validations); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, validations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IssueFormField {\n"); + + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validations: ").append(toIndentedString(validations)).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 "); + } +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/IssueTemplate.java b/src/main/java/org/gitnex/tea4j/v2/models/IssueTemplate.java index 0bf7deb..b07b0ff 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/IssueTemplate.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/IssueTemplate.java @@ -27,6 +27,9 @@ public class IssueTemplate implements Serializable { @SerializedName("about") private String about = null; + @SerializedName("body") + private List body = null; + @SerializedName("content") private String content = null; @@ -64,6 +67,33 @@ public class IssueTemplate implements Serializable { this.about = about; } + public IssueTemplate body(List body) { + this.body = body; + return this; + } + + public IssueTemplate addBodyItem(IssueFormField bodyItem) { + if (this.body == null) { + this.body = new ArrayList<>(); + } + this.body.add(bodyItem); + return this; + } + + /** + * Get body + * + * @return body + */ + @Schema(description = "") + public List getBody() { + return body; + } + + public void setBody(List body) { + this.body = body; + } + public IssueTemplate content(String content) { this.content = content; return this; @@ -196,6 +226,7 @@ public class IssueTemplate implements Serializable { } IssueTemplate issueTemplate = (IssueTemplate) o; return Objects.equals(this.about, issueTemplate.about) + && Objects.equals(this.body, issueTemplate.body) && Objects.equals(this.content, issueTemplate.content) && Objects.equals(this.fileName, issueTemplate.fileName) && Objects.equals(this.labels, issueTemplate.labels) @@ -206,7 +237,7 @@ public class IssueTemplate implements Serializable { @Override public int hashCode() { - return Objects.hash(about, content, fileName, labels, name, ref, title); + return Objects.hash(about, body, content, fileName, labels, name, ref, title); } @Override @@ -215,6 +246,7 @@ public class IssueTemplate implements Serializable { sb.append("class IssueTemplate {\n"); sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n");