237 lines
5.8 KiB
Java
237 lines
5.8 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;
|
|
|
|
/**
|
|
* ChangeFileOperation for creating, updating or deleting a file
|
|
*/
|
|
@ApiModel(description = "ChangeFileOperation for creating, updating or deleting a file")
|
|
|
|
public class ChangeFileOperation {
|
|
@SerializedName("content")
|
|
private String content = null;
|
|
|
|
@SerializedName("from_path")
|
|
private String fromPath = null;
|
|
|
|
/**
|
|
* indicates what to do with the file
|
|
*/
|
|
@JsonAdapter(OperationEnum.Adapter.class)
|
|
public enum OperationEnum {
|
|
CREATE("create"),
|
|
|
|
UPDATE("update"),
|
|
|
|
DELETE("delete");
|
|
|
|
private String value;
|
|
|
|
OperationEnum(String value) {
|
|
this.value = value;
|
|
}
|
|
|
|
public String getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.valueOf(value);
|
|
}
|
|
|
|
public static OperationEnum fromValue(String text) {
|
|
for (OperationEnum b : OperationEnum.values()) {
|
|
if (String.valueOf(b.value).equals(text)) {
|
|
return b;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static class Adapter extends TypeAdapter<OperationEnum> {
|
|
@Override
|
|
public void write(final JsonWriter jsonWriter, final OperationEnum enumeration) throws IOException {
|
|
jsonWriter.value(enumeration.getValue());
|
|
}
|
|
|
|
@Override
|
|
public OperationEnum read(final JsonReader jsonReader) throws IOException {
|
|
String value = jsonReader.nextString();
|
|
return OperationEnum.fromValue(String.valueOf(value));
|
|
}
|
|
}
|
|
}
|
|
|
|
@SerializedName("operation")
|
|
private OperationEnum operation = null;
|
|
|
|
@SerializedName("path")
|
|
private String path = null;
|
|
|
|
@SerializedName("sha")
|
|
private String sha = null;
|
|
|
|
public ChangeFileOperation content(String content) {
|
|
this.content = content;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* new or updated file content, must be base64 encoded
|
|
* @return content
|
|
**/
|
|
@ApiModelProperty(value = "new or updated file content, must be base64 encoded")
|
|
public String getContent() {
|
|
return content;
|
|
}
|
|
|
|
public void setContent(String content) {
|
|
this.content = content;
|
|
}
|
|
|
|
public ChangeFileOperation fromPath(String fromPath) {
|
|
this.fromPath = fromPath;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* old path of the file to move
|
|
* @return fromPath
|
|
**/
|
|
@ApiModelProperty(value = "old path of the file to move")
|
|
public String getFromPath() {
|
|
return fromPath;
|
|
}
|
|
|
|
public void setFromPath(String fromPath) {
|
|
this.fromPath = fromPath;
|
|
}
|
|
|
|
public ChangeFileOperation operation(OperationEnum operation) {
|
|
this.operation = operation;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* indicates what to do with the file
|
|
* @return operation
|
|
**/
|
|
@ApiModelProperty(required = true, value = "indicates what to do with the file")
|
|
public OperationEnum getOperation() {
|
|
return operation;
|
|
}
|
|
|
|
public void setOperation(OperationEnum operation) {
|
|
this.operation = operation;
|
|
}
|
|
|
|
public ChangeFileOperation path(String path) {
|
|
this.path = path;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* path to the existing or new file
|
|
* @return path
|
|
**/
|
|
@ApiModelProperty(required = true, value = "path to the existing or new file")
|
|
public String getPath() {
|
|
return path;
|
|
}
|
|
|
|
public void setPath(String path) {
|
|
this.path = path;
|
|
}
|
|
|
|
public ChangeFileOperation sha(String sha) {
|
|
this.sha = sha;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
* sha is the SHA for the file that already exists, required for update or delete
|
|
* @return sha
|
|
**/
|
|
@ApiModelProperty(value = "sha is the SHA for the file that already exists, required for update or delete")
|
|
public String getSha() {
|
|
return sha;
|
|
}
|
|
|
|
public void setSha(String sha) {
|
|
this.sha = sha;
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean equals(java.lang.Object o) {
|
|
if (this == o) {
|
|
return true;
|
|
}
|
|
if (o == null || getClass() != o.getClass()) {
|
|
return false;
|
|
}
|
|
ChangeFileOperation changeFileOperation = (ChangeFileOperation) o;
|
|
return Objects.equals(this.content, changeFileOperation.content) &&
|
|
Objects.equals(this.fromPath, changeFileOperation.fromPath) &&
|
|
Objects.equals(this.operation, changeFileOperation.operation) &&
|
|
Objects.equals(this.path, changeFileOperation.path) &&
|
|
Objects.equals(this.sha, changeFileOperation.sha);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(content, fromPath, operation, path, sha);
|
|
}
|
|
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append("class ChangeFileOperation {\n");
|
|
|
|
sb.append(" content: ").append(toIndentedString(content)).append("\n");
|
|
sb.append(" fromPath: ").append(toIndentedString(fromPath)).append("\n");
|
|
sb.append(" operation: ").append(toIndentedString(operation)).append("\n");
|
|
sb.append(" path: ").append(toIndentedString(path)).append("\n");
|
|
sb.append(" sha: ").append(toIndentedString(sha)).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 ");
|
|
}
|
|
|
|
}
|
|
|