Commit 1929d5d2 authored by Greg Messner's avatar Greg Messner
Browse files

Initial commit (#122).

parent 3f0c1d09
package org.gitlab4j.api.models;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
public class CommitAction {
public enum Action {
CREATE, DELETE, MOVE, UPDATE;
private static JacksonJsonEnumHelper<Action> enumHelper = new JacksonJsonEnumHelper<>(Action.class);
@JsonCreator
public static Action forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
public enum Encoding {
BASE64, TEXT;
private static JacksonJsonEnumHelper<Encoding> enumHelper = new JacksonJsonEnumHelper<>(Encoding.class);
@JsonCreator
public static Encoding forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
private Action action;
private String filePath;
private String previousPath;
private String content;
private Encoding encoding;
private String lastCommitId;
public Action getAction() {
return action;
}
public void setAction(Action action) {
this.action = action;
}
public CommitAction withAction(Action action) {
this.action = action;
return this;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public CommitAction withFilePath(String filePath) {
this.filePath = filePath;
return this;
}
public String getPreviousPath() {
return previousPath;
}
public void setPreviousPath(String previousPath) {
this.previousPath = previousPath;
}
public CommitAction withPreviousPath(String previousPath) {
this.previousPath = previousPath;
return this;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public CommitAction withContent(String content) {
this.content = content;
return this;
}
public Encoding getEncoding() {
return encoding;
}
public void setEncoding(Encoding encoding) {
this.encoding = encoding;
}
public CommitAction withEncoding(Encoding encoding) {
this.encoding = encoding;
return this;
}
public String getLastCommitId() {
return lastCommitId;
}
public void setLastCommitId(String lastCommitId) {
this.lastCommitId = lastCommitId;
}
public CommitAction withLastCommitId(String lastCommitId) {
this.lastCommitId = lastCommitId;
return this;
}
}
package org.gitlab4j.api.models;
import java.util.List;
public class CommitPayload {
private String branch;
private String commitMessage;
private String startBranch;
private List<CommitAction> actions;
private String authorEmail;
private String authorName;
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public String getCommitMessage() {
return commitMessage;
}
public void setCommitMessage(String commitMessage) {
this.commitMessage = commitMessage;
}
public String getStartBranch() {
return startBranch;
}
public void setStartBranch(String startBranch) {
this.startBranch = startBranch;
}
public List<CommitAction> getActions() {
return actions;
}
public void setActions(List<CommitAction> actions) {
this.actions = actions;
}
public String getAuthorEmail() {
return authorEmail;
}
public void setAuthorEmail(String authorEmail) {
this.authorEmail = authorEmail;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
}
{
"branch": "master",
"commit_message": "some commit message",
"actions": [
{
"action": "create",
"file_path": "foo/bar",
"content": "some content"
},
{
"action": "delete",
"file_path": "foo/bar2"
},
{
"action": "move",
"file_path": "foo/bar3",
"previous_path": "foo/bar4",
"content": "some content"
},
{
"action": "update",
"file_path": "foo/bar5",
"content": "new content"
}
]
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment