diff --git a/docs/AddCollaboratorOption.md b/docs/AddCollaboratorOption.md
index 37813fe..55533c6 100644
--- a/docs/AddCollaboratorOption.md
+++ b/docs/AddCollaboratorOption.md
@@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**permission** | [**PermissionEnum**](#PermissionEnum) | | [optional]
+**permission** | [**PermissionEnum**](#PermissionEnum) | Permission level to grant the collaborator read RepoWritePermissionRead write RepoWritePermissionWrite admin RepoWritePermissionAdmin | [optional]
## Enum: PermissionEnum
diff --git a/docs/CreateIssueOption.md b/docs/CreateIssueOption.md
index b47d74e..3254591 100644
--- a/docs/CreateIssueOption.md
+++ b/docs/CreateIssueOption.md
@@ -10,5 +10,6 @@ Name | Type | Description | Notes
**dueDate** | [**Date**](Date.md) | | [optional]
**labels** | **List<Long>** | list of label ids | [optional]
**milestone** | **Long** | milestone id | [optional]
+**projects** | **List<Long>** | list of project ids | [optional]
**ref** | **String** | | [optional]
**title** | **String** | |
diff --git a/docs/CreateOrgOption.md b/docs/CreateOrgOption.md
index aad12ad..e240649 100644
--- a/docs/CreateOrgOption.md
+++ b/docs/CreateOrgOption.md
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
**location** | **String** | The location of the organization | [optional]
**repoAdminChangeTeamAccess** | **Boolean** | Whether repository administrators can change team access | [optional]
**username** | **String** | username of the organization |
-**visibility** | [**VisibilityEnum**](#VisibilityEnum) | possible values are `public` (default), `limited` or `private` | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | possible values are `public` (default), `limited` or `private` public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
**website** | **String** | The website URL of the organization | [optional]
diff --git a/docs/CreateRepoOption.md b/docs/CreateRepoOption.md
index 669e445..41f6dd2 100644
--- a/docs/CreateRepoOption.md
+++ b/docs/CreateRepoOption.md
@@ -10,7 +10,7 @@ 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, empty string for default (sha1) | [optional]
+**objectFormatName** | [**ObjectFormatNameEnum**](#ObjectFormatNameEnum) | ObjectFormatName of the underlying git repository, empty string for default (sha1) sha1 ObjectFormatSHA1 sha256 ObjectFormatSHA256 | [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]
diff --git a/docs/CreateUserOption.md b/docs/CreateUserOption.md
index 42a748c..edbce0b 100644
--- a/docs/CreateUserOption.md
+++ b/docs/CreateUserOption.md
@@ -13,4 +13,12 @@ Name | Type | Description | Notes
**sendNotify** | **Boolean** | Whether to send welcome notification email to the user | [optional]
**sourceId** | **Long** | The authentication source ID to associate with the user | [optional]
**username** | **String** | username of the user |
-**visibility** | **String** | User visibility level: public, limited, or private | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | User visibility level: public, limited, or private public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
+
+
+## Enum: VisibilityEnum
+Name | Value
+---- | -----
+PUBLIC | "public"
+LIMITED | "limited"
+PRIVATE | "private"
diff --git a/docs/EditIssueOption.md b/docs/EditIssueOption.md
index 9bb3a4b..cc34dbb 100644
--- a/docs/EditIssueOption.md
+++ b/docs/EditIssueOption.md
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
**contentVersion** | **Long** | The current version of the issue content to detect conflicts during editing | [optional]
**dueDate** | [**Date**](Date.md) | | [optional]
**milestone** | **Long** | | [optional]
+**projects** | **List<Long>** | list of project ids to set (replaces existing projects) | [optional]
**ref** | **String** | | [optional]
**state** | **String** | | [optional]
**title** | **String** | | [optional]
diff --git a/docs/EditOrgOption.md b/docs/EditOrgOption.md
index ba8b6d8..9a6d7e5 100644
--- a/docs/EditOrgOption.md
+++ b/docs/EditOrgOption.md
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
**fullName** | **String** | The full display name of the organization | [optional]
**location** | **String** | The location of the organization | [optional]
**repoAdminChangeTeamAccess** | **Boolean** | Whether repository administrators can change team access | [optional]
-**visibility** | [**VisibilityEnum**](#VisibilityEnum) | possible values are `public`, `limited` or `private` | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | possible values are `public`, `limited` or `private` public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
**website** | **String** | The website URL of the organization | [optional]
diff --git a/docs/EditUserOption.md b/docs/EditUserOption.md
index 7a4396e..c5caf0f 100644
--- a/docs/EditUserOption.md
+++ b/docs/EditUserOption.md
@@ -19,5 +19,13 @@ Name | Type | Description | Notes
**prohibitLogin** | **Boolean** | Whether the user is prohibited from logging in | [optional]
**restricted** | **Boolean** | Whether the user has restricted access privileges | [optional]
**sourceId** | **Long** | |
-**visibility** | **String** | User visibility level: public, limited, or private | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | User visibility level: public, limited, or private public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
**website** | **String** | The user's personal website URL | [optional]
+
+
+## Enum: VisibilityEnum
+Name | Value
+---- | -----
+PUBLIC | "public"
+LIMITED | "limited"
+PRIVATE | "private"
diff --git a/docs/Issue.md b/docs/Issue.md
index 4d1d03f..a5db3ef 100644
--- a/docs/Issue.md
+++ b/docs/Issue.md
@@ -21,6 +21,7 @@ Name | Type | Description | Notes
**originalAuthor** | **String** | | [optional]
**originalAuthorId** | **Long** | | [optional]
**pinOrder** | **Long** | | [optional]
+**projects** | [**List<Project>**](Project.md) | | [optional]
**pullRequest** | [**PullRequestMeta**](PullRequestMeta.md) | | [optional]
**ref** | **String** | | [optional]
**repository** | [**RepositoryMeta**](RepositoryMeta.md) | | [optional]
diff --git a/docs/Organization.md b/docs/Organization.md
index 2bbc0d7..2b9641a 100644
--- a/docs/Organization.md
+++ b/docs/Organization.md
@@ -12,5 +12,13 @@ Name | Type | Description | Notes
**name** | **String** | The name of the organization | [optional]
**repoAdminChangeTeamAccess** | **Boolean** | Whether repository administrators can change team access | [optional]
**username** | **String** | username of the organization deprecated | [optional]
-**visibility** | **String** | The visibility level of the organization (public, limited, private) | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | The visibility level of the organization (public, limited, private) public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
**website** | **String** | The website URL of the organization | [optional]
+
+
+## Enum: VisibilityEnum
+Name | Value
+---- | -----
+PUBLIC | "public"
+LIMITED | "limited"
+PRIVATE | "private"
diff --git a/docs/Project.md b/docs/Project.md
new file mode 100644
index 0000000..3f103d8
--- /dev/null
+++ b/docs/Project.md
@@ -0,0 +1,15 @@
+# Project
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**closedAt** | [**Date**](Date.md) | | [optional]
+**createdAt** | [**Date**](Date.md) | | [optional]
+**creatorId** | **Long** | CreatorID is the user who created the project | [optional]
+**description** | **String** | Description provides details about the project | [optional]
+**id** | **Long** | ID is the unique identifier for the project | [optional]
+**isClosed** | **Boolean** | IsClosed indicates if the project is closed | [optional]
+**ownerId** | **Long** | OwnerID is the owner of the project (for org-level projects) | [optional]
+**repoId** | **Long** | RepoID is the repository this project belongs to (for repo-level projects) | [optional]
+**title** | **String** | Title is the title of the project | [optional]
+**updatedAt** | [**Date**](Date.md) | | [optional]
diff --git a/docs/RepoCollaboratorPermission.md b/docs/RepoCollaboratorPermission.md
index 316adcf..96e4f15 100644
--- a/docs/RepoCollaboratorPermission.md
+++ b/docs/RepoCollaboratorPermission.md
@@ -3,6 +3,16 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**permission** | **String** | Permission level of the collaborator | [optional]
+**permission** | [**PermissionEnum**](#PermissionEnum) | Permission level of the collaborator none AccessLevelNameNone read AccessLevelNameRead write AccessLevelNameWrite admin AccessLevelNameAdmin owner AccessLevelNameOwner | [optional]
**roleName** | **String** | RoleName is the name of the permission role | [optional]
**user** | [**User**](User.md) | | [optional]
+
+
+## Enum: PermissionEnum
+Name | Value
+---- | -----
+NONE | "none"
+READ | "read"
+WRITE | "write"
+ADMIN | "admin"
+OWNER | "owner"
diff --git a/docs/Repository.md b/docs/Repository.md
index 1596091..bc5702c 100644
--- a/docs/Repository.md
+++ b/docs/Repository.md
@@ -50,7 +50,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]
+**objectFormatName** | [**ObjectFormatNameEnum**](#ObjectFormatNameEnum) | ObjectFormatName of the underlying git repository sha1 ObjectFormatSHA1 sha256 ObjectFormatSHA256 | [optional]
**openIssuesCount** | **Long** | | [optional]
**openPrCounter** | **Long** | | [optional]
**originalUrl** | **String** | | [optional]
diff --git a/docs/User.md b/docs/User.md
index f481a53..4e2b094 100644
--- a/docs/User.md
+++ b/docs/User.md
@@ -23,5 +23,13 @@ Name | Type | Description | Notes
**restricted** | **Boolean** | Is user restricted | [optional]
**sourceId** | **Long** | The ID of the user's Authentication Source | [optional]
**starredReposCount** | **Long** | | [optional]
-**visibility** | **String** | User visibility level option: public, limited, private | [optional]
+**visibility** | [**VisibilityEnum**](#VisibilityEnum) | User visibility level option: public, limited, private public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate | [optional]
**website** | **String** | the user's website | [optional]
+
+
+## Enum: VisibilityEnum
+Name | Value
+---- | -----
+PUBLIC | "public"
+LIMITED | "limited"
+PRIVATE | "private"
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/AddCollaboratorOption.java b/src/main/java/org/gitnex/tea4j/v2/models/AddCollaboratorOption.java
index 40b0d2d..f60a2ee 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/AddCollaboratorOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/AddCollaboratorOption.java
@@ -28,7 +28,10 @@ import java.util.Objects;
"AddCollaboratorOption options when adding a user as a collaborator of a repository")
public class AddCollaboratorOption implements Serializable {
private static final long serialVersionUID = 1L;
- /** Gets or Sets permission */
+ /**
+ * Permission level to grant the collaborator read RepoWritePermissionRead write
+ * RepoWritePermissionWrite admin RepoWritePermissionAdmin
+ */
@JsonAdapter(PermissionEnum.Adapter.class)
public enum PermissionEnum {
READ("read"),
@@ -83,11 +86,15 @@ public class AddCollaboratorOption implements Serializable {
}
/**
- * Get permission
+ * Permission level to grant the collaborator read RepoWritePermissionRead write
+ * RepoWritePermissionWrite admin RepoWritePermissionAdmin
*
* @return permission
*/
- @Schema(description = "")
+ @Schema(
+ description =
+ "Permission level to grant the collaborator read RepoWritePermissionRead write"
+ + " RepoWritePermissionWrite admin RepoWritePermissionAdmin")
public PermissionEnum getPermission() {
return permission;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateIssueOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateIssueOption.java
index 8bd36cc..2298282 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/CreateIssueOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateIssueOption.java
@@ -46,6 +46,9 @@ public class CreateIssueOption implements Serializable {
@SerializedName("milestone")
private Long milestone = null;
+ @SerializedName("projects")
+ private List projects = null;
+
@SerializedName("ref")
private String ref = null;
@@ -201,6 +204,33 @@ public class CreateIssueOption implements Serializable {
this.milestone = milestone;
}
+ public CreateIssueOption projects(List projects) {
+ this.projects = projects;
+ return this;
+ }
+
+ public CreateIssueOption addProjectsItem(Long projectsItem) {
+ if (this.projects == null) {
+ this.projects = new ArrayList<>();
+ }
+ this.projects.add(projectsItem);
+ return this;
+ }
+
+ /**
+ * list of project ids
+ *
+ * @return projects
+ */
+ @Schema(description = "list of project ids")
+ public List getProjects() {
+ return projects;
+ }
+
+ public void setProjects(List projects) {
+ this.projects = projects;
+ }
+
public CreateIssueOption ref(String ref) {
this.ref = ref;
return this;
@@ -255,13 +285,15 @@ public class CreateIssueOption implements Serializable {
&& Objects.equals(this.dueDate, createIssueOption.dueDate)
&& Objects.equals(this.labels, createIssueOption.labels)
&& Objects.equals(this.milestone, createIssueOption.milestone)
+ && Objects.equals(this.projects, createIssueOption.projects)
&& Objects.equals(this.ref, createIssueOption.ref)
&& Objects.equals(this.title, createIssueOption.title);
}
@Override
public int hashCode() {
- return Objects.hash(assignee, assignees, body, closed, dueDate, labels, milestone, ref, title);
+ return Objects.hash(
+ assignee, assignees, body, closed, dueDate, labels, milestone, projects, ref, title);
}
@Override
@@ -276,6 +308,7 @@ public class CreateIssueOption implements Serializable {
sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n");
sb.append(" labels: ").append(toIndentedString(labels)).append("\n");
sb.append(" milestone: ").append(toIndentedString(milestone)).append("\n");
+ sb.append(" projects: ").append(toIndentedString(projects)).append("\n");
sb.append(" ref: ").append(toIndentedString(ref)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append("}");
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateOrgOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateOrgOption.java
index 03e2d04..729432a 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/CreateOrgOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateOrgOption.java
@@ -47,6 +47,7 @@ public class CreateOrgOption implements Serializable {
/**
* possible values are `public` (default), `limited` or `private`
+ * public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate
*/
@JsonAdapter(VisibilityEnum.Adapter.class)
public enum VisibilityEnum {
@@ -220,10 +221,14 @@ public class CreateOrgOption implements Serializable {
/**
* possible values are `public` (default), `limited` or `private`
+ * public UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "possible values are `public` (default), `limited` or `private`")
+ @Schema(
+ description =
+ "possible values are `public` (default), `limited` or `private` public"
+ + " UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate")
public VisibilityEnum getVisibility() {
return visibility;
}
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 5fb2532..caa4153 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateRepoOption.java
@@ -48,7 +48,10 @@ public class CreateRepoOption implements Serializable {
@SerializedName("name")
private String name = null;
- /** ObjectFormatName of the underlying git repository, empty string for default (sha1) */
+ /**
+ * ObjectFormatName of the underlying git repository, empty string for default (sha1) sha1
+ * ObjectFormatSHA1 sha256 ObjectFormatSHA256
+ */
@JsonAdapter(ObjectFormatNameEnum.Adapter.class)
public enum ObjectFormatNameEnum {
SHA1("sha1"),
@@ -294,13 +297,15 @@ public class CreateRepoOption implements Serializable {
}
/**
- * ObjectFormatName of the underlying git repository, empty string for default (sha1)
+ * ObjectFormatName of the underlying git repository, empty string for default (sha1) sha1
+ * ObjectFormatSHA1 sha256 ObjectFormatSHA256
*
* @return objectFormatName
*/
@Schema(
description =
- "ObjectFormatName of the underlying git repository, empty string for default (sha1)")
+ "ObjectFormatName of the underlying git repository, empty string for default (sha1) sha1"
+ + " ObjectFormatSHA1 sha256 ObjectFormatSHA256")
public ObjectFormatNameEnum getObjectFormatName() {
return objectFormatName;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateUserOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateUserOption.java
index 57f2976..693fe06 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/CreateUserOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateUserOption.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;
@@ -53,8 +58,57 @@ public class CreateUserOption implements Serializable {
@SerializedName("username")
private String username = null;
+ /**
+ * User visibility level: public, limited, or private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
+ */
+ @JsonAdapter(VisibilityEnum.Adapter.class)
+ public enum VisibilityEnum {
+ PUBLIC("public"),
+ LIMITED("limited"),
+ PRIVATE("private");
+
+ private String value;
+
+ VisibilityEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static VisibilityEnum fromValue(String input) {
+ for (VisibilityEnum b : VisibilityEnum.values()) {
+ if (b.value.equals(input)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final VisibilityEnum enumeration)
+ throws IOException {
+ jsonWriter.value(String.valueOf(enumeration.getValue()));
+ }
+
+ @Override
+ public VisibilityEnum read(final JsonReader jsonReader) throws IOException {
+ Object value = jsonReader.nextString();
+ return VisibilityEnum.fromValue((String) (value));
+ }
+ }
+ }
+
@SerializedName("visibility")
- private String visibility = null;
+ private VisibilityEnum visibility = null;
public CreateUserOption createdAt(Date createdAt) {
this.createdAt = createdAt;
@@ -253,22 +307,26 @@ public class CreateUserOption implements Serializable {
this.username = username;
}
- public CreateUserOption visibility(String visibility) {
+ public CreateUserOption visibility(VisibilityEnum visibility) {
this.visibility = visibility;
return this;
}
/**
- * User visibility level: public, limited, or private
+ * User visibility level: public, limited, or private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "User visibility level: public, limited, or private")
- public String getVisibility() {
+ @Schema(
+ description =
+ "User visibility level: public, limited, or private public UserVisibilityPublic limited"
+ + " UserVisibilityLimited private UserVisibilityPrivate")
+ public VisibilityEnum getVisibility() {
return visibility;
}
- public void setVisibility(String visibility) {
+ public void setVisibility(VisibilityEnum visibility) {
this.visibility = visibility;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java
index 1ed2463..ad07c50 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java
@@ -43,6 +43,9 @@ public class EditIssueOption implements Serializable {
@SerializedName("milestone")
private Long milestone = null;
+ @SerializedName("projects")
+ private List projects = null;
+
@SerializedName("ref")
private String ref = null;
@@ -178,6 +181,33 @@ public class EditIssueOption implements Serializable {
this.milestone = milestone;
}
+ public EditIssueOption projects(List projects) {
+ this.projects = projects;
+ return this;
+ }
+
+ public EditIssueOption addProjectsItem(Long projectsItem) {
+ if (this.projects == null) {
+ this.projects = new ArrayList<>();
+ }
+ this.projects.add(projectsItem);
+ return this;
+ }
+
+ /**
+ * list of project ids to set (replaces existing projects)
+ *
+ * @return projects
+ */
+ @Schema(description = "list of project ids to set (replaces existing projects)")
+ public List getProjects() {
+ return projects;
+ }
+
+ public void setProjects(List projects) {
+ this.projects = projects;
+ }
+
public EditIssueOption ref(String ref) {
this.ref = ref;
return this;
@@ -269,6 +299,7 @@ public class EditIssueOption implements Serializable {
&& Objects.equals(this.contentVersion, editIssueOption.contentVersion)
&& Objects.equals(this.dueDate, editIssueOption.dueDate)
&& Objects.equals(this.milestone, editIssueOption.milestone)
+ && Objects.equals(this.projects, editIssueOption.projects)
&& Objects.equals(this.ref, editIssueOption.ref)
&& Objects.equals(this.state, editIssueOption.state)
&& Objects.equals(this.title, editIssueOption.title)
@@ -284,6 +315,7 @@ public class EditIssueOption implements Serializable {
contentVersion,
dueDate,
milestone,
+ projects,
ref,
state,
title,
@@ -301,6 +333,7 @@ public class EditIssueOption implements Serializable {
sb.append(" contentVersion: ").append(toIndentedString(contentVersion)).append("\n");
sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n");
sb.append(" milestone: ").append(toIndentedString(milestone)).append("\n");
+ sb.append(" projects: ").append(toIndentedString(projects)).append("\n");
sb.append(" ref: ").append(toIndentedString(ref)).append("\n");
sb.append(" state: ").append(toIndentedString(state)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditOrgOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditOrgOption.java
index 8acaa27..e708752 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/EditOrgOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/EditOrgOption.java
@@ -42,7 +42,10 @@ public class EditOrgOption implements Serializable {
@SerializedName("repo_admin_change_team_access")
private Boolean repoAdminChangeTeamAccess = null;
- /** possible values are `public`, `limited` or `private` */
+ /**
+ * possible values are `public`, `limited` or `private` public
+ * UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate
+ */
@JsonAdapter(VisibilityEnum.Adapter.class)
public enum VisibilityEnum {
PUBLIC("public"),
@@ -195,11 +198,15 @@ public class EditOrgOption implements Serializable {
}
/**
- * possible values are `public`, `limited` or `private`
+ * possible values are `public`, `limited` or `private` public
+ * UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "possible values are `public`, `limited` or `private`")
+ @Schema(
+ description =
+ "possible values are `public`, `limited` or `private` public UserVisibilityPublic limited"
+ + " UserVisibilityLimited private UserVisibilityPrivate")
public VisibilityEnum getVisibility() {
return visibility;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditUserOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditUserOption.java
index dccde99..e17ddf1 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/EditUserOption.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/EditUserOption.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.Objects;
@@ -70,8 +75,57 @@ public class EditUserOption implements Serializable {
@SerializedName("source_id")
private Long sourceId = null;
+ /**
+ * User visibility level: public, limited, or private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
+ */
+ @JsonAdapter(VisibilityEnum.Adapter.class)
+ public enum VisibilityEnum {
+ PUBLIC("public"),
+ LIMITED("limited"),
+ PRIVATE("private");
+
+ private String value;
+
+ VisibilityEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static VisibilityEnum fromValue(String input) {
+ for (VisibilityEnum b : VisibilityEnum.values()) {
+ if (b.value.equals(input)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final VisibilityEnum enumeration)
+ throws IOException {
+ jsonWriter.value(String.valueOf(enumeration.getValue()));
+ }
+
+ @Override
+ public VisibilityEnum read(final JsonReader jsonReader) throws IOException {
+ Object value = jsonReader.nextString();
+ return VisibilityEnum.fromValue((String) (value));
+ }
+ }
+ }
+
@SerializedName("visibility")
- private String visibility = null;
+ private VisibilityEnum visibility = null;
@SerializedName("website")
private String website = null;
@@ -383,22 +437,26 @@ public class EditUserOption implements Serializable {
this.sourceId = sourceId;
}
- public EditUserOption visibility(String visibility) {
+ public EditUserOption visibility(VisibilityEnum visibility) {
this.visibility = visibility;
return this;
}
/**
- * User visibility level: public, limited, or private
+ * User visibility level: public, limited, or private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "User visibility level: public, limited, or private")
- public String getVisibility() {
+ @Schema(
+ description =
+ "User visibility level: public, limited, or private public UserVisibilityPublic limited"
+ + " UserVisibilityLimited private UserVisibilityPrivate")
+ public VisibilityEnum getVisibility() {
return visibility;
}
- public void setVisibility(String visibility) {
+ public void setVisibility(VisibilityEnum visibility) {
this.visibility = visibility;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Issue.java b/src/main/java/org/gitnex/tea4j/v2/models/Issue.java
index 08b9544..2829f30 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/Issue.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/Issue.java
@@ -84,6 +84,9 @@ public class Issue implements Serializable {
@SerializedName("pin_order")
private Long pinOrder = null;
+ @SerializedName("projects")
+ private List projects = null;
+
@SerializedName("pull_request")
private PullRequestMeta pullRequest = null;
@@ -522,6 +525,33 @@ public class Issue implements Serializable {
this.pinOrder = pinOrder;
}
+ public Issue projects(List projects) {
+ this.projects = projects;
+ return this;
+ }
+
+ public Issue addProjectsItem(Project projectsItem) {
+ if (this.projects == null) {
+ this.projects = new ArrayList<>();
+ }
+ this.projects.add(projectsItem);
+ return this;
+ }
+
+ /**
+ * Get projects
+ *
+ * @return projects
+ */
+ @Schema(description = "")
+ public List getProjects() {
+ return projects;
+ }
+
+ public void setProjects(List projects) {
+ this.projects = projects;
+ }
+
public Issue pullRequest(PullRequestMeta pullRequest) {
this.pullRequest = pullRequest;
return this;
@@ -720,6 +750,7 @@ public class Issue implements Serializable {
&& Objects.equals(this.originalAuthor, issue.originalAuthor)
&& Objects.equals(this.originalAuthorId, issue.originalAuthorId)
&& Objects.equals(this.pinOrder, issue.pinOrder)
+ && Objects.equals(this.projects, issue.projects)
&& Objects.equals(this.pullRequest, issue.pullRequest)
&& Objects.equals(this.ref, issue.ref)
&& Objects.equals(this.repository, issue.repository)
@@ -752,6 +783,7 @@ public class Issue implements Serializable {
originalAuthor,
originalAuthorId,
pinOrder,
+ projects,
pullRequest,
ref,
repository,
@@ -786,6 +818,7 @@ public class Issue implements Serializable {
sb.append(" originalAuthor: ").append(toIndentedString(originalAuthor)).append("\n");
sb.append(" originalAuthorId: ").append(toIndentedString(originalAuthorId)).append("\n");
sb.append(" pinOrder: ").append(toIndentedString(pinOrder)).append("\n");
+ sb.append(" projects: ").append(toIndentedString(projects)).append("\n");
sb.append(" pullRequest: ").append(toIndentedString(pullRequest)).append("\n");
sb.append(" ref: ").append(toIndentedString(ref)).append("\n");
sb.append(" repository: ").append(toIndentedString(repository)).append("\n");
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Organization.java b/src/main/java/org/gitnex/tea4j/v2/models/Organization.java
index 593a9f3..145f6c6 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/Organization.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/Organization.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.Objects;
@@ -49,8 +54,57 @@ public class Organization implements Serializable {
@SerializedName("username")
private String username = null;
+ /**
+ * The visibility level of the organization (public, limited, private) public UserVisibilityPublic
+ * limited UserVisibilityLimited private UserVisibilityPrivate
+ */
+ @JsonAdapter(VisibilityEnum.Adapter.class)
+ public enum VisibilityEnum {
+ PUBLIC("public"),
+ LIMITED("limited"),
+ PRIVATE("private");
+
+ private String value;
+
+ VisibilityEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static VisibilityEnum fromValue(String input) {
+ for (VisibilityEnum b : VisibilityEnum.values()) {
+ if (b.value.equals(input)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final VisibilityEnum enumeration)
+ throws IOException {
+ jsonWriter.value(String.valueOf(enumeration.getValue()));
+ }
+
+ @Override
+ public VisibilityEnum read(final JsonReader jsonReader) throws IOException {
+ Object value = jsonReader.nextString();
+ return VisibilityEnum.fromValue((String) (value));
+ }
+ }
+ }
+
@SerializedName("visibility")
- private String visibility = null;
+ private VisibilityEnum visibility = null;
@SerializedName("website")
private String website = null;
@@ -226,22 +280,26 @@ public class Organization implements Serializable {
this.username = username;
}
- public Organization visibility(String visibility) {
+ public Organization visibility(VisibilityEnum visibility) {
this.visibility = visibility;
return this;
}
/**
- * The visibility level of the organization (public, limited, private)
+ * The visibility level of the organization (public, limited, private) public UserVisibilityPublic
+ * limited UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "The visibility level of the organization (public, limited, private)")
- public String getVisibility() {
+ @Schema(
+ description =
+ "The visibility level of the organization (public, limited, private) public"
+ + " UserVisibilityPublic limited UserVisibilityLimited private UserVisibilityPrivate")
+ public VisibilityEnum getVisibility() {
return visibility;
}
- public void setVisibility(String visibility) {
+ public void setVisibility(VisibilityEnum visibility) {
this.visibility = visibility;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Project.java b/src/main/java/org/gitnex/tea4j/v2/models/Project.java
new file mode 100644
index 0000000..fa23eda
--- /dev/null
+++ b/src/main/java/org/gitnex/tea4j/v2/models/Project.java
@@ -0,0 +1,311 @@
+/*
+ * Gitea API
+ * This documentation describes the Gitea API.
+ *
+ * OpenAPI spec version: {{.SwaggerAppVer}}
+ *
+ *
+ * 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.Date;
+import java.util.Objects;
+
+/** Project represents a project */
+@Schema(description = "Project represents a project")
+public class Project implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @SerializedName("closed_at")
+ private Date closedAt = null;
+
+ @SerializedName("created_at")
+ private Date createdAt = null;
+
+ @SerializedName("creator_id")
+ private Long creatorId = null;
+
+ @SerializedName("description")
+ private String description = null;
+
+ @SerializedName("id")
+ private Long id = null;
+
+ @SerializedName("is_closed")
+ private Boolean isClosed = null;
+
+ @SerializedName("owner_id")
+ private Long ownerId = null;
+
+ @SerializedName("repo_id")
+ private Long repoId = null;
+
+ @SerializedName("title")
+ private String title = null;
+
+ @SerializedName("updated_at")
+ private Date updatedAt = null;
+
+ public Project closedAt(Date closedAt) {
+ this.closedAt = closedAt;
+ return this;
+ }
+
+ /**
+ * Get closedAt
+ *
+ * @return closedAt
+ */
+ @Schema(description = "")
+ public Date getClosedAt() {
+ return closedAt;
+ }
+
+ public void setClosedAt(Date closedAt) {
+ this.closedAt = closedAt;
+ }
+
+ public Project createdAt(Date createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * Get createdAt
+ *
+ * @return createdAt
+ */
+ @Schema(description = "")
+ public Date getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(Date createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public Project creatorId(Long creatorId) {
+ this.creatorId = creatorId;
+ return this;
+ }
+
+ /**
+ * CreatorID is the user who created the project
+ *
+ * @return creatorId
+ */
+ @Schema(description = "CreatorID is the user who created the project")
+ public Long getCreatorId() {
+ return creatorId;
+ }
+
+ public void setCreatorId(Long creatorId) {
+ this.creatorId = creatorId;
+ }
+
+ public Project description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Description provides details about the project
+ *
+ * @return description
+ */
+ @Schema(description = "Description provides details about the project")
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Project id(Long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * ID is the unique identifier for the project
+ *
+ * @return id
+ */
+ @Schema(description = "ID is the unique identifier for the project")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Project isClosed(Boolean isClosed) {
+ this.isClosed = isClosed;
+ return this;
+ }
+
+ /**
+ * IsClosed indicates if the project is closed
+ *
+ * @return isClosed
+ */
+ @Schema(description = "IsClosed indicates if the project is closed")
+ public Boolean isIsClosed() {
+ return isClosed;
+ }
+
+ public void setIsClosed(Boolean isClosed) {
+ this.isClosed = isClosed;
+ }
+
+ public Project ownerId(Long ownerId) {
+ this.ownerId = ownerId;
+ return this;
+ }
+
+ /**
+ * OwnerID is the owner of the project (for org-level projects)
+ *
+ * @return ownerId
+ */
+ @Schema(description = "OwnerID is the owner of the project (for org-level projects)")
+ public Long getOwnerId() {
+ return ownerId;
+ }
+
+ public void setOwnerId(Long ownerId) {
+ this.ownerId = ownerId;
+ }
+
+ public Project repoId(Long repoId) {
+ this.repoId = repoId;
+ return this;
+ }
+
+ /**
+ * RepoID is the repository this project belongs to (for repo-level projects)
+ *
+ * @return repoId
+ */
+ @Schema(
+ description = "RepoID is the repository this project belongs to (for repo-level projects)")
+ public Long getRepoId() {
+ return repoId;
+ }
+
+ public void setRepoId(Long repoId) {
+ this.repoId = repoId;
+ }
+
+ public Project title(String title) {
+ this.title = title;
+ return this;
+ }
+
+ /**
+ * Title is the title of the project
+ *
+ * @return title
+ */
+ @Schema(description = "Title is the title of the project")
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public Project updatedAt(Date updatedAt) {
+ this.updatedAt = updatedAt;
+ return this;
+ }
+
+ /**
+ * Get updatedAt
+ *
+ * @return updatedAt
+ */
+ @Schema(description = "")
+ public Date getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(Date updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Project project = (Project) o;
+ return Objects.equals(this.closedAt, project.closedAt)
+ && Objects.equals(this.createdAt, project.createdAt)
+ && Objects.equals(this.creatorId, project.creatorId)
+ && Objects.equals(this.description, project.description)
+ && Objects.equals(this.id, project.id)
+ && Objects.equals(this.isClosed, project.isClosed)
+ && Objects.equals(this.ownerId, project.ownerId)
+ && Objects.equals(this.repoId, project.repoId)
+ && Objects.equals(this.title, project.title)
+ && Objects.equals(this.updatedAt, project.updatedAt);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ closedAt,
+ createdAt,
+ creatorId,
+ description,
+ id,
+ isClosed,
+ ownerId,
+ repoId,
+ title,
+ updatedAt);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Project {\n");
+
+ sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n");
+ sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
+ sb.append(" creatorId: ").append(toIndentedString(creatorId)).append("\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" isClosed: ").append(toIndentedString(isClosed)).append("\n");
+ sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n");
+ sb.append(" repoId: ").append(toIndentedString(repoId)).append("\n");
+ sb.append(" title: ").append(toIndentedString(title)).append("\n");
+ sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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/RepoCollaboratorPermission.java b/src/main/java/org/gitnex/tea4j/v2/models/RepoCollaboratorPermission.java
index 3762f64..61b3e70 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/RepoCollaboratorPermission.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/RepoCollaboratorPermission.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.Objects;
@@ -21,9 +26,59 @@ import java.util.Objects;
@Schema(description = "RepoCollaboratorPermission to get repository permission for a collaborator")
public class RepoCollaboratorPermission implements Serializable {
private static final long serialVersionUID = 1L;
+ /**
+ * Permission level of the collaborator none AccessLevelNameNone read AccessLevelNameRead write
+ * AccessLevelNameWrite admin AccessLevelNameAdmin owner AccessLevelNameOwner
+ */
+ @JsonAdapter(PermissionEnum.Adapter.class)
+ public enum PermissionEnum {
+ NONE("none"),
+ READ("read"),
+ WRITE("write"),
+ ADMIN("admin"),
+ OWNER("owner");
+
+ private String value;
+
+ PermissionEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static PermissionEnum fromValue(String input) {
+ for (PermissionEnum b : PermissionEnum.values()) {
+ if (b.value.equals(input)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final PermissionEnum enumeration)
+ throws IOException {
+ jsonWriter.value(String.valueOf(enumeration.getValue()));
+ }
+
+ @Override
+ public PermissionEnum read(final JsonReader jsonReader) throws IOException {
+ Object value = jsonReader.nextString();
+ return PermissionEnum.fromValue((String) (value));
+ }
+ }
+ }
@SerializedName("permission")
- private String permission = null;
+ private PermissionEnum permission = null;
@SerializedName("role_name")
private String roleName = null;
@@ -31,22 +86,26 @@ public class RepoCollaboratorPermission implements Serializable {
@SerializedName("user")
private User user = null;
- public RepoCollaboratorPermission permission(String permission) {
+ public RepoCollaboratorPermission permission(PermissionEnum permission) {
this.permission = permission;
return this;
}
/**
- * Permission level of the collaborator
+ * Permission level of the collaborator none AccessLevelNameNone read AccessLevelNameRead write
+ * AccessLevelNameWrite admin AccessLevelNameAdmin owner AccessLevelNameOwner
*
* @return permission
*/
- @Schema(description = "Permission level of the collaborator")
- public String getPermission() {
+ @Schema(
+ description =
+ "Permission level of the collaborator none AccessLevelNameNone read AccessLevelNameRead"
+ + " write AccessLevelNameWrite admin AccessLevelNameAdmin owner AccessLevelNameOwner")
+ public PermissionEnum getPermission() {
return permission;
}
- public void setPermission(String permission) {
+ public void setPermission(PermissionEnum permission) {
this.permission = permission;
}
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 6e65fed..64706a1 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/Repository.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/Repository.java
@@ -171,7 +171,10 @@ public class Repository implements Serializable {
@SerializedName("name")
private String name = null;
- /** ObjectFormatName of the underlying git repository */
+ /**
+ * ObjectFormatName of the underlying git repository sha1 ObjectFormatSHA1 sha256
+ * ObjectFormatSHA256
+ */
@JsonAdapter(ObjectFormatNameEnum.Adapter.class)
public enum ObjectFormatNameEnum {
SHA1("sha1"),
@@ -1183,11 +1186,15 @@ public class Repository implements Serializable {
}
/**
- * ObjectFormatName of the underlying git repository
+ * ObjectFormatName of the underlying git repository sha1 ObjectFormatSHA1 sha256
+ * ObjectFormatSHA256
*
* @return objectFormatName
*/
- @Schema(description = "ObjectFormatName of the underlying git repository")
+ @Schema(
+ description =
+ "ObjectFormatName of the underlying git repository sha1 ObjectFormatSHA1 sha256"
+ + " ObjectFormatSHA256")
public ObjectFormatNameEnum getObjectFormatName() {
return objectFormatName;
}
diff --git a/src/main/java/org/gitnex/tea4j/v2/models/User.java b/src/main/java/org/gitnex/tea4j/v2/models/User.java
index 6268ecf..b32c401 100644
--- a/src/main/java/org/gitnex/tea4j/v2/models/User.java
+++ b/src/main/java/org/gitnex/tea4j/v2/models/User.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;
@@ -83,8 +88,57 @@ public class User implements Serializable {
@SerializedName("starred_repos_count")
private Long starredReposCount = null;
+ /**
+ * User visibility level option: public, limited, private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
+ */
+ @JsonAdapter(VisibilityEnum.Adapter.class)
+ public enum VisibilityEnum {
+ PUBLIC("public"),
+ LIMITED("limited"),
+ PRIVATE("private");
+
+ private String value;
+
+ VisibilityEnum(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ public static VisibilityEnum fromValue(String input) {
+ for (VisibilityEnum b : VisibilityEnum.values()) {
+ if (b.value.equals(input)) {
+ return b;
+ }
+ }
+ return null;
+ }
+
+ public static class Adapter extends TypeAdapter {
+ @Override
+ public void write(final JsonWriter jsonWriter, final VisibilityEnum enumeration)
+ throws IOException {
+ jsonWriter.value(String.valueOf(enumeration.getValue()));
+ }
+
+ @Override
+ public VisibilityEnum read(final JsonReader jsonReader) throws IOException {
+ Object value = jsonReader.nextString();
+ return VisibilityEnum.fromValue((String) (value));
+ }
+ }
+ }
+
@SerializedName("visibility")
- private String visibility = null;
+ private VisibilityEnum visibility = null;
@SerializedName("website")
private String website = null;
@@ -471,22 +525,26 @@ public class User implements Serializable {
this.starredReposCount = starredReposCount;
}
- public User visibility(String visibility) {
+ public User visibility(VisibilityEnum visibility) {
this.visibility = visibility;
return this;
}
/**
- * User visibility level option: public, limited, private
+ * User visibility level option: public, limited, private public UserVisibilityPublic limited
+ * UserVisibilityLimited private UserVisibilityPrivate
*
* @return visibility
*/
- @Schema(description = "User visibility level option: public, limited, private")
- public String getVisibility() {
+ @Schema(
+ description =
+ "User visibility level option: public, limited, private public UserVisibilityPublic"
+ + " limited UserVisibilityLimited private UserVisibilityPrivate")
+ public VisibilityEnum getVisibility() {
return visibility;
}
- public void setVisibility(String visibility) {
+ public void setVisibility(VisibilityEnum visibility) {
this.visibility = visibility;
}