From 7ad54fec92180bbdf422a1f502863571bf9546b5 Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Sun, 21 Jan 2024 00:07:42 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/CreateRepoOption.md | 8 ++ docs/Repository.md | 8 ++ .../tea4j/v2/models/CreateRepoOption.java | 70 +++++++++++++++++ .../gitnex/tea4j/v2/models/Repository.java | 75 +++++++++++++++++++ 4 files changed, 161 insertions(+) diff --git a/docs/CreateRepoOption.md b/docs/CreateRepoOption.md index 018f900..980db76 100644 --- a/docs/CreateRepoOption.md +++ b/docs/CreateRepoOption.md @@ -10,11 +10,19 @@ Name | Type | Description | Notes **issueLabels** | **String** | Label-Set to use | [optional] **license** | **String** | License to use | [optional] **name** | **String** | Name of the repository to create | +**objectFormatName** | [**ObjectFormatNameEnum**](#ObjectFormatNameEnum) | ObjectFormatName of the underlying git repository | [optional] **_private** | **Boolean** | Whether the repository is private | [optional] **readme** | **String** | Readme of the repository to create | [optional] **template** | **Boolean** | Whether the repository is template | [optional] **trustModel** | [**TrustModelEnum**](#TrustModelEnum) | TrustModel of the repository | [optional] + +## Enum: ObjectFormatNameEnum +Name | Value +---- | ----- +SHA1 | "sha1" +SHA256 | "sha256" + ## Enum: TrustModelEnum Name | Value diff --git a/docs/Repository.md b/docs/Repository.md index 3acb910..a0d451b 100644 --- a/docs/Repository.md +++ b/docs/Repository.md @@ -43,6 +43,7 @@ Name | Type | Description | Notes **mirrorInterval** | **String** | | [optional] **mirrorUpdated** | [**Date**](Date.md) | | [optional] **name** | **String** | | [optional] +**objectFormatName** | [**ObjectFormatNameEnum**](#ObjectFormatNameEnum) | ObjectFormatName of the underlying git repository | [optional] **openIssuesCount** | **Long** | | [optional] **openPrCounter** | **Long** | | [optional] **originalUrl** | **String** | | [optional] @@ -60,3 +61,10 @@ Name | Type | Description | Notes **url** | **String** | | [optional] **watchersCount** | **Long** | | [optional] **website** | **String** | | [optional] + + +## Enum: ObjectFormatNameEnum +Name | Value +---- | ----- +SHA1 | "sha1" +SHA256 | "sha256" diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java index 85c3527..fbfe37a 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java @@ -48,6 +48,54 @@ public class CreateRepoOption implements Serializable { @SerializedName("name") private String name = null; + /** ObjectFormatName of the underlying git repository */ + @JsonAdapter(ObjectFormatNameEnum.Adapter.class) + public enum ObjectFormatNameEnum { + SHA1("sha1"), + SHA256("sha256"); + + private String value; + + ObjectFormatNameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ObjectFormatNameEnum fromValue(String input) { + for (ObjectFormatNameEnum b : ObjectFormatNameEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ObjectFormatNameEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public ObjectFormatNameEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return ObjectFormatNameEnum.fromValue((String) (value)); + } + } + } + + @SerializedName("object_format_name") + private ObjectFormatNameEnum objectFormatName = null; + @SerializedName("private") private Boolean _private = null; @@ -240,6 +288,25 @@ public class CreateRepoOption implements Serializable { this.name = name; } + public CreateRepoOption objectFormatName(ObjectFormatNameEnum objectFormatName) { + this.objectFormatName = objectFormatName; + return this; + } + + /** + * ObjectFormatName of the underlying git repository + * + * @return objectFormatName + */ + @Schema(description = "ObjectFormatName of the underlying git repository") + public ObjectFormatNameEnum getObjectFormatName() { + return objectFormatName; + } + + public void setObjectFormatName(ObjectFormatNameEnum objectFormatName) { + this.objectFormatName = objectFormatName; + } + public CreateRepoOption _private(Boolean _private) { this._private = _private; return this; @@ -332,6 +399,7 @@ public class CreateRepoOption implements Serializable { && Objects.equals(this.issueLabels, createRepoOption.issueLabels) && Objects.equals(this.license, createRepoOption.license) && Objects.equals(this.name, createRepoOption.name) + && Objects.equals(this.objectFormatName, createRepoOption.objectFormatName) && Objects.equals(this._private, createRepoOption._private) && Objects.equals(this.readme, createRepoOption.readme) && Objects.equals(this.template, createRepoOption.template) @@ -348,6 +416,7 @@ public class CreateRepoOption implements Serializable { issueLabels, license, name, + objectFormatName, _private, readme, template, @@ -366,6 +435,7 @@ public class CreateRepoOption implements Serializable { sb.append(" issueLabels: ").append(toIndentedString(issueLabels)).append("\n"); sb.append(" license: ").append(toIndentedString(license)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" objectFormatName: ").append(toIndentedString(objectFormatName)).append("\n"); sb.append(" _private: ").append(toIndentedString(_private)).append("\n"); sb.append(" readme: ").append(toIndentedString(readme)).append("\n"); sb.append(" template: ").append(toIndentedString(template)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Repository.java b/src/main/java/org/gitnex/tea4j/v2/models/Repository.java index 4afd5f1..7dab89c 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/Repository.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/Repository.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -143,6 +148,54 @@ public class Repository implements Serializable { @SerializedName("name") private String name = null; + /** ObjectFormatName of the underlying git repository */ + @JsonAdapter(ObjectFormatNameEnum.Adapter.class) + public enum ObjectFormatNameEnum { + SHA1("sha1"), + SHA256("sha256"); + + private String value; + + ObjectFormatNameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ObjectFormatNameEnum fromValue(String input) { + for (ObjectFormatNameEnum b : ObjectFormatNameEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ObjectFormatNameEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public ObjectFormatNameEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return ObjectFormatNameEnum.fromValue((String) (value)); + } + } + } + + @SerializedName("object_format_name") + private ObjectFormatNameEnum objectFormatName = null; + @SerializedName("open_issues_count") private Long openIssuesCount = null; @@ -954,6 +1007,25 @@ public class Repository implements Serializable { this.name = name; } + public Repository objectFormatName(ObjectFormatNameEnum objectFormatName) { + this.objectFormatName = objectFormatName; + return this; + } + + /** + * ObjectFormatName of the underlying git repository + * + * @return objectFormatName + */ + @Schema(description = "ObjectFormatName of the underlying git repository") + public ObjectFormatNameEnum getObjectFormatName() { + return objectFormatName; + } + + public void setObjectFormatName(ObjectFormatNameEnum objectFormatName) { + this.objectFormatName = objectFormatName; + } + public Repository openIssuesCount(Long openIssuesCount) { this.openIssuesCount = openIssuesCount; return this; @@ -1327,6 +1399,7 @@ public class Repository implements Serializable { && Objects.equals(this.mirrorInterval, repository.mirrorInterval) && Objects.equals(this.mirrorUpdated, repository.mirrorUpdated) && Objects.equals(this.name, repository.name) + && Objects.equals(this.objectFormatName, repository.objectFormatName) && Objects.equals(this.openIssuesCount, repository.openIssuesCount) && Objects.equals(this.openPrCounter, repository.openPrCounter) && Objects.equals(this.originalUrl, repository.originalUrl) @@ -1389,6 +1462,7 @@ public class Repository implements Serializable { mirrorInterval, mirrorUpdated, name, + objectFormatName, openIssuesCount, openPrCounter, originalUrl, @@ -1461,6 +1535,7 @@ public class Repository implements Serializable { sb.append(" mirrorInterval: ").append(toIndentedString(mirrorInterval)).append("\n"); sb.append(" mirrorUpdated: ").append(toIndentedString(mirrorUpdated)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" objectFormatName: ").append(toIndentedString(objectFormatName)).append("\n"); sb.append(" openIssuesCount: ").append(toIndentedString(openIssuesCount)).append("\n"); sb.append(" openPrCounter: ").append(toIndentedString(openPrCounter)).append("\n"); sb.append(" originalUrl: ").append(toIndentedString(originalUrl)).append("\n");