Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
1929d5d2
Commit
1929d5d2
authored
Jan 03, 2018
by
Greg Messner
Browse files
Initial commit (#122).
parent
3f0c1d09
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/CommitAction.java
0 → 100644
View file @
1929d5d2
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
;
}
}
src/main/java/org/gitlab4j/api/models/CommitPayload.java
0 → 100644
View file @
1929d5d2
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
;
}
}
src/test/resources/org/gitlab4j/api/commit-payload.json
0 → 100644
View file @
1929d5d2
{
"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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment