diff --git a/docs/AdminApi.md b/docs/AdminApi.md index f6b4f24..8b039b8 100644 --- a/docs/AdminApi.md +++ b/docs/AdminApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://{{AppSubUrl | JSEscape}}/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**adminAddUserBadges**](AdminApi.md#adminAddUserBadges) | **POST** admin/users/{username}/badges | Add a badge to a user [**adminAdoptRepository**](AdminApi.md#adminAdoptRepository) | **POST** admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository [**adminCreateHook**](AdminApi.md#adminCreateHook) | **POST** admin/hooks | Create a hook [**adminCreateOrg**](AdminApi.md#adminCreateOrg) | **POST** admin/users/{username}/orgs | Create an organization @@ -15,6 +16,7 @@ Method | HTTP request | Description [**adminDeleteHook**](AdminApi.md#adminDeleteHook) | **DELETE** admin/hooks/{id} | Delete a hook [**adminDeleteUnadoptedRepository**](AdminApi.md#adminDeleteUnadoptedRepository) | **DELETE** admin/unadopted/{owner}/{repo} | Delete unadopted files [**adminDeleteUser**](AdminApi.md#adminDeleteUser) | **DELETE** admin/users/{username} | Delete a user +[**adminDeleteUserBadges**](AdminApi.md#adminDeleteUserBadges) | **DELETE** admin/users/{username}/badges | Remove a badge from a user [**adminDeleteUserPublicKey**](AdminApi.md#adminDeleteUserPublicKey) | **DELETE** admin/users/{username}/keys/{id} | Delete a user's public key [**adminEditHook**](AdminApi.md#adminEditHook) | **PATCH** admin/hooks/{id} | Update a hook [**adminEditUser**](AdminApi.md#adminEditUser) | **PATCH** admin/users/{username} | Edit an existing user @@ -23,11 +25,101 @@ Method | HTTP request | Description [**adminGetHook**](AdminApi.md#adminGetHook) | **GET** admin/hooks/{id} | Get a hook [**adminGetRunnerRegistrationToken**](AdminApi.md#adminGetRunnerRegistrationToken) | **GET** admin/runners/registration-token | Get an global actions runner registration token [**adminListHooks**](AdminApi.md#adminListHooks) | **GET** admin/hooks | List system's webhooks +[**adminListUserBadges**](AdminApi.md#adminListUserBadges) | **GET** admin/users/{username}/badges | List a user's badges [**adminRenameUser**](AdminApi.md#adminRenameUser) | **POST** admin/users/{username}/rename | Rename a user [**adminSearchEmails**](AdminApi.md#adminSearchEmails) | **GET** admin/emails/search | Search all emails [**adminSearchUsers**](AdminApi.md#adminSearchUsers) | **GET** admin/users | Search users according filter conditions [**adminUnadoptedList**](AdminApi.md#adminUnadoptedList) | **GET** admin/unadopted | List unadopted repositories + +# **adminAddUserBadges** +> Void adminAddUserBadges(username, body) + +Add a badge to a user + +### Example +```java +// Import classes: +//import org.gitnex.tea4j.v2.ApiClient; +//import org.gitnex.tea4j.v2.ApiException; +//import org.gitnex.tea4j.v2.Configuration; +//import org.gitnex.tea4j.v2.auth.*; +//import org.gitnex.tea4j.v2.apis.AdminApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: AccessToken +ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken"); +AccessToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AccessToken.setApiKeyPrefix("Token"); + +// Configure API key authorization: AuthorizationHeaderToken +ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken"); +AuthorizationHeaderToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AuthorizationHeaderToken.setApiKeyPrefix("Token"); +// Configure HTTP basic authorization: BasicAuth +HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); +BasicAuth.setUsername("YOUR USERNAME"); +BasicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: SudoHeader +ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader"); +SudoHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: SudoParam +ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam"); +SudoParam.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoParam.setApiKeyPrefix("Token"); + +// Configure API key authorization: TOTPHeader +ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader"); +TOTPHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//TOTPHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: Token +ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token"); +Token.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Token.setApiKeyPrefix("Token"); + +AdminApi apiInstance = new AdminApi(); +String username = "username_example"; // String | username of user +UserBadgeOption body = new UserBadgeOption(); // UserBadgeOption | +try { + Void result = apiInstance.adminAddUserBadges(username, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AdminApi#adminAddUserBadges"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user | + **body** | [**UserBadgeOption**](UserBadgeOption.md)| | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **adminAdoptRepository** > Void adminAdoptRepository(owner, repo) @@ -999,6 +1091,95 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: Not defined + +# **adminDeleteUserBadges** +> Void adminDeleteUserBadges(username, body) + +Remove a badge from a user + +### Example +```java +// Import classes: +//import org.gitnex.tea4j.v2.ApiClient; +//import org.gitnex.tea4j.v2.ApiException; +//import org.gitnex.tea4j.v2.Configuration; +//import org.gitnex.tea4j.v2.auth.*; +//import org.gitnex.tea4j.v2.apis.AdminApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: AccessToken +ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken"); +AccessToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AccessToken.setApiKeyPrefix("Token"); + +// Configure API key authorization: AuthorizationHeaderToken +ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken"); +AuthorizationHeaderToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AuthorizationHeaderToken.setApiKeyPrefix("Token"); +// Configure HTTP basic authorization: BasicAuth +HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); +BasicAuth.setUsername("YOUR USERNAME"); +BasicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: SudoHeader +ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader"); +SudoHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: SudoParam +ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam"); +SudoParam.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoParam.setApiKeyPrefix("Token"); + +// Configure API key authorization: TOTPHeader +ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader"); +TOTPHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//TOTPHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: Token +ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token"); +Token.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Token.setApiKeyPrefix("Token"); + +AdminApi apiInstance = new AdminApi(); +String username = "username_example"; // String | username of user +UserBadgeOption body = new UserBadgeOption(); // UserBadgeOption | +try { + Void result = apiInstance.adminDeleteUserBadges(username, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AdminApi#adminDeleteUserBadges"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user | + **body** | [**UserBadgeOption**](UserBadgeOption.md)| | [optional] + +### Return type + +[**Void**](.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: application/json, text/plain + - **Accept**: Not defined + # **adminDeleteUserPublicKey** > Void adminDeleteUserPublicKey(username, id) @@ -1698,6 +1879,93 @@ Name | Type | Description | Notes [AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **adminListUserBadges** +> List<Badge> adminListUserBadges(username) + +List a user's badges + +### Example +```java +// Import classes: +//import org.gitnex.tea4j.v2.ApiClient; +//import org.gitnex.tea4j.v2.ApiException; +//import org.gitnex.tea4j.v2.Configuration; +//import org.gitnex.tea4j.v2.auth.*; +//import org.gitnex.tea4j.v2.apis.AdminApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: AccessToken +ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken"); +AccessToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AccessToken.setApiKeyPrefix("Token"); + +// Configure API key authorization: AuthorizationHeaderToken +ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken"); +AuthorizationHeaderToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AuthorizationHeaderToken.setApiKeyPrefix("Token"); +// Configure HTTP basic authorization: BasicAuth +HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); +BasicAuth.setUsername("YOUR USERNAME"); +BasicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: SudoHeader +ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader"); +SudoHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: SudoParam +ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam"); +SudoParam.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoParam.setApiKeyPrefix("Token"); + +// Configure API key authorization: TOTPHeader +ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader"); +TOTPHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//TOTPHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: Token +ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token"); +Token.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Token.setApiKeyPrefix("Token"); + +AdminApi apiInstance = new AdminApi(); +String username = "username_example"; // String | username of user +try { + List result = apiInstance.adminListUserBadges(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AdminApi#adminListUserBadges"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of user | + +### Return type + +[**List<Badge>**](Badge.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + ### HTTP request headers - **Content-Type**: Not defined diff --git a/docs/Badge.md b/docs/Badge.md new file mode 100644 index 0000000..3c645b3 --- /dev/null +++ b/docs/Badge.md @@ -0,0 +1,9 @@ +# Badge + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **String** | | [optional] +**id** | **Long** | | [optional] +**imageUrl** | **String** | | [optional] +**slug** | **String** | | [optional] diff --git a/docs/BadgeList.md b/docs/BadgeList.md new file mode 100644 index 0000000..c7c3bc5 --- /dev/null +++ b/docs/BadgeList.md @@ -0,0 +1,6 @@ +# BadgeList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | [**List<Badge>**](Badge.md) | in:body | [optional] diff --git a/docs/UserBadgeOption.md b/docs/UserBadgeOption.md new file mode 100644 index 0000000..dd44072 --- /dev/null +++ b/docs/UserBadgeOption.md @@ -0,0 +1,6 @@ +# UserBadgeOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**badgeSlugs** | **List<String>** | | [optional] diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java index 344fd5c..5ee874a 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java @@ -2,6 +2,7 @@ package org.gitnex.tea4j.v2.apis; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.Badge; import org.gitnex.tea4j.v2.models.CreateHookOption; import org.gitnex.tea4j.v2.models.CreateKeyOption; import org.gitnex.tea4j.v2.models.CreateOrgOption; @@ -17,10 +18,23 @@ import org.gitnex.tea4j.v2.models.PublicKey; import org.gitnex.tea4j.v2.models.RenameUserOption; import org.gitnex.tea4j.v2.models.Repository; import org.gitnex.tea4j.v2.models.User; +import org.gitnex.tea4j.v2.models.UserBadgeOption; import retrofit2.Call; import retrofit2.http.*; public interface AdminApi { + /** + * Add a badge to a user + * + * @param username username of user (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @POST("admin/users/{username}/badges") + Call adminAddUserBadges( + @retrofit2.http.Path("username") String username, @retrofit2.http.Body UserBadgeOption body); + /** * Adopt unadopted files as a repository * @@ -140,6 +154,18 @@ public interface AdminApi { @retrofit2.http.Path("username") String username, @retrofit2.http.Query("purge") Boolean purge); + /** + * Remove a badge from a user + * + * @param username username of user (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @DELETE("admin/users/{username}/badges") + Call adminDeleteUserBadges( + @retrofit2.http.Path("username") String username, @retrofit2.http.Body UserBadgeOption body); + /** * Delete a user's public key * @@ -225,6 +251,15 @@ public interface AdminApi { Call> adminListHooks( @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); + /** + * List a user's badges + * + * @param username username of user (required) + * @return Call<List<Badge>> + */ + @GET("admin/users/{username}/badges") + Call> adminListUserBadges(@retrofit2.http.Path("username") String username); + /** * Rename a user * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Badge.java b/src/main/java/org/gitnex/tea4j/v2/models/Badge.java new file mode 100644 index 0000000..9ddcda0 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/Badge.java @@ -0,0 +1,155 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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.Objects; + +/** Badge represents a user badge */ +@Schema(description = "Badge represents a user badge") +public class Badge implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("description") + private String description = null; + + @SerializedName("id") + private Long id = null; + + @SerializedName("image_url") + private String imageUrl = null; + + @SerializedName("slug") + private String slug = null; + + public Badge description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * + * @return description + */ + @Schema(description = "") + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Badge id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @Schema(description = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Badge imageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl + */ + @Schema(description = "") + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public Badge slug(String slug) { + this.slug = slug; + return this; + } + + /** + * Get slug + * + * @return slug + */ + @Schema(description = "") + public String getSlug() { + return slug; + } + + public void setSlug(String slug) { + this.slug = slug; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Badge badge = (Badge) o; + return Objects.equals(this.description, badge.description) + && Objects.equals(this.id, badge.id) + && Objects.equals(this.imageUrl, badge.imageUrl) + && Objects.equals(this.slug, badge.slug); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, imageUrl, slug); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Badge {\n"); + + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" slug: ").append(toIndentedString(slug)).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/BadgeList.java b/src/main/java/org/gitnex/tea4j/v2/models/BadgeList.java new file mode 100644 index 0000000..afc3378 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/BadgeList.java @@ -0,0 +1,93 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** BadgeList */ +@Schema(description = "BadgeList") +public class BadgeList implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("body") + private List body = null; + + public BadgeList body(List body) { + this.body = body; + return this; + } + + public BadgeList addBodyItem(Badge bodyItem) { + if (this.body == null) { + this.body = new ArrayList<>(); + } + this.body.add(bodyItem); + return this; + } + + /** + * in:body + * + * @return body + */ + @Schema(description = "in:body") + public List getBody() { + return body; + } + + public void setBody(List body) { + this.body = body; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BadgeList badgeList = (BadgeList) o; + return Objects.equals(this.body, badgeList.body); + } + + @Override + public int hashCode() { + return Objects.hash(body); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BadgeList {\n"); + + sb.append(" body: ").append(toIndentedString(body)).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/UserBadgeOption.java b/src/main/java/org/gitnex/tea4j/v2/models/UserBadgeOption.java new file mode 100644 index 0000000..26ca994 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/UserBadgeOption.java @@ -0,0 +1,93 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** UserBadgeOption options for link between users and badges */ +@Schema(description = "UserBadgeOption options for link between users and badges") +public class UserBadgeOption implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("badge_slugs") + private List badgeSlugs = null; + + public UserBadgeOption badgeSlugs(List badgeSlugs) { + this.badgeSlugs = badgeSlugs; + return this; + } + + public UserBadgeOption addBadgeSlugsItem(String badgeSlugsItem) { + if (this.badgeSlugs == null) { + this.badgeSlugs = new ArrayList<>(); + } + this.badgeSlugs.add(badgeSlugsItem); + return this; + } + + /** + * Get badgeSlugs + * + * @return badgeSlugs + */ + @Schema(example = "[\"badge1\",\"badge2\"]", description = "") + public List getBadgeSlugs() { + return badgeSlugs; + } + + public void setBadgeSlugs(List badgeSlugs) { + this.badgeSlugs = badgeSlugs; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserBadgeOption userBadgeOption = (UserBadgeOption) o; + return Objects.equals(this.badgeSlugs, userBadgeOption.badgeSlugs); + } + + @Override + public int hashCode() { + return Objects.hash(badgeSlugs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserBadgeOption {\n"); + + sb.append(" badgeSlugs: ").append(toIndentedString(badgeSlugs)).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 "); + } +}