303 lines
8.0 KiB
Java
303 lines
8.0 KiB
Java
/*
|
|
* Gitea API
|
|
* This documentation describes the Gitea API.
|
|
*
|
|
* OpenAPI spec version: 1.21.1
|
|
*
|
|
*
|
|
* 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 io.gitea.model;
|
|
|
|
import java.util.Objects;
|
|
import java.util.Arrays;
|
|
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.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* CreateTeamOption options for creating a team
|
|
*/
|
|
@ApiModel(description = "CreateTeamOption options for creating a team")
|
|
|
|
public class CreateTeamOption {
|
|
@SerializedName("can_create_org_repo")
|
|
private Boolean canCreateOrgRepo = null;
|
|
|
|
@SerializedName("description")
|
|
private String description = null;
|
|
|
|
@SerializedName("includes_all_repositories")
|
|
private Boolean includesAllRepositories = null;
|
|
|
|
@SerializedName("name")
|
|
private String name = null;
|
|
|
|
/**
|
|
* Gets or Sets permission
|
|
*/
|
|
@JsonAdapter(PermissionEnum.Adapter.class)
|
|
public enum PermissionEnum {
|
|
READ("read"),
|
|
|
|
WRITE("write"),
|
|
|
|
ADMIN("admin");
|
|
|
|
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 text) {
|
|
for (PermissionEnum b : PermissionEnum.values()) {
|
|
if (String.valueOf(b.value).equals(text)) {
|
|
return b;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static class Adapter extends TypeAdapter<PermissionEnum> {
|
|
@Override
|
|
public void write(final JsonWriter jsonWriter, final PermissionEnum enumeration) throws IOException {
|
|
jsonWriter.value(enumeration.getValue());
|
|
}
|
|
|
|
@Override
|
|
public PermissionEnum read(final JsonReader jsonReader) throws IOException {
|
|
String value = jsonReader.nextString();
|
|
return PermissionEnum.fromValue(String.valueOf(value));
|
|
}
|
|
}
|
|
}
|
|
|
|
@SerializedName("permission")
|
|
private PermissionEnum permission = null;
|
|
|
|
@SerializedName("units")
|
|
private List<String> units = null;
|
|
|
|
@SerializedName("units_map")
|
|
private Map<String, String> unitsMap = null;
|
|
|
|
public CreateTeamOption canCreateOrgRepo(Boolean canCreateOrgRepo) {
|
|
this.canCreateOrgRepo = canCreateOrgRepo;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get canCreateOrgRepo
|
|
* @return canCreateOrgRepo
|
|
**/
|
|
@ApiModelProperty(value = "")
|
|
public Boolean isCanCreateOrgRepo() {
|
|
return canCreateOrgRepo;
|
|
}
|
|
|
|
public void setCanCreateOrgRepo(Boolean canCreateOrgRepo) {
|
|
this.canCreateOrgRepo = canCreateOrgRepo;
|
|
}
|
|
|
|
public CreateTeamOption description(String description) {
|
|
this.description = description;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get description
|
|
* @return description
|
|
**/
|
|
@ApiModelProperty(value = "")
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public CreateTeamOption includesAllRepositories(Boolean includesAllRepositories) {
|
|
this.includesAllRepositories = includesAllRepositories;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get includesAllRepositories
|
|
* @return includesAllRepositories
|
|
**/
|
|
@ApiModelProperty(value = "")
|
|
public Boolean isIncludesAllRepositories() {
|
|
return includesAllRepositories;
|
|
}
|
|
|
|
public void setIncludesAllRepositories(Boolean includesAllRepositories) {
|
|
this.includesAllRepositories = includesAllRepositories;
|
|
}
|
|
|
|
public CreateTeamOption name(String name) {
|
|
this.name = name;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get name
|
|
* @return name
|
|
**/
|
|
@ApiModelProperty(required = true, value = "")
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public CreateTeamOption permission(PermissionEnum permission) {
|
|
this.permission = permission;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get permission
|
|
* @return permission
|
|
**/
|
|
@ApiModelProperty(value = "")
|
|
public PermissionEnum getPermission() {
|
|
return permission;
|
|
}
|
|
|
|
public void setPermission(PermissionEnum permission) {
|
|
this.permission = permission;
|
|
}
|
|
|
|
public CreateTeamOption units(List<String> units) {
|
|
this.units = units;
|
|
return this;
|
|
}
|
|
|
|
public CreateTeamOption addUnitsItem(String unitsItem) {
|
|
if (this.units == null) {
|
|
this.units = new ArrayList<String>();
|
|
}
|
|
this.units.add(unitsItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get units
|
|
* @return units
|
|
**/
|
|
@ApiModelProperty(example = "[\"repo.actions\",\"repo.code\",\"repo.issues\",\"repo.ext_issues\",\"repo.wiki\",\"repo.ext_wiki\",\"repo.pulls\",\"repo.releases\",\"repo.projects\",\"repo.ext_wiki\"]", value = "")
|
|
public List<String> getUnits() {
|
|
return units;
|
|
}
|
|
|
|
public void setUnits(List<String> units) {
|
|
this.units = units;
|
|
}
|
|
|
|
public CreateTeamOption unitsMap(Map<String, String> unitsMap) {
|
|
this.unitsMap = unitsMap;
|
|
return this;
|
|
}
|
|
|
|
public CreateTeamOption putUnitsMapItem(String key, String unitsMapItem) {
|
|
if (this.unitsMap == null) {
|
|
this.unitsMap = new HashMap<String, String>();
|
|
}
|
|
this.unitsMap.put(key, unitsMapItem);
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* Get unitsMap
|
|
* @return unitsMap
|
|
**/
|
|
@ApiModelProperty(example = "\"{\\\"repo.actions\\\",\\\"repo.packages\\\",\\\"repo.code\\\":\\\"read\\\",\\\"repo.issues\\\":\\\"write\\\",\\\"repo.ext_issues\\\":\\\"none\\\",\\\"repo.wiki\\\":\\\"admin\\\",\\\"repo.pulls\\\":\\\"owner\\\",\\\"repo.releases\\\":\\\"none\\\",\\\"repo.projects\\\":\\\"none\\\",\\\"repo.ext_wiki\\\":\\\"none\\\"}\"", value = "")
|
|
public Map<String, String> getUnitsMap() {
|
|
return unitsMap;
|
|
}
|
|
|
|
public void setUnitsMap(Map<String, String> unitsMap) {
|
|
this.unitsMap = unitsMap;
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean equals(java.lang.Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
CreateTeamOption createTeamOption = (CreateTeamOption) o;
|
|
return Objects.equals(this.canCreateOrgRepo, createTeamOption.canCreateOrgRepo) &&
|
|
Objects.equals(this.description, createTeamOption.description) &&
|
|
Objects.equals(this.includesAllRepositories, createTeamOption.includesAllRepositories) &&
|
|
Objects.equals(this.name, createTeamOption.name) &&
|
|
Objects.equals(this.permission, createTeamOption.permission) &&
|
|
Objects.equals(this.units, createTeamOption.units) &&
|
|
Objects.equals(this.unitsMap, createTeamOption.unitsMap);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(canCreateOrgRepo, description, includesAllRepositories, name, permission, units, unitsMap);
|
|
}
|
|
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class CreateTeamOption {\n");
|
|
|
|
sb.append(" canCreateOrgRepo: ").append(toIndentedString(canCreateOrgRepo)).append("\n");
|
|
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
|
sb.append(" includesAllRepositories: ").append(toIndentedString(includesAllRepositories)).append("\n");
|
|
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
|
sb.append(" permission: ").append(toIndentedString(permission)).append("\n");
|
|
sb.append(" units: ").append(toIndentedString(units)).append("\n");
|
|
sb.append(" unitsMap: ").append(toIndentedString(unitsMap)).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 ");
|
|
}
|
|
|
|
}
|
|
|