Synchronizing API and documentation updates

This commit is contained in:
gitnexbot
2024-06-04 00:05:27 +00:00
parent 67d1fa3921
commit fc4c332613
2 changed files with 114 additions and 7 deletions
@@ -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;
@@ -46,8 +51,78 @@ public class Activity implements Serializable {
@SerializedName("is_private")
private Boolean isPrivate = null;
/** the type of action */
@JsonAdapter(OpTypeEnum.Adapter.class)
public enum OpTypeEnum {
CREATE_REPO("create_repo"),
RENAME_REPO("rename_repo"),
STAR_REPO("star_repo"),
WATCH_REPO("watch_repo"),
COMMIT_REPO("commit_repo"),
CREATE_ISSUE("create_issue"),
CREATE_PULL_REQUEST("create_pull_request"),
TRANSFER_REPO("transfer_repo"),
PUSH_TAG("push_tag"),
COMMENT_ISSUE("comment_issue"),
MERGE_PULL_REQUEST("merge_pull_request"),
CLOSE_ISSUE("close_issue"),
REOPEN_ISSUE("reopen_issue"),
CLOSE_PULL_REQUEST("close_pull_request"),
REOPEN_PULL_REQUEST("reopen_pull_request"),
DELETE_TAG("delete_tag"),
DELETE_BRANCH("delete_branch"),
MIRROR_SYNC_PUSH("mirror_sync_push"),
MIRROR_SYNC_CREATE("mirror_sync_create"),
MIRROR_SYNC_DELETE("mirror_sync_delete"),
APPROVE_PULL_REQUEST("approve_pull_request"),
REJECT_PULL_REQUEST("reject_pull_request"),
COMMENT_PULL("comment_pull"),
PUBLISH_RELEASE("publish_release"),
PULL_REVIEW_DISMISSED("pull_review_dismissed"),
PULL_REQUEST_READY_FOR_REVIEW("pull_request_ready_for_review"),
AUTO_MERGE_PULL_REQUEST("auto_merge_pull_request");
private String value;
OpTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static OpTypeEnum fromValue(String input) {
for (OpTypeEnum b : OpTypeEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<OpTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final OpTypeEnum enumeration)
throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}
@Override
public OpTypeEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return OpTypeEnum.fromValue((String) (value));
}
}
}
@SerializedName("op_type")
private String opType = null;
private OpTypeEnum opType = null;
@SerializedName("ref_name")
private String refName = null;
@@ -213,22 +288,22 @@ public class Activity implements Serializable {
this.isPrivate = isPrivate;
}
public Activity opType(String opType) {
public Activity opType(OpTypeEnum opType) {
this.opType = opType;
return this;
}
/**
* Get opType
* the type of action
*
* @return opType
*/
@Schema(description = "")
public String getOpType() {
@Schema(description = "the type of action")
public OpTypeEnum getOpType() {
return opType;
}
public void setOpType(String opType) {
public void setOpType(OpTypeEnum opType) {
this.opType = opType;
}