Commit beeea2e9 authored by Greg Messner's avatar Greg Messner
Browse files

Initial check-in.

parent 7ab57d1c
package org.gitlab4j.api.webhook;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.User;
@XmlAccessorType(XmlAccessType.FIELD)
public class BuildEvent implements Event {
public static final String X_GITLAB_EVENT = "Build Hook";
public static final String OBJECT_KIND = "build";
private String ref;
private Boolean tag;
private String beforeSha;
private String sha;
private Integer buildId;
private String buildName;
private String buildStage;
private String buildStatus;
private Date buildStarted_at;
private Date buildFinished_at;
private Integer buildDuration;
private Boolean buildAllowFailure;
private Integer projectId;
private String projectName;
private User user;
private BuildEventCommit commit;
private EventRepository repository;
public String getObjectKind() {
return (OBJECT_KIND);
}
public void setObjectKind(String objectKind) {
if (!OBJECT_KIND.equals(objectKind))
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
}
public String getRef() {
return ref;
}
public void setRef(String ref) {
this.ref = ref;
}
public Boolean getTag() {
return tag;
}
public void setTag(Boolean tag) {
this.tag = tag;
}
public String getBeforeSha() {
return beforeSha;
}
public void setBeforeSha(String beforeSha) {
this.beforeSha = beforeSha;
}
public String getSha() {
return sha;
}
public void setSha(String sha) {
this.sha = sha;
}
public Integer getBuildId() {
return buildId;
}
public void setBuildId(Integer buildId) {
this.buildId = buildId;
}
public String getBuildName() {
return buildName;
}
public void setBuildName(String buildName) {
this.buildName = buildName;
}
public String getBuildStage() {
return buildStage;
}
public void setBuildStage(String buildStage) {
this.buildStage = buildStage;
}
public String getBuildStatus() {
return buildStatus;
}
public void setBuildStatus(String buildStatus) {
this.buildStatus = buildStatus;
}
public Date getBuildStarted_at() {
return buildStarted_at;
}
public void setBuildStarted_at(Date buildStarted_at) {
this.buildStarted_at = buildStarted_at;
}
public Date getBuildFinished_at() {
return buildFinished_at;
}
public void setBuildFinished_at(Date buildFinished_at) {
this.buildFinished_at = buildFinished_at;
}
public Integer getBuildDuration() {
return buildDuration;
}
public void setBuildDuration(Integer buildDuration) {
this.buildDuration = buildDuration;
}
public Boolean getBuildAllowFailure() {
return buildAllowFailure;
}
public void setBuildAllowFailure(Boolean buildAllowFailure) {
this.buildAllowFailure = buildAllowFailure;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public BuildEventCommit getCommit() {
return commit;
}
public void setCommit(BuildEventCommit commit) {
this.commit = commit;
}
public EventRepository getRepository() {
return repository;
}
public void setRepository(EventRepository repository) {
this.repository = repository;
}
}
package org.gitlab4j.api.webhook;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType(XmlAccessType.FIELD)
public class BuildEventCommit {
private Integer id;
private String sha;
private String message;
private String authorName;
private String authorEmail;
private String status;
private Integer duration;
private Date startedAt;
private Date finishedAt;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSha() {
return sha;
}
public void setSha(String sha) {
this.sha = sha;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getAuthorEmail() {
return authorEmail;
}
public void setAuthorEmail(String authorEmail) {
this.authorEmail = authorEmail;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Date getStartedAt() {
return startedAt;
}
public void setStartedAt(Date startedAt) {
this.startedAt = startedAt;
}
public Date getFinishedAt() {
return finishedAt;
}
public void setFinishedAt(Date finishedAt) {
this.finishedAt = finishedAt;
}
}
package org.gitlab4j.api.webhook;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.User;
@XmlAccessorType(XmlAccessType.FIELD)
public class PipelineEvent implements Event {
public static final String X_GITLAB_EVENT = "Pipeline Hook";
public static final String OBJECT_KIND = "pipeline";
private ObjectAttributes objectAttributes;
private User user;
private EventProject project;
private EventCommit commit;
private List<Build> builds;
public String getObjectKind() {
return (OBJECT_KIND);
}
public void setObjectKind(String objectKind) {
if (!OBJECT_KIND.equals(objectKind))
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
}
public ObjectAttributes getObjectAttributes() {
return this.objectAttributes;
}
public void setObjectAttributes(ObjectAttributes objectAttributes) {
this.objectAttributes = objectAttributes;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public EventProject getProject() {
return project;
}
public void setProject(EventProject project) {
this.project = project;
}
public EventCommit getCommit() {
return commit;
}
public void setCommit(EventCommit commit) {
this.commit = commit;
}
public List<Build> getBuilds() {
return builds;
}
public void setBuilds(List<Build> builds) {
this.builds = builds;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class Build {
private Integer id;
private String stage;
private String name;
private String status;
private Date createdAt;
private Date startedAt;
private Date finishedAt;
private String when;
private Boolean manual;
private User user;
private ArtifactsFile artifactsFile;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getStage() {
return stage;
}
public void setStage(String stage) {
this.stage = stage;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getStartedAt() {
return startedAt;
}
public void setStartedAt(Date startedAt) {
this.startedAt = startedAt;
}
public Date getFinishedAt() {
return finishedAt;
}
public void setFinishedAt(Date finishedAt) {
this.finishedAt = finishedAt;
}
public String getWhen() {
return when;
}
public void setWhen(String when) {
this.when = when;
}
public Boolean getManual() {
return manual;
}
public void setManual(Boolean manual) {
this.manual = manual;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public ArtifactsFile getArtifactsFile() {
return artifactsFile;
}
public void setArtifactsFile(ArtifactsFile artifactsFile) {
this.artifactsFile = artifactsFile;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class ArtifactsFile {
private String file;
private Long size;
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
public Long getSize() {
return size;
}
public void setSize(Long size) {
this.size = size;
}
}
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class ObjectAttributes {
private Integer id;
private String ref;
private Boolean tag;
private String sha;
private String beforeSha;
private String status;
private List<String> stages;
private Date createdAt;
private Date finishedAt;
private Integer duration;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getRef() {
return ref;
}
public void setRef(String ref) {
this.ref = ref;
}
public Boolean getTag() {
return tag;
}
public void setTag(Boolean tag) {
this.tag = tag;
}
public String getSha() {
return sha;
}
public void setSha(String sha) {
this.sha = sha;
}
public String getBeforeSha() {
return beforeSha;
}
public void setBeforeSha(String beforeSha) {
this.beforeSha = beforeSha;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<String> getStages() {
return stages;
}
public void setStages(List<String> stages) {
this.stages = stages;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getFinishedAt() {
return finishedAt;
}
public void setFinishedAt(Date finishedAt) {
this.finishedAt = finishedAt;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
}
}
package org.gitlab4j.api.webhook;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.models.User;
@XmlAccessorType(XmlAccessType.FIELD)
public class WikiPageEvent implements Event {
public static final String X_GITLAB_EVENT = "Wiki Page Hook";
public static final String OBJECT_KIND = "wiki_page";
private User user;
private EventProject project;
private Wiki wiki;
private ObjectAttributes objectAttributes;
public String getObjectKind() {
return (OBJECT_KIND);
}
public void setObjectKind(String objectKind) {
if (!OBJECT_KIND.equals(objectKind))
throw new RuntimeException("Invalid object_kind (" + objectKind + "), must be '" + OBJECT_KIND + "'");
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public EventProject getProject() {
return project;
}
public void setProject(EventProject project) {
this.project = project;
}
public Wiki getWiki() {
return wiki;
}
public void setWiki(Wiki wiki) {
this.wiki = wiki;
}
public ObjectAttributes getObjectAttributes() {
return this.objectAttributes;
}
public void setObjectAttributes(ObjectAttributes objectAttributes) {
this.objectAttributes = objectAttributes;
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class Wiki {
private String webUrl;
private String git_http_url;
private String git_ssh_url;
private String pathWithNamespace;
private String defaultBranch;
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
public String getGit_http_url() {
return git_http_url;
}
public void setGit_http_url(String git_http_url) {
this.git_http_url = git_http_url;
}
public String getGit_ssh_url() {
return git_ssh_url;
}
public void setGit_ssh_url(String git_ssh_url) {
this.git_ssh_url = git_ssh_url;
}
public String getPathWithNamespace() {
return pathWithNamespace;
}
public void setPathWithNamespace(String pathWithNamespace) {
this.pathWithNamespace = pathWithNamespace;
}
public String getDefaultBranch() {
return defaultBranch;
}
public void setDefaultBranch(String defaultBranch) {
this.defaultBranch = defaultBranch;
}
}
@XmlAccessorType(XmlAccessType.FIELD)
public static class ObjectAttributes {
private String title;
private String content;
private String format;
private String message;
private String slug;
private String url;
private String action;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getSlug() {
return slug;
}
public void setSlug(String slug) {
this.slug = slug;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
}
{
"object_kind": "build",
"ref": "gitlab-script-trigger",
"tag": false,
"before_sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
"sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
"build_id": 1977,
"build_name": "test",
"build_stage": "test",
"build_status": "created",
"build_allow_failure": false,
"project_id": 380,
"project_name": "gitlab-org/gitlab-test",
"user": {
"id": 3,
"name": "User",
"email": "user@gitlab.com"
},
"commit": {
"id": 2366,
"sha": "2293ada6b400935a1378653304eaf6221e0fdb8f",
"message": "test\n",
"author_name": "User",
"author_email": "user@gitlab.com",
"status": "created"
},
"repository": {
"name": "gitlab_test",
"git_ssh_url": "git@192.168.64.1:gitlab-org/gitlab-test.git",
"description": "Atque in sunt eos similique dolores voluptatem.",
"homepage": "http://192.168.64.1:3005/gitlab-org/gitlab-test",
"git_ssh_url": "git@192.168.64.1:gitlab-org/gitlab-test.git",
"git_http_url": "http://192.168.64.1:3005/gitlab-org/gitlab-test.git",
"visibility_level": 20
}
}
\ No newline at end of file
{
"object_kind": "pipeline",
"object_attributes":{
"id": 31,
"ref": "master",
"tag": false,
"sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
"before_sha": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
"status": "success",
"stages":[
"build",
"test",
"deploy"
],
"created_at": "2016-08-12T15:23:28Z",
"finished_at": "2016-08-12T15:26:29Z",
"duration": 63
},
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"project":{
"name": "Gitlab Test",
"description": "Atque in sunt eos similique dolores voluptatem.",
"web_url": "http://192.168.64.1:3005/gitlab-org/gitlab-test",
"git_ssh_url": "git@192.168.64.1:gitlab-org/gitlab-test.git",
"git_http_url": "http://192.168.64.1:3005/gitlab-org/gitlab-test.git",
"namespace": "Gitlab Org",
"visibility_level": 20,
"path_with_namespace": "gitlab-org/gitlab-test",
"default_branch": "master"
},
"commit":{
"id": "bcbb5ec396a2c0f828686f14fac9b80b780504f2",
"message": "test\n",
"timestamp": "2016-08-12T17:23:21Z",
"url": "http://example.com/gitlab-org/gitlab-test/commit/bcbb5ec396a2c0f828686f14fac9b80b780504f2",
"author":{
"name": "User",
"email": "user@gitlab.com"
}
},
"builds":[
{
"id": 380,
"stage": "deploy",
"name": "production",
"status": "skipped",
"created_at": "2016-08-12T15:23:28Z",
"when": "manual",
"manual": true,
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"artifacts_file":{
}
},
{
"id": 377,
"stage": "test",
"name": "test-image",
"status": "success",
"created_at": "2016-08-12T15:23:28Z",
"started_at": "2016-08-12T15:26:12Z",
"when": "on_success",
"manual": false,
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"artifacts_file":{
}
},
{
"id": 378,
"stage": "test",
"name": "test-build",
"status": "success",
"created_at": "2016-08-12T15:23:28Z",
"started_at": "2016-08-12T15:26:12Z",
"finished_at": "2016-08-12T15:26:29Z",
"when": "on_success",
"manual": false,
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"artifacts_file":{
}
},
{
"id": 376,
"stage": "build",
"name": "build-image",
"status": "success",
"created_at": "2016-08-12T15:23:28Z",
"started_at": "2016-08-12T15:24:56Z",
"finished_at": "2016-08-12T15:25:26Z",
"when": "on_success",
"manual": false,
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"artifacts_file":{
}
},
{
"id": 379,
"stage": "deploy",
"name": "staging",
"status": "created",
"created_at": "2016-08-12T15:23:28Z",
"when": "on_success",
"manual": false,
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"artifacts_file":{
}
}
]
}
\ No newline at end of file
{
"object_kind": "wiki_page",
"user": {
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon"
},
"project": {
"name": "awesome-project",
"description": "This is awesome",
"web_url": "http://example.com/root/awesome-project",
"git_ssh_url": "git@example.com:root/awesome-project.git",
"git_http_url": "http://example.com/root/awesome-project.git",
"namespace": "root",
"visibility_level": 0,
"path_with_namespace": "root/awesome-project",
"default_branch": "master",
"homepage": "http://example.com/root/awesome-project",
"url": "git@example.com:root/awesome-project.git",
"ssh_url": "git@example.com:root/awesome-project.git",
"http_url": "http://example.com/root/awesome-project.git"
},
"wiki": {
"web_url": "http://example.com/root/awesome-project/wikis/home",
"git_ssh_url": "git@example.com:root/awesome-project.wiki.git",
"git_http_url": "http://example.com/root/awesome-project.wiki.git",
"path_with_namespace": "root/awesome-project.wiki",
"default_branch": "master"
},
"object_attributes": {
"title": "Awesome",
"content": "awesome content goes here",
"format": "markdown",
"message": "adding an awesome page to the wiki",
"slug": "awesome",
"url": "http://example.com/root/awesome-project/wikis/awesome",
"action": "create"
}
}
\ 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