diff --git a/src/main/java/com/messners/gitlab/api/ISO8601.java b/src/main/java/com/messners/gitlab/api/ISO8601.java index 538c402675fd89d17ad691efe7f418957f8e89c9..467c36b78d99c6d186421d49a9dfebac00ec9953 100644 --- a/src/main/java/com/messners/gitlab/api/ISO8601.java +++ b/src/main/java/com/messners/gitlab/api/ISO8601.java @@ -11,19 +11,29 @@ import java.util.TimeZone; */ public class ISO8601 { public static final String PATTERN = "yyyy-MM-dd'T'HH:mm:ssZ"; + public static final String PATTERN_MSEC = "yyyy-MM-dd'T'HH:mm:ss.SSSZ"; public static final String OUTPUT_PATTERN = "yyyy-MM-dd'T'HH:mm:ss'Z'"; + public static final String OUTPUT_MSEC_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; public static final String ALTERNATE_PATTERN = "yyyy-MM-dd HH:mm:ss"; private static final SimpleDateFormat iso8601Format; + private static final SimpleDateFormat iso8601MsecFormat; private static final SimpleDateFormat iso8601OutputFormat; + private static final SimpleDateFormat iso8601OutputMsecFormat; private static final SimpleDateFormat iso8601AlternateFormat; static { iso8601Format = new SimpleDateFormat(PATTERN); iso8601Format.setLenient(true); iso8601Format.setTimeZone(TimeZone.getTimeZone("GMT")); + iso8601MsecFormat = new SimpleDateFormat(PATTERN_MSEC); + iso8601MsecFormat.setLenient(true); + iso8601MsecFormat.setTimeZone(TimeZone.getTimeZone("GMT")); iso8601OutputFormat = new SimpleDateFormat(OUTPUT_PATTERN); iso8601OutputFormat.setLenient(true); iso8601OutputFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + iso8601OutputMsecFormat = new SimpleDateFormat(OUTPUT_MSEC_PATTERN); + iso8601OutputMsecFormat.setLenient(true); + iso8601OutputMsecFormat.setTimeZone(TimeZone.getTimeZone("GMT")); iso8601AlternateFormat = new SimpleDateFormat(ALTERNATE_PATTERN); iso8601AlternateFormat.setLenient(true); iso8601AlternateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); @@ -37,6 +47,15 @@ public class ISO8601 { public static String getTimestamp() { return (iso8601Format.format(new Date())); } + + /** + * Get a ISO8601formatted string for the current date and time. + * + * @return a ISO8601 formatted string for the current date and time + */ + public static String getTimestamp(boolean withMsec) { + return (withMsec ? iso8601MsecFormat.format(new Date()) : iso8601Format.format(new Date())); + } /** * Get a ISO8601 formatted string for the provided Calendar instance. @@ -65,7 +84,10 @@ public class ISO8601 { return (null); } - return (iso8601OutputFormat.format(date)); + long time = date.getTime(); + return (time % 1000 != 0 ? + iso8601OutputMsecFormat.format(date) : + iso8601OutputFormat.format(date)); } /** @@ -82,10 +104,16 @@ public class ISO8601 { } dateTimeString = dateTimeString.trim(); - SimpleDateFormat fmt; if (dateTimeString.length() > 10) { - fmt = (dateTimeString.charAt(10) == 'T' ? (dateTimeString.endsWith("Z") ? iso8601OutputFormat : iso8601Format) : iso8601AlternateFormat); + if (dateTimeString.charAt(10) == 'T') { + fmt = (dateTimeString.endsWith("Z") ? (dateTimeString.charAt(dateTimeString.length() - 4) == '.' ? + iso8601OutputMsecFormat : + iso8601OutputFormat) : + iso8601Format); + } else { + fmt = iso8601AlternateFormat; + } } else { fmt = iso8601Format; } diff --git a/src/main/java/com/messners/gitlab/api/JacksonJson.java b/src/main/java/com/messners/gitlab/api/JacksonJson.java index 1f245726d4a5edf163d4e07f302f4287b5b530b6..c64af262dfb38e19493f40dcb12bf2415ff845cf 100644 --- a/src/main/java/com/messners/gitlab/api/JacksonJson.java +++ b/src/main/java/com/messners/gitlab/api/JacksonJson.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; +import com.messners.gitlab.api.models.AccessLevel; /** * Jackson JSON Configuration and utility class. @@ -49,6 +50,7 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol SimpleModule module = new SimpleModule("GitLabApiJsonModule"); module.addSerializer(Date.class, new JsonDateSerializer()); + module.addSerializer(AccessLevel.class, new JsonAccessLevelSerializer()); objectMapper.registerModule(module); } @@ -135,4 +137,16 @@ public class JacksonJson extends JacksonJaxbJsonProvider implements ContextResol gen.writeString(iso8601String); } } + + + /** + * JsonSerializer for serializing AccessLevel values. + */ + public static class JsonAccessLevelSerializer extends JsonSerializer { + + @Override + public void serialize(AccessLevel accessLevel, JsonGenerator gen, SerializerProvider provider) throws IOException, JsonProcessingException { + gen.writeNumber(accessLevel.value); + } + } } \ No newline at end of file diff --git a/src/main/java/com/messners/gitlab/api/MergeRequestApi.java b/src/main/java/com/messners/gitlab/api/MergeRequestApi.java index 05776fe63f799014f8f02e1f5b54daf7f50292c3..4cf0108e87d0de140e4dcaa7dc82d2daeb606572 100644 --- a/src/main/java/com/messners/gitlab/api/MergeRequestApi.java +++ b/src/main/java/com/messners/gitlab/api/MergeRequestApi.java @@ -1,12 +1,12 @@ package com.messners.gitlab.api; -import com.messners.gitlab.api.models.MergeRequest; -import com.messners.gitlab.api.models.MergeRequestComment; +import java.util.List; import javax.ws.rs.core.Form; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.Response; -import java.util.List; + +import com.messners.gitlab.api.models.MergeRequest; /** * This class implements the client side API for the GitLab merge request calls. @@ -127,6 +127,7 @@ public class MergeRequestApi extends AbstractApi { * @return the added merge request comment * @throws GitLabApiException */ + /* public MergeRequestComment addMergeRequestComment(Integer projectId, Integer mergeRequestId, String comments) throws GitLabApiException { Form formData = new Form(); @@ -134,4 +135,5 @@ public class MergeRequestApi extends AbstractApi { Response response = post(Response.Status.OK, formData, "projects", projectId, "merge_request", mergeRequestId, "comments"); return (response.readEntity(MergeRequestComment.class)); } + */ } diff --git a/src/main/java/com/messners/gitlab/api/UserApi.java b/src/main/java/com/messners/gitlab/api/UserApi.java index 05187e821d97d3b1a5755b079913cf0cb0bb5f73..f6858d482ce57acfbae22898329759d8e481cf8f 100644 --- a/src/main/java/com/messners/gitlab/api/UserApi.java +++ b/src/main/java/com/messners/gitlab/api/UserApi.java @@ -179,11 +179,13 @@ public class UserApi extends AbstractApi { addFormParam(form, "twitter", user.getTwitter(), false); addFormParam(form, "website_url", user.getWebsiteUrl(), false); addFormParam(form, "projects_limit", projectsLimit, false); - addFormParam(form, "extern_uid", user.getExternUid(), false); + addFormParam(form, "external", user.getExternal(), false); addFormParam(form, "provider", user.getProvider(), false); addFormParam(form, "bio", user.getBio(), false); + addFormParam(form, "location", user.getLocation(), false); addFormParam(form, "admin", user.getIsAdmin(), false); addFormParam(form, "can_create_group", user.getCanCreateGroup(), false); + addFormParam(form, "external", user.getExternal(), false); return form; } } diff --git a/src/main/java/com/messners/gitlab/api/models/AbstractUser.java b/src/main/java/com/messners/gitlab/api/models/AbstractUser.java index 00e33819685a00971833bc5784862930a7185456..4d038f0c033d8f55a4e45c1b49c83dd15b698715 100644 --- a/src/main/java/com/messners/gitlab/api/models/AbstractUser.java +++ b/src/main/java/com/messners/gitlab/api/models/AbstractUser.java @@ -1,75 +1,264 @@ package com.messners.gitlab.api.models; import java.util.Date; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -@XmlAccessorType (XmlAccessType.FIELD) +@XmlAccessorType(XmlAccessType.FIELD) public class AbstractUser { - private Date createdAt; - - private String email; - private Integer id; - private String name; - private String state; - private String username; - private Boolean blocked; - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getEmail () { - return this.email; - } - - public void setEmail (String email) { - this.email = email; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public String getUsername () { - return this.username; - } - - public void setUsername (String username) { - this.username = username; - } - - public Boolean getBlocked() { - return blocked; - } - - public void setBlocked(Boolean blocked) { - this.blocked = blocked; - } + private String avatarUrl; + private String bio; + private Boolean canCreateGroup; + private Boolean canCreateProject; + private Integer colorSchemeId; + private Date confirmedAt; + private Date createdAt; + private Date currentSignInAt; + private String email; + private Boolean external; + private Integer id; + private List identities; + private Boolean isAdmin; + private Date lastSignInAt; + private String linkedin; + private String location; + private String name; + private String organization; + private Integer projectsLimit; + private String provider; + private String skype; + private String state; + private Integer themeId; + private String twitter; + private Boolean twoFactorEnabled; + private String username; + private String websiteUrl; + private String webUrl; + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public String getBio() { + return bio; + } + + public void setBio(String bio) { + this.bio = bio; + } + + public Boolean getCanCreateGroup() { + return canCreateGroup; + } + + public void setCanCreateGroup(Boolean canCreateGroup) { + this.canCreateGroup = canCreateGroup; + } + + public Boolean getCanCreateProject() { + return canCreateProject; + } + + public void setCanCreateProject(Boolean canCreateProject) { + this.canCreateProject = canCreateProject; + } + + public Integer getColorSchemeId() { + return colorSchemeId; + } + + public void setColorSchemeId(Integer colorSchemeId) { + this.colorSchemeId = colorSchemeId; + } + + public Date getConfirmedAt() { + return confirmedAt; + } + + public void setConfirmedAt(Date confirmedAt) { + this.confirmedAt = confirmedAt; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getCurrentSignInAt() { + return currentSignInAt; + } + + public void setCurrentSignInAt(Date currentSignInAt) { + this.currentSignInAt = currentSignInAt; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Boolean getExternal() { + return external; + } + + public void setExternal(Boolean external) { + this.external = external; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public List getIdentities() { + return identities; + } + + public void setIdentities(List identities) { + this.identities = identities; + } + + public Boolean getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + } + + public Date getLastSignInAt() { + return lastSignInAt; + } + + public void setLastSignInAt(Date lastSignInAt) { + this.lastSignInAt = lastSignInAt; + } + + public String getLinkedin() { + return linkedin; + } + + public void setLinkedin(String linkedin) { + this.linkedin = linkedin; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOrganization() { + return organization; + } + + public void setOrganization(String organization) { + this.organization = organization; + } + + public Integer getProjectsLimit() { + return projectsLimit; + } + + public void setProjectsLimit(Integer projectsLimit) { + this.projectsLimit = projectsLimit; + } + + public String getProvider() { + return provider; + } + + public void setProvider(String provider) { + this.provider = provider; + } + + public String getSkype() { + return skype; + } + + public void setSkype(String skype) { + this.skype = skype; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Integer getThemeId() { + return themeId; + } + + public void setThemeId(Integer themeId) { + this.themeId = themeId; + } + + public String getTwitter() { + return twitter; + } + + public void setTwitter(String twitter) { + this.twitter = twitter; + } + + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; + } + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getWebsiteUrl() { + return websiteUrl; + } + + public void setWebsiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Branch.java b/src/main/java/com/messners/gitlab/api/models/Branch.java index 6e6d2433f7338679a1a8ac5c2a0c3835a38ac68a..ce3328989d70b0e20eae3a95937b07230dd867d6 100644 --- a/src/main/java/com/messners/gitlab/api/models/Branch.java +++ b/src/main/java/com/messners/gitlab/api/models/Branch.java @@ -6,38 +6,65 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -@XmlAccessorType (XmlAccessType.FIELD) +@XmlAccessorType(XmlAccessType.FIELD) public class Branch { - private Commit commit; - private String name; - private Boolean isProtected; - - public Commit getCommit () { - return this.commit; - } - - public void setCommit (Commit commit) { - this.commit = commit; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public Boolean getProtected () { - return this.isProtected; - } - - public void setProtected (Boolean isProtected) { - this.isProtected = isProtected; - } - - public static final boolean isValid (Branch branch) { - return (branch != null && branch.getName() != null); - } + private Commit commit; + private Boolean developersCanMerge; + private Boolean developersCanPush; + private Boolean merged; + private String name; + private Boolean isProtected; + + public Commit getCommit() { + return commit; + } + + public void setCommit(Commit commit) { + this.commit = commit; + } + + public Boolean getDevelopersCanMerge() { + return developersCanMerge; + } + + public void setDevelopersCanMerge(Boolean developersCanMerge) { + this.developersCanMerge = developersCanMerge; + } + + public Boolean getDevelopersCanPush() { + return developersCanPush; + } + + public void setDevelopersCanPush(Boolean developersCanPush) { + this.developersCanPush = developersCanPush; + } + + public Boolean getMerged() { + return merged; + } + + public void setMerged(Boolean merged) { + this.merged = merged; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Boolean getProtected() { + return isProtected; + } + + public void setProtected(Boolean isProtected) { + this.isProtected = isProtected; + } + + public static final boolean isValid(Branch branch) { + return (branch != null && branch.getName() != null); + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Commit.java b/src/main/java/com/messners/gitlab/api/models/Commit.java index ab3ce176428b6fe27cfd6d742132c73091d1b01e..33c61c5ba6ce98831fd2cd336933bedc81088d89 100644 --- a/src/main/java/com/messners/gitlab/api/models/Commit.java +++ b/src/main/java/com/messners/gitlab/api/models/Commit.java @@ -12,116 +12,157 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Commit { - private Author author; - private Date authoredDate; - private Date committedDate; - - private Committer committer; - private String id; - private String message; - - private List parents; - - private String shortId; - private Date timestamp; - - private String title; - private String tree; - private String url; - - public Author getAuthor () { - return this.author; - } - - public void setAuthor (Author author) { - this.author = author; - } - - public Date getAuthored_date () { - return this.authoredDate; - } - - public void setAuthored_date (Date authoredDate) { - this.authoredDate = authoredDate; - } - - public Date getCommitted_date () { - return this.committedDate; - } - - public void setCommitted_date (Date committedDate) { - this.committedDate = committedDate; - } - - public Committer getCommitter () { - return this.committer; - } - - public void setCommitter (Committer committer) { - this.committer = committer; - } - - public String getId () { - return this.id; - } - - public void setId (String id) { - this.id = id; - } - - public String getShortId () { - return this.shortId; - } - - public String getMessage () { - return this.message; - } - - public void setMessage (String message) { - this.message = message; - } - - public List getParents () { - return this.parents; - } - - public void setParents (List parents) { - this.parents = parents; - } - - public void setShort_id (String short_id) { - this.shortId = short_id; - } - - public Date getTimestamp () { - return this.timestamp; - } - - public void setTimestamp (Date timestamp) { - this.timestamp = timestamp; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public String getTree () { - return this.tree; - } - - public void setTree (String tree) { - this.tree = tree; - } - - public String getUrl () { - return this.url; - } - - public void setUrl (String url) { - this.url = url; - } + private Author author; + private Date authoredDate; + private String authorEmail; + private String authorName; + private Date committedDate; + private String committerEmail; + private String committerName; + private Date createdAt; + private String id; + private String message; + private List parentIds; + private String shortId; + private CommitStats stats; + private String status; + private Date timestamp; + private String title; + private String url; + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Date getAuthoredDate() { + return authoredDate; + } + + public void setAuthoredDate(Date authoredDate) { + this.authoredDate = authoredDate; + } + + 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; + } + + public Date getCommittedDate() { + return committedDate; + } + + public void setCommittedDate(Date committedDate) { + this.committedDate = committedDate; + } + + public String getCommitterEmail() { + return committerEmail; + } + + public void setCommitterEmail(String committerEmail) { + this.committerEmail = committerEmail; + } + + public String getCommitterName() { + return committerName; + } + + public void setCommitterName(String committerName) { + this.committerName = committerName; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public List getParentIds() { + return parentIds; + } + + public void setParentIds(List parentIds) { + this.parentIds = parentIds; + } + + public String getShortId() { + return shortId; + } + + public void setShortId(String shortId) { + this.shortId = shortId; + } + + public CommitStats getStats() { + return stats; + } + + public void setStats(CommitStats stats) { + this.stats = stats; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/ErrorMessage.java b/src/main/java/com/messners/gitlab/api/models/ErrorMessage.java index ccec2a1b66494342da8a4fcf4aefa97e66060705..d0cdaa2d97028b57c620b020549ffc4751598e76 100644 --- a/src/main/java/com/messners/gitlab/api/models/ErrorMessage.java +++ b/src/main/java/com/messners/gitlab/api/models/ErrorMessage.java @@ -1,7 +1,6 @@ package com.messners.gitlab.api.models; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -10,13 +9,13 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class ErrorMessage { - private String message; + private String message; - public String getMessage () { - return this.message; - } + public String getMessage() { + return this.message; + } - public void setMessage (String message) { - this.message = message; - } + public void setMessage(String message) { + this.message = message; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Event.java b/src/main/java/com/messners/gitlab/api/models/Event.java index d356450a6f7fb3e664787137b0d162beee370b4e..82847770ebe7a6706a3c532af2d6ded5f1660bda 100644 --- a/src/main/java/com/messners/gitlab/api/models/Event.java +++ b/src/main/java/com/messners/gitlab/api/models/Event.java @@ -9,78 +9,94 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Event { - private String actionName; - private Integer authorId; - - private EventData data; - - private Integer projectId; - private String targetId; - private String targetTitle; - private String targetType; - private String title; - - public String getActionName () { - return this.actionName; - } - - public void setActionName (String actionName) { - this.actionName = actionName; - } - - public Integer getAuthorId () { - return this.authorId; - } - - public void setAuthorId (Integer authorId) { - this.authorId = authorId; - } - - public EventData getData () { - return this.data; - } - - public void setData (EventData data) { - this.data = data; - } - - public Integer getProjectId () { - return this.projectId; - } - - public void setProjectId (Integer projectId) { - this.projectId = projectId; - } - - public String getTargetId () { - return this.targetId; - } - - public void setTargetId (String targetId) { - this.targetId = targetId; - } - - public String getTargetTitle () { - return this.targetTitle; - } - - public void setTargetTitle (String targetTitle) { - this.targetTitle = targetTitle; - } - - public String getTargetType () { - return this.targetType; - } - - public void setTargetType (String targetType) { - this.targetType = targetType; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } + private String actionName; + private Author author; + private Integer authorId; + private String authorUsername; + private EventData data; + private Integer projectId; + private Integer targetId; + private String targetTitle; + private String targetType; + private String title; + + public String getActionName() { + return actionName; + } + + public void setActionName(String actionName) { + this.actionName = actionName; + } + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Integer getAuthorId() { + return authorId; + } + + public void setAuthorId(Integer authorId) { + this.authorId = authorId; + } + + public String getAuthorUsername() { + return authorUsername; + } + + public void setAuthorUsername(String authorUsername) { + this.authorUsername = authorUsername; + } + + public EventData getData() { + return data; + } + + public void setData(EventData data) { + this.data = data; + } + + public Integer getProjectId() { + return projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public Integer getTargetId() { + return targetId; + } + + public void setTargetId(Integer targetId) { + this.targetId = targetId; + } + + public String getTargetTitle() { + return targetTitle; + } + + public void setTargetTitle(String targetTitle) { + this.targetTitle = targetTitle; + } + + public String getTargetType() { + return targetType; + } + + public void setTargetType(String targetType) { + this.targetType = targetType; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/EventData.java b/src/main/java/com/messners/gitlab/api/models/EventData.java index 7b4d8ce7e018fcfef46a3a6168339f9f095c5125..0223603160c46d33dd0aff19e6ab354d41f728d2 100644 --- a/src/main/java/com/messners/gitlab/api/models/EventData.java +++ b/src/main/java/com/messners/gitlab/api/models/EventData.java @@ -8,79 +8,79 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -@XmlAccessorType (XmlAccessType.FIELD) +@XmlAccessorType(XmlAccessType.FIELD) public class EventData { - private String after; - private String before; - private List commits; - private String ref; - private Repository repository; - private Integer total_commits_count; - private Integer user_id; - private String user_name; - - public String getAfter () { - return this.after; - } - - public void setAfter (String after) { - this.after = after; - } - - public String getBefore () { - return this.before; - } - - public void setBefore (String before) { - this.before = before; - } - - public List getCommits () { - return this.commits; - } - - public void setCommits (List commits) { - this.commits = commits; - } - - public String getRef () { - return this.ref; - } - - public void setRef (String ref) { - this.ref = ref; - } - - public Repository getRepository () { - return this.repository; - } - - public void setRepository (Repository repository) { - this.repository = repository; - } - - public Integer getTotal_commits_count () { - return this.total_commits_count; - } - - public void setTotal_commits_count (Integer total_commits_count) { - this.total_commits_count = total_commits_count; - } - - public Integer getUser_id () { - return this.user_id; - } - - public void setUser_id (Integer user_id) { - this.user_id = user_id; - } - - public String getUser_name () { - return this.user_name; - } - - public void setUser_name (String user_name) { - this.user_name = user_name; - } + private String after; + private String before; + private List commits; + private String ref; + private Repository repository; + private Integer totalCommitsCount; + private Integer userId; + private String userName; + + public String getAfter() { + return this.after; + } + + public void setAfter(String after) { + this.after = after; + } + + public String getBefore() { + return this.before; + } + + public void setBefore(String before) { + this.before = before; + } + + public List getCommits() { + return this.commits; + } + + public void setCommits(List commits) { + this.commits = commits; + } + + public String getRef() { + return this.ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public Repository getRepository() { + return this.repository; + } + + public void setRepository(Repository repository) { + this.repository = repository; + } + + public Integer getTotalCommitsCount() { + return this.totalCommitsCount; + } + + public void setTotalCommitsCount(Integer totalCommitsCount) { + this.totalCommitsCount = totalCommitsCount; + } + + public Integer getUserId() { + return this.userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Group.java b/src/main/java/com/messners/gitlab/api/models/Group.java index 5085b4251cdb64f249dab02fee6239cbd1ca1907..dd800eb6e59bf2ea03ff79e6f6452609d95c1f20 100644 --- a/src/main/java/com/messners/gitlab/api/models/Group.java +++ b/src/main/java/com/messners/gitlab/api/models/Group.java @@ -10,50 +10,50 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Group { - - private Integer id; - private String name; - private Integer ownerId; - private String path; - private List projects; - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public Integer getOwnerId () { - return this.ownerId; - } - - public void setOwnerId (Integer ownerId) { - this.ownerId = ownerId; - } - - public String getPath () { - return this.path; - } - - public void setPath (String path) { - this.path = path; - } - - public List getProjects () { - return (projects); - } - - public void setProjects (List projects) { - this.projects = projects; - } + + private Integer id; + private String name; + private Integer ownerId; + private String path; + private List projects; + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getOwnerId() { + return this.ownerId; + } + + public void setOwnerId(Integer ownerId) { + this.ownerId = ownerId; + } + + public String getPath() { + return this.path; + } + + public void setPath(String path) { + this.path = path; + } + + public List getProjects() { + return (projects); + } + + public void setProjects(List projects) { + this.projects = projects; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Issue.java b/src/main/java/com/messners/gitlab/api/models/Issue.java index 66e452b24447538710274f3c9dbe56455d768117..814791745d878922cd882c7017a7c79dfb0239ff 100644 --- a/src/main/java/com/messners/gitlab/api/models/Issue.java +++ b/src/main/java/com/messners/gitlab/api/models/Issue.java @@ -11,113 +11,158 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Issue { - - private Assignee assignee; - private Author author; - private Date createdAt; - private String description; - private Integer id; - private Integer iid; - private List labels; - private Milestone milestone; - private Integer project_id; - private String state; - private String title; - private Date updatedAt; - - public Assignee getAssignee () { - return this.assignee; - } - - public void setAssignee (Assignee assignee) { - this.assignee = assignee; - } - - public Author getAuthor () { - return this.author; - } - - public void setAuthor (Author author) { - this.author = author; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Integer getIid () { - return this.iid; - } - - public void setIid (Integer iid) { - this.iid = iid; - } - - public List getLabels () { - return this.labels; - } - - public void setLabels (List labels) { - this.labels = labels; - } - - public Milestone getMilestone () { - return this.milestone; - } - - public void setMilestone (Milestone milestone) { - this.milestone = milestone; - } - - public Integer getProject_id () { - return this.project_id; - } - - public void setProject_id (Integer project_id) { - this.project_id = project_id; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public Date getUpdatedAt () { - return this.updatedAt; - } - - public void setUpdatedAt (Date updatedAt) { - this.updatedAt = updatedAt; - } + + private Assignee assignee; + private Author author; + private Boolean confidential; + private Date createdAt; + private String description; + private Date dueDate; + private Integer id; + private Integer iid; + private List labels; + private Milestone milestone; + private Integer project_id; + private String state; + private Boolean subscribed; + private String title; + private Date updatedAt; + private Integer userNotesCount; + private String webUrl; + + public Assignee getAssignee() { + return assignee; + } + + public void setAssignee(Assignee assignee) { + this.assignee = assignee; + } + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Boolean getConfidential() { + return confidential; + } + + public void setConfidential(Boolean confidential) { + this.confidential = confidential; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getDueDate() { + return dueDate; + } + + public void setDueDate(Date dueDate) { + this.dueDate = dueDate; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getIid() { + return iid; + } + + public void setIid(Integer iid) { + this.iid = iid; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public Milestone getMilestone() { + return milestone; + } + + public void setMilestone(Milestone milestone) { + this.milestone = milestone; + } + + public Integer getProject_id() { + return project_id; + } + + public void setProject_id(Integer project_id) { + this.project_id = project_id; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Boolean getSubscribed() { + return subscribed; + } + + public void setSubscribed(Boolean subscribed) { + this.subscribed = subscribed; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + + public Integer getUserNotesCount() { + return userNotesCount; + } + + public void setUserNotesCount(Integer userNotesCount) { + this.userNotesCount = userNotesCount; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Key.java b/src/main/java/com/messners/gitlab/api/models/Key.java index 2e7b60d0ae5e1ef2cebe8dc9be277b01bdf1d369..cb79b9b95faa2d55e9c432e2e829cc61ce5b6dc1 100644 --- a/src/main/java/com/messners/gitlab/api/models/Key.java +++ b/src/main/java/com/messners/gitlab/api/models/Key.java @@ -8,43 +8,52 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -@XmlAccessorType (XmlAccessType.FIELD) +@XmlAccessorType(XmlAccessType.FIELD) public class Key { - private Date createdAt; - private Integer id; - private String key; - private String title; + private Date createdAt; + private Integer id; + private String key; + private String title; + private User user; - public Date getCreatedAt () { - return this.createdAt; - } + public Date getCreatedAt() { + return this.createdAt; + } - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } - public Integer getId () { - return this.id; - } + public Integer getId() { + return this.id; + } - public void setId (Integer id) { - this.id = id; - } + public void setId(Integer id) { + this.id = id; + } - public String getKey () { - return this.key; - } + public String getKey() { + return this.key; + } - public void setKey (String key) { - this.key = key; - } + public void setKey(String key) { + this.key = key; + } - public String getTitle () { - return this.title; - } + public String getTitle() { + return this.title; + } - public void setTitle (String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Member.java b/src/main/java/com/messners/gitlab/api/models/Member.java index 0e387b217795f8433b142d3526b0facbe8ea4271..31be71fd7148ceecac9baa27bd533004dae0eecd 100644 --- a/src/main/java/com/messners/gitlab/api/models/Member.java +++ b/src/main/java/com/messners/gitlab/api/models/Member.java @@ -10,74 +10,68 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Member { - - public static final int GUEST_LEVEL = 10; - public static final int REPORTER_LEVEL = 20; - public static final int DEVELOPER_LEVEL = 30; - public static final int MASTER_LEVEL = 40; - public static final int OWNER_LEVEL = 50; - - private Integer accessLevel; - private Date createdAt; - private String email; - private Integer id; - private String name; - private String state; - private String username; - - public Integer getAccessLevel () { - return this.accessLevel; - } - - public void setAccessLevel (Integer accessLevel) { - this.accessLevel = accessLevel; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getEmail () { - return this.email; - } - - public void setEmail (String email) { - this.email = email; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public String getUsername () { - return this.username; - } - - public void setUsername (String username) { - this.username = username; - } + + private AccessLevel accessLevel; + private Date createdAt; + private String email; + private Integer id; + private String name; + private String state; + private String username; + + public AccessLevel getAccessLevel() { + return this.accessLevel; + } + + public void setAccessLevel(AccessLevel accessLevel) { + this.accessLevel = accessLevel; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getState() { + return this.state; + } + + public void setState(String state) { + this.state = state; + } + + public String getUsername() { + return this.username; + } + + public void setUsername(String username) { + this.username = username; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/MergeRequest.java b/src/main/java/com/messners/gitlab/api/models/MergeRequest.java index ca86833f27ec9f2bada758e4eae01fb7eaa116aa..4eb7c662cda19ea6d3470ad5093e72cf004a14c0 100644 --- a/src/main/java/com/messners/gitlab/api/models/MergeRequest.java +++ b/src/main/java/com/messners/gitlab/api/models/MergeRequest.java @@ -1,5 +1,7 @@ package com.messners.gitlab.api.models; +import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -7,117 +9,270 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class MergeRequest { - - private Assignee assignee; - private Author author; - private Integer downvotes; - private Integer id; - private Integer iid; - private Integer projectId; - private String sourceBranch; - private String state; - private String targetBranch; - private String title; - private String description; - private Integer upvotes; - - public Assignee getAssignee () { - return this.assignee; - } - - public void setAssignee (Assignee assignee) { - this.assignee = assignee; - } - - public Author getAuthor () { - return this.author; - } - - public void setAuthor (Author author) { - this.author = author; - } - - public Integer getDownvotes () { - return this.downvotes; - } - - public void setDownvotes (Integer downvotes) { - this.downvotes = downvotes; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Integer getIid () { - return this.iid; - } - - public void setIid (Integer iid) { - this.iid = iid; - } - - public Integer getProjectId () { - return this.projectId; - } - - public void setProjectId (Integer projectId) { - this.projectId = projectId; - } - - public String getSourceBranch () { - return this.sourceBranch; - } - - public void setSourceBranch (String sourceBranch) { - this.sourceBranch = sourceBranch; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public String getTargetBranch () { - return this.targetBranch; - } - - public void setTargetBranch (String targetBranch) { - this.targetBranch = targetBranch; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Integer getUpvotes () { - return this.upvotes; - } - - public void setUpvotes (Integer upvotes) { - this.upvotes = upvotes; - } - - public static final boolean isValid (MergeRequest mergeRequest) { - return (mergeRequest != null && mergeRequest.getId() != null); - } + + private Integer approvalsBeforeMerge; + private Assignee assignee; + private Author author; + private Changes changes; + private String description; + private Integer downvotes; + private Boolean forceRemoveSourceBranch; + private Integer id; + private Integer iid; + private List labels; + private String mergeCommitSha; + private String mergeStatus; + private Boolean mergeWhenBuildSucceeds; + private Milestone milestone; + private Integer projectId; + private String sha; + private Boolean shouldRemoveSourceBranch; + private String sourceBranch; + private Integer sourceProjectId; + private Boolean squash; + private String state; + private Boolean subscribed; + private String targetBranch; + private Integer targetProjectId; + private String title; + private Integer upvotes; + private Integer userNotesCount; + private String webUrl; + private Boolean workInProgress; + + public Integer getApprovalsBeforeMerge() { + return approvalsBeforeMerge; + } + + public void setApprovalsBeforeMerge(Integer approvalsBeforeMerge) { + this.approvalsBeforeMerge = approvalsBeforeMerge; + } + + public Assignee getAssignee() { + return assignee; + } + + public void setAssignee(Assignee assignee) { + this.assignee = assignee; + } + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Changes getChanges() { + return changes; + } + + public void setChanges(Changes changes) { + this.changes = changes; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getDownvotes() { + return downvotes; + } + + public void setDownvotes(Integer downvotes) { + this.downvotes = downvotes; + } + + public Boolean getForceRemoveSourceBranch() { + return forceRemoveSourceBranch; + } + + public void setForceRemoveSourceBranch(Boolean forceRemoveSourceBranch) { + this.forceRemoveSourceBranch = forceRemoveSourceBranch; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getIid() { + return iid; + } + + public void setIid(Integer iid) { + this.iid = iid; + } + + public List getLabels() { + return labels; + } + + public void setLabels(List labels) { + this.labels = labels; + } + + public String getMergeCommitSha() { + return mergeCommitSha; + } + + public void setMergeCommitSha(String mergeCommitSha) { + this.mergeCommitSha = mergeCommitSha; + } + + public String getMergeStatus() { + return mergeStatus; + } + + public void setMergeStatus(String mergeStatus) { + this.mergeStatus = mergeStatus; + } + + public Boolean getMergeWhenBuildSucceeds() { + return mergeWhenBuildSucceeds; + } + + public void setMergeWhenBuildSucceeds(Boolean mergeWhenBuildSucceeds) { + this.mergeWhenBuildSucceeds = mergeWhenBuildSucceeds; + } + + public Milestone getMilestone() { + return milestone; + } + + public void setMilestone(Milestone milestone) { + this.milestone = milestone; + } + + public Integer getProjectId() { + return projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public String getSha() { + return sha; + } + + public void setSha(String sha) { + this.sha = sha; + } + + public Boolean getShouldRemoveSourceBranch() { + return shouldRemoveSourceBranch; + } + + public void setShouldRemoveSourceBranch(Boolean shouldRemoveSourceBranch) { + this.shouldRemoveSourceBranch = shouldRemoveSourceBranch; + } + + public String getSourceBranch() { + return sourceBranch; + } + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + public Integer getSourceProjectId() { + return sourceProjectId; + } + + public void setSourceProjectId(Integer sourceProjectId) { + this.sourceProjectId = sourceProjectId; + } + + public Boolean getSquash() { + return squash; + } + + public void setSquash(Boolean squash) { + this.squash = squash; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public Boolean getSubscribed() { + return subscribed; + } + + public void setSubscribed(Boolean subscribed) { + this.subscribed = subscribed; + } + + public String getTargetBranch() { + return targetBranch; + } + + public void setTargetBranch(String targetBranch) { + this.targetBranch = targetBranch; + } + + public Integer getTargetProjectId() { + return targetProjectId; + } + + public void setTargetProjectId(Integer targetProjectId) { + this.targetProjectId = targetProjectId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Integer getUpvotes() { + return upvotes; + } + + public void setUpvotes(Integer upvotes) { + this.upvotes = upvotes; + } + + public Integer getUserNotesCount() { + return userNotesCount; + } + + public void setUserNotesCount(Integer userNotesCount) { + this.userNotesCount = userNotesCount; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } + + public Boolean getWorkInProgress() { + return workInProgress; + } + + public void setWorkInProgress(Boolean workInProgress) { + this.workInProgress = workInProgress; + } + + public static final boolean isValid(MergeRequest mergeRequest) { + return (mergeRequest != null && mergeRequest.getId() != null); + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Milestone.java b/src/main/java/com/messners/gitlab/api/models/Milestone.java index 55cb7b5144365ab9579f1fb1d7748d2cde003e91..b40ba83b77ab856c0e93f160553406b4bc153832 100644 --- a/src/main/java/com/messners/gitlab/api/models/Milestone.java +++ b/src/main/java/com/messners/gitlab/api/models/Milestone.java @@ -10,85 +10,85 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Milestone { - private Date createdAt; - private String description; - private Date dueDate; - private Integer id; - private Integer iid; - private Integer projectId; - private String state; - private String title; - private Date updatedAt; - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public Date getDueDate () { - return this.dueDate; - } - - public void setDueDate (Date dueDate) { - this.dueDate = dueDate; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Integer getIid () { - return this.iid; - } - - public void setIid (Integer iid) { - this.iid = iid; - } - - public Integer getProjectId () { - return this.projectId; - } - - public void setProjectId (Integer projectId) { - this.projectId = projectId; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public Date getUpdatedAt () { - return this.updatedAt; - } - - public void setUpdatedAt (Date updatedAt) { - this.updatedAt = updatedAt; - } + private Date createdAt; + private String description; + private Date dueDate; + private Integer id; + private Integer iid; + private Integer projectId; + private String state; + private String title; + private Date updatedAt; + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getDueDate() { + return this.dueDate; + } + + public void setDueDate(Date dueDate) { + this.dueDate = dueDate; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getIid() { + return this.iid; + } + + public void setIid(Integer iid) { + this.iid = iid; + } + + public Integer getProjectId() { + return this.projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public String getState() { + return this.state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Date getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Namespace.java b/src/main/java/com/messners/gitlab/api/models/Namespace.java index 2db8569575d17df2073893ad901e409a3103966f..0da37f27537c3b342feb1316069afa4865d3e0fc 100644 --- a/src/main/java/com/messners/gitlab/api/models/Namespace.java +++ b/src/main/java/com/messners/gitlab/api/models/Namespace.java @@ -10,67 +10,67 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Namespace { - private Date createdAt; - private String description; - private Integer id; - private String name; - private Integer ownerId; - private String path; - private String updatedAt; - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public Integer getOwnerId () { - return this.ownerId; - } - - public void setOwnerId (Integer ownerId) { - this.ownerId = ownerId; - } - - public String getPath () { - return this.path; - } - - public void setPath (String path) { - this.path = path; - } - - public String getUpdatedAt () { - return this.updatedAt; - } - - public void setUpdatedAt (String updatedAt) { - this.updatedAt = updatedAt; - } + private Date createdAt; + private String description; + private Integer id; + private String name; + private Integer ownerId; + private String path; + private String updatedAt; + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getOwnerId() { + return this.ownerId; + } + + public void setOwnerId(Integer ownerId) { + this.ownerId = ownerId; + } + + public String getPath() { + return this.path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Note.java b/src/main/java/com/messners/gitlab/api/models/Note.java index ff3799fe9ea7e38524004d74a4663c3501a60adb..4f39a4b9a750fbd8910d88fb988a47e019202266 100644 --- a/src/main/java/com/messners/gitlab/api/models/Note.java +++ b/src/main/java/com/messners/gitlab/api/models/Note.java @@ -10,76 +10,145 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Note { - private String attachment; - private Author author; - private Date createdAt; - private Date expiresAt; - private String fileName; - private Integer id; - private String title; - private String updatedAt; - - public String getAttachment () { - return this.attachment; - } - - public void setAttachment (String attachment) { - this.attachment = attachment; - } - - public Author getAuthor () { - return this.author; - } - - public void setAuthor (Author author) { - this.author = author; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public Date getExpiresAt () { - return this.expiresAt; - } - - public void setExpiresAt (Date expiresAt) { - this.expiresAt = expiresAt; - } - - public String getFileName () { - return this.fileName; - } - - public void setFileName (String fileName) { - this.fileName = fileName; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public String getUpdatedAt () { - return this.updatedAt; - } - - public void setUpdatedAt (String updatedAt) { - this.updatedAt = updatedAt; - } + public static enum NotableType { + ISSUE("Issue"), MERGE_REQUEST("MergeRequest"), SNIPPET("Snippet"); + + private String name; + + NotableType(String name) { + this.name = name; + } + + @Override + public String toString() { + return (name); + } + } + + private String attachment; + private Author author; + private String body; + private Date createdAt; + private Boolean downvote; + private Date expiresAt; + private String fileName; + private Integer id; + private Integer noteableId; + private NotableType noteableType; + private Boolean system; + private String title; + private String updatedAt; + private Boolean upvote; + + public String getAttachment() { + return attachment; + } + + public void setAttachment(String attachment) { + this.attachment = attachment; + } + + public Author getAuthor() { + return author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Boolean getDownvote() { + return downvote; + } + + public void setDownvote(Boolean downvote) { + this.downvote = downvote; + } + + public Date getExpiresAt() { + return expiresAt; + } + + public void setExpiresAt(Date expiresAt) { + this.expiresAt = expiresAt; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getNoteableId() { + return noteableId; + } + + public void setNoteableId(Integer noteableId) { + this.noteableId = noteableId; + } + + public NotableType getNoteableType() { + return noteableType; + } + + public void setNoteableType(NotableType noteableType) { + this.noteableType = noteableType; + } + + public Boolean getSystem() { + return system; + } + + public void setSystem(Boolean system) { + this.system = system; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public Boolean getUpvote() { + return upvote; + } + + public void setUpvote(Boolean upvote) { + this.upvote = upvote; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Owner.java b/src/main/java/com/messners/gitlab/api/models/Owner.java index eebfb52edadc2248904c0e6f82521ef38e07cd95..b7e31d89fdd890d7f6ae7c0943e408061b7d911d 100644 --- a/src/main/java/com/messners/gitlab/api/models/Owner.java +++ b/src/main/java/com/messners/gitlab/api/models/Owner.java @@ -10,31 +10,31 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Owner { - private Date createdAt; - private Integer id; - private String name; + private Date createdAt; + private Integer id; + private String name; - public Date getCreatedAt () { - return this.createdAt; - } + public Date getCreatedAt() { + return this.createdAt; + } - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } - public Integer getId () { - return this.id; - } + public Integer getId() { + return this.id; + } - public void setId (Integer id) { - this.id = id; - } + public void setId(Integer id) { + this.id = id; + } - public String getName () { - return this.name; - } + public String getName() { + return this.name; + } - public void setName (String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Project.java b/src/main/java/com/messners/gitlab/api/models/Project.java index 8f6ed1357417cb62475e85d3742d9eb2cfed6b32..904495d8b6598c0eca3a9c11d3ccdc9507076126 100644 --- a/src/main/java/com/messners/gitlab/api/models/Project.java +++ b/src/main/java/com/messners/gitlab/api/models/Project.java @@ -1,8 +1,8 @@ package com.messners.gitlab.api.models; - import java.util.Date; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -11,198 +11,369 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Project { - - private Date createdAt; - private String defaultBranch; - private String description; - private String httpUrlToRepo; - private Integer id; - private Boolean issuesEnabled; - private Date lastActivityAt; - private Boolean mergeRequestsEnabled; - private String name; - private String nameWithNamespace; - private Namespace namespace; - private Owner owner; - private String path; - private String pathWithNamespace; - private Boolean isPublic; - private Boolean snippetsEnabled; - private String sshUrlToRepo; - private Integer visibilityLevel; - private Boolean wallEnabled; - private String webUrl; - private Boolean wikiEnabled; - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getDefaultBranch () { - return this.defaultBranch; - } - - public void setDefaultBranch (String defaultBranch) { - this.defaultBranch = defaultBranch; - } - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public String getHttpUrlToRepo () { - return this.httpUrlToRepo; - } - - public void setHttpUrlToRepo (String httpUrlToRepo) { - this.httpUrlToRepo = httpUrlToRepo; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Boolean getIssuesEnabled () { - return this.issuesEnabled; - } - - public void setIssuesEnabled (Boolean issuesEnabled) { - this.issuesEnabled = issuesEnabled; - } - - public Date getLastActivityAt () { - return this.lastActivityAt; - } - - public void setLastActivityAt (Date lastActivityAt) { - this.lastActivityAt = lastActivityAt; - } - - public Boolean getMergeRequestsEnabled () { - return this.mergeRequestsEnabled; - } - - public void setMergeRequestsEnabled (Boolean mergeRequestsEnabled) { - this.mergeRequestsEnabled = mergeRequestsEnabled; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getNameWithNamespace () { - return this.nameWithNamespace; - } - - public void setNameWithNamespace (String nameWithNamespace) { - this.nameWithNamespace = nameWithNamespace; - } - - public Namespace getNamespace () { - return this.namespace; - } - - public void setNamespace (Namespace namespace) { - this.namespace = namespace; - } - - public Owner getOwner () { - return this.owner; - } - - public void setOwner (Owner owner) { - this.owner = owner; - } - - public String getPath () { - return this.path; - } - - public void setPath (String path) { - this.path = path; - } - - public String getPathWithNamespace () { - return this.pathWithNamespace; - } - - public void setPathWithNamespace (String pathWithNamespace) { - this.pathWithNamespace = pathWithNamespace; - } - - public Boolean getPublic () { - return this.isPublic; - } - - public void setPublic (Boolean isPublic) { - this.isPublic = isPublic; - } - - public Boolean getSnippetsEnabled () { - return this.snippetsEnabled; - } - - public void setSnippetsEnabled (Boolean snippetsEnabled) { - this.snippetsEnabled = snippetsEnabled; - } - - public String getSshUrlToRepo () { - return this.sshUrlToRepo; - } - - public void setSshUrlToRepo (String sshUrlToRepo) { - this.sshUrlToRepo = sshUrlToRepo; - } - - public Integer getVisibilityLevel () { - return this.visibilityLevel; - } - - public void setVisibilityLevel (Integer visibilityLevel) { - this.visibilityLevel = visibilityLevel; - } - - public Boolean getWallEnabled () { - return this.wallEnabled; - } - - public void setWallEnabled (Boolean wallEnabled) { - this.wallEnabled = wallEnabled; - } - - public String getWebUrl () { - return this.webUrl; - } - - public void setWebUrl (String webUrl) { - this.webUrl = webUrl; - } - - public Boolean getWikiEnabled () { - return this.wikiEnabled; - } - - public void setWikiEnabled (Boolean wikiEnabled) { - this.wikiEnabled = wikiEnabled; - } - - public static final boolean isValid (Project project) { - return (project != null && project.getId() != null); - } + + private Boolean archived; + private String avatarUrl; + private Boolean buildsEnabled; + private Boolean containerRegistryEnabled; + private Date createdAt; + private Integer creatorId; + private String defaultBranch; + private String description; + private Integer forksCount; + private Project forkedFromProject; + private String httpUrlToRepo; + private Integer id; + private Boolean issuesEnabled; + private Date lastActivityAt; + private Boolean mergeRequestsEnabled; + private String name; + private Namespace namespace; + private String nameWithNamespace; + private Boolean onlyAllowMergeIfBuildSucceeds; + private Boolean onlyAllowMergeIfAllDiscussionsAreResolved; + private Integer openIssuesCount; + private Owner owner; + private String path; + private String pathWithNamespace; + private Permissions permissions; + private Boolean isPublic; + private Boolean publicBuilds; + private String repositoryStorage; + private Boolean request_access_enabled; + private String runnersToken; + private Boolean sharedRunnersEnabled; + private List sharedWithGroups; + private Boolean snippetsEnabled; + private String sshUrlToRepo; + private Integer starCount; + private List tagList; + private Integer visibilityLevel; + private Boolean wallEnabled; + private String webUrl; + private Boolean wikiEnabled; + + public Boolean getArchived() { + return archived; + } + + public void setArchived(Boolean archived) { + this.archived = archived; + } + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public Boolean getBuildsEnabled() { + return buildsEnabled; + } + + public void setBuildsEnabled(Boolean buildsEnabled) { + this.buildsEnabled = buildsEnabled; + } + + public Boolean getContainerRegistryEnabled() { + return containerRegistryEnabled; + } + + public void setContainerRegistryEnabled(Boolean containerRegistryEnabled) { + this.containerRegistryEnabled = containerRegistryEnabled; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Integer getCreatorId() { + return creatorId; + } + + public void setCreatorId(Integer creatorId) { + this.creatorId = creatorId; + } + + public String getDefaultBranch() { + return defaultBranch; + } + + public void setDefaultBranch(String defaultBranch) { + this.defaultBranch = defaultBranch; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getForksCount() { + return forksCount; + } + + public void setForksCount(Integer forksCount) { + this.forksCount = forksCount; + } + + public Project getForkedFromProject() { + return forkedFromProject; + } + + public void setForkedFromProject(Project forkedFromProject) { + this.forkedFromProject = forkedFromProject; + } + + public String getHttpUrlToRepo() { + return httpUrlToRepo; + } + + public void setHttpUrlToRepo(String httpUrlToRepo) { + this.httpUrlToRepo = httpUrlToRepo; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Boolean getIssuesEnabled() { + return issuesEnabled; + } + + public void setIssuesEnabled(Boolean issuesEnabled) { + this.issuesEnabled = issuesEnabled; + } + + public Date getLastActivityAt() { + return lastActivityAt; + } + + public void setLastActivityAt(Date lastActivityAt) { + this.lastActivityAt = lastActivityAt; + } + + public Boolean getMergeRequestsEnabled() { + return mergeRequestsEnabled; + } + + public void setMergeRequestsEnabled(Boolean mergeRequestsEnabled) { + this.mergeRequestsEnabled = mergeRequestsEnabled; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Namespace getNamespace() { + return namespace; + } + + public void setNamespace(Namespace namespace) { + this.namespace = namespace; + } + + public String getNameWithNamespace() { + return nameWithNamespace; + } + + public void setNameWithNamespace(String nameWithNamespace) { + this.nameWithNamespace = nameWithNamespace; + } + + public Boolean getOnlyAllowMergeIfBuildSucceeds() { + return onlyAllowMergeIfBuildSucceeds; + } + + public void setOnlyAllowMergeIfBuildSucceeds(Boolean onlyAllowMergeIfBuildSucceeds) { + this.onlyAllowMergeIfBuildSucceeds = onlyAllowMergeIfBuildSucceeds; + } + + public Boolean getOnlyAllowMergeIfAllDiscussionsAreResolved() { + return onlyAllowMergeIfAllDiscussionsAreResolved; + } + + public void setOnlyAllowMergeIfAllDiscussionsAreResolved(Boolean onlyAllowMergeIfAllDiscussionsAreResolved) { + this.onlyAllowMergeIfAllDiscussionsAreResolved = onlyAllowMergeIfAllDiscussionsAreResolved; + } + + public Integer getOpenIssuesCount() { + return openIssuesCount; + } + + public void setOpenIssuesCount(Integer openIssuesCount) { + this.openIssuesCount = openIssuesCount; + } + + public Owner getOwner() { + return owner; + } + + public void setOwner(Owner owner) { + this.owner = owner; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getPathWithNamespace() { + return pathWithNamespace; + } + + public void setPathWithNamespace(String pathWithNamespace) { + this.pathWithNamespace = pathWithNamespace; + } + + public Permissions getPermissions() { + return permissions; + } + + public void setPermissions(Permissions permissions) { + this.permissions = permissions; + } + + public Boolean getPublic() { + return isPublic; + } + + public void setPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + public Boolean getPublicBuilds() { + return publicBuilds; + } + + public void setPublicBuilds(Boolean publicBuilds) { + this.publicBuilds = publicBuilds; + } + + public String getRepositoryStorage() { + return repositoryStorage; + } + + public void setRepositoryStorage(String repositoryStorage) { + this.repositoryStorage = repositoryStorage; + } + + public Boolean getRequest_access_enabled() { + return request_access_enabled; + } + + public void setRequest_access_enabled(Boolean request_access_enabled) { + this.request_access_enabled = request_access_enabled; + } + + public String getRunnersToken() { + return runnersToken; + } + + public void setRunnersToken(String runnersToken) { + this.runnersToken = runnersToken; + } + + public Boolean getSharedRunnersEnabled() { + return sharedRunnersEnabled; + } + + public void setSharedRunnersEnabled(Boolean sharedRunnersEnabled) { + this.sharedRunnersEnabled = sharedRunnersEnabled; + } + + public List getSharedWithGroups() { + return sharedWithGroups; + } + + public void setSharedWithGroups(List sharedWithGroups) { + this.sharedWithGroups = sharedWithGroups; + } + + public Boolean getSnippetsEnabled() { + return snippetsEnabled; + } + + public void setSnippetsEnabled(Boolean snippetsEnabled) { + this.snippetsEnabled = snippetsEnabled; + } + + public String getSshUrlToRepo() { + return sshUrlToRepo; + } + + public void setSshUrlToRepo(String sshUrlToRepo) { + this.sshUrlToRepo = sshUrlToRepo; + } + + public Integer getStarCount() { + return starCount; + } + + public void setStarCount(Integer starCount) { + this.starCount = starCount; + } + + public List getTagList() { + return tagList; + } + + public void setTagList(List tagList) { + this.tagList = tagList; + } + + public Integer getVisibilityLevel() { + return visibilityLevel; + } + + public void setVisibilityLevel(Integer visibilityLevel) { + this.visibilityLevel = visibilityLevel; + } + + public Boolean getWallEnabled() { + return wallEnabled; + } + + public void setWallEnabled(Boolean wallEnabled) { + this.wallEnabled = wallEnabled; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } + + public Boolean getWikiEnabled() { + return wikiEnabled; + } + + public void setWikiEnabled(Boolean wikiEnabled) { + this.wikiEnabled = wikiEnabled; + } + + public static final boolean isValid(Project project) { + return (project != null && project.getId() != null); + } } diff --git a/src/main/java/com/messners/gitlab/api/models/ProjectHook.java b/src/main/java/com/messners/gitlab/api/models/ProjectHook.java index 794d3d9b3a415ce4dbe8c03913e78a8735812001..ac167f25f48e087ac84c2a383723c10c14845b37 100644 --- a/src/main/java/com/messners/gitlab/api/models/ProjectHook.java +++ b/src/main/java/com/messners/gitlab/api/models/ProjectHook.java @@ -1,6 +1,8 @@ package com.messners.gitlab.api.models; +import java.util.Date; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -8,68 +10,122 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ProjectHook { - - private String createdAt; - private Integer id; - private Boolean issuesEvents; - private Boolean mergeRequestsEvents; - private Integer projectId; - private Boolean pushEvents; - private String url; - - public String getCreatedAt() { - return this.createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public Integer getId() { - return this.id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Boolean getIssuesEvents() { - return this.issuesEvents; - } - - public void setIssuesEvents(Boolean issuesEvents) { - this.issuesEvents = issuesEvents; - } - - public Boolean getMergeRequestsEvents() { - return this.mergeRequestsEvents; - } - - public void setMergeRequestsEvents(Boolean mergeRequestsEvents) { - this.mergeRequestsEvents = mergeRequestsEvents; - } - - public Integer getProjectId() { - return this.projectId; - } - - public void setProjectId(Integer projectId) { - this.projectId = projectId; - } - - public Boolean getPushEvents() { - return this.pushEvents; - } - - public void setPushEvents(Boolean pushEvents) { - this.pushEvents = pushEvents; - } - - public String getUrl() { - return this.url; - } - - public void setUrl(String url) { - this.url = url; - } -} + + private Boolean build_events; + private Date createdAt; + private Boolean enable_ssl_verification; + private Integer id; + private Boolean issuesEvents; + private Boolean mergeRequestsEvents; + private Boolean note_events; + private Boolean pipeline_events; + private Integer projectId; + private Boolean pushEvents; + private Boolean tag_push_events; + private String url; + private Boolean wiki_page_events; + + public Boolean getBuild_events() { + return build_events; + } + + public void setBuild_events(Boolean build_events) { + this.build_events = build_events; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Boolean getEnable_ssl_verification() { + return enable_ssl_verification; + } + + public void setEnable_ssl_verification(Boolean enable_ssl_verification) { + this.enable_ssl_verification = enable_ssl_verification; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Boolean getIssuesEvents() { + return issuesEvents; + } + + public void setIssuesEvents(Boolean issuesEvents) { + this.issuesEvents = issuesEvents; + } + + public Boolean getMergeRequestsEvents() { + return mergeRequestsEvents; + } + + public void setMergeRequestsEvents(Boolean mergeRequestsEvents) { + this.mergeRequestsEvents = mergeRequestsEvents; + } + + public Boolean getNote_events() { + return note_events; + } + + public void setNote_events(Boolean note_events) { + this.note_events = note_events; + } + + public Boolean getPipeline_events() { + return pipeline_events; + } + + public void setPipeline_events(Boolean pipeline_events) { + this.pipeline_events = pipeline_events; + } + + public Integer getProjectId() { + return projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public Boolean getPushEvents() { + return pushEvents; + } + + public void setPushEvents(Boolean pushEvents) { + this.pushEvents = pushEvents; + } + + public Boolean getTag_push_events() { + return tag_push_events; + } + + public void setTag_push_events(Boolean tag_push_events) { + this.tag_push_events = tag_push_events; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Boolean getWiki_page_events() { + return wiki_page_events; + } + + public void setWiki_page_events(Boolean wiki_page_events) { + this.wiki_page_events = wiki_page_events; + } +} \ No newline at end of file diff --git a/src/main/java/com/messners/gitlab/api/models/ProjectSnippet.java b/src/main/java/com/messners/gitlab/api/models/ProjectSnippet.java index 5edab2d5f6bafc329e076814336369ab5ee30909..fddc41e024ba5d04231bf4f1892eb10ed72f9850 100644 --- a/src/main/java/com/messners/gitlab/api/models/ProjectSnippet.java +++ b/src/main/java/com/messners/gitlab/api/models/ProjectSnippet.java @@ -10,67 +10,76 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class ProjectSnippet { - private Author author; - private Date createdAt; - private Date expiresAt; - private String fileName; - private Integer id; - private String title; - private String updatedAt; - - public Author getAuthor () { - return this.author; - } - - public void setAuthor (Author author) { - this.author = author; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public Date getExpiresAt () { - return this.expiresAt; - } - - public void setExpiresAt (Date expiresAt) { - this.expiresAt = expiresAt; - } - - public String getFileName () { - return this.fileName; - } - - public void setFileName (String fileName) { - this.fileName = fileName; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public String getTitle () { - return this.title; - } - - public void setTitle (String title) { - this.title = title; - } - - public String getUpdatedAt () { - return this.updatedAt; - } - - public void setUpdatedAt (String updatedAt) { - this.updatedAt = updatedAt; - } + private Author author; + private Date createdAt; + private Date expiresAt; + private String fileName; + private Integer id; + private String title; + private String updatedAt; + private String webUrl; + + public Author getAuthor() { + return this.author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getExpiresAt() { + return this.expiresAt; + } + + public void setExpiresAt(Date expiresAt) { + this.expiresAt = expiresAt; + } + + public String getFileName() { + return this.fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getTitle() { + return this.title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getUpdatedAt() { + return this.updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getWebUrl() { + return webUrl; + } + + public void setWebUrl(String webUrl) { + this.webUrl = webUrl; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Repository.java b/src/main/java/com/messners/gitlab/api/models/Repository.java index 6e1df6930db000a326f6a90d49ae083ec8007ba5..a5fb3d0d515ee0c3bcefbef5c23135552f63f1ba 100644 --- a/src/main/java/com/messners/gitlab/api/models/Repository.java +++ b/src/main/java/com/messners/gitlab/api/models/Repository.java @@ -8,40 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Repository { - private String description; - private String homepage; - private String name; - private String url; - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public String getHomepage () { - return this.homepage; - } - - public void setHomepage (String homepage) { - this.homepage = homepage; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getUrl () { - return this.url; - } - - public void setUrl (String url) { - this.url = url; - } + private String description; + private String homepage; + private String name; + private String url; + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getHomepage() { + return this.homepage; + } + + public void setHomepage(String homepage) { + this.homepage = homepage; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return this.url; + } + + public void setUrl(String url) { + this.url = url; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/RepositoryFile.java b/src/main/java/com/messners/gitlab/api/models/RepositoryFile.java index 526eee8f86e70c0dc7d4a164fdfdb4805aec5623..4b3096996110031efd290874139272cd63d13ddd 100644 --- a/src/main/java/com/messners/gitlab/api/models/RepositoryFile.java +++ b/src/main/java/com/messners/gitlab/api/models/RepositoryFile.java @@ -1,7 +1,6 @@ package com.messners.gitlab.api.models; - import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -10,76 +9,85 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class RepositoryFile { - private String fileName; //file name only, Ex. lib/class.rb - private String filePath; //full path to file. Ex. lib/class.rb + private String fileName; // file name only, Ex. class.rb + private String filePath; // full path to file. Ex. lib/class.rb private Integer size; private String encoding; private String content; private String ref; private String blobId; private String commitId; + private String lastCommitId; + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } - public String getFileName() { - return fileName; - } + public String getFilePath() { + return filePath; + } - public void setFileName(String fileName) { - this.fileName = fileName; - } + public void setFilePath(String filePath) { + this.filePath = filePath; + } - public String getFilePath() { - return filePath; - } + public Integer getSize() { + return size; + } - public void setFilePath(String filePath) { - this.filePath = filePath; - } + public void setSize(Integer size) { + this.size = size; + } - public Integer getSize() { - return size; - } + public String getEncoding() { + return encoding; + } - public void setSize(Integer size) { - this.size = size; - } + public void setEncoding(String encoding) { + this.encoding = encoding; + } - public String getEncoding() { - return encoding; - } + public String getContent() { + return content; + } - public void setEncoding(String encoding) { - this.encoding = encoding; - } + public void setContent(String content) { + this.content = content; + } - public String getContent() { - return content; - } + public String getRef() { + return ref; + } - public void setContent(String content) { - this.content = content; - } + public void setRef(String ref) { + this.ref = ref; + } - public String getRef() { - return ref; - } + public String getBlobId() { + return blobId; + } - public void setRef(String ref) { - this.ref = ref; - } + public void setBlobId(String blobId) { + this.blobId = blobId; + } - public String getBlobId() { - return blobId; - } + public String getCommitId() { + return commitId; + } - public void setBlobId(String blobId) { - this.blobId = blobId; - } + public void setCommitId(String commitId) { + this.commitId = commitId; + } - public String getCommitId() { - return commitId; - } + public String getLastCommitId() { + return lastCommitId; + } - public void setCommitId(String commitId) { - this.commitId = commitId; - } + public void setLastCommitId(String lastCommitId) { + this.lastCommitId = lastCommitId; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Session.java b/src/main/java/com/messners/gitlab/api/models/Session.java index 4cce73a225a66a9187ca91b0244f7fc7dd2c430d..2fd5b3dc456357a2e6e02061cae8aa8ab79e0206 100644 --- a/src/main/java/com/messners/gitlab/api/models/Session.java +++ b/src/main/java/com/messners/gitlab/api/models/Session.java @@ -1,6 +1,7 @@ package com.messners.gitlab.api.models; import java.util.Date; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; @@ -10,166 +11,211 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Session { - private String bio; - private Boolean blocked; - private Boolean canCreateGroup; - private Boolean canCreateProject; - private Boolean canCreateTeam; - private Date createdAt; - private Boolean darkScheme; - private String email; - private Integer id; - private Boolean isAdmin; - private String linkedin; - private String name; - private String privateToken; - private String skype; - private Integer themeId; - private String twitter; - private String username; - private String websiteUrl; - - public String getBio () { - return this.bio; - } - - public void setBio (String bio) { - this.bio = bio; - } - - public Boolean getBlocked () { - return this.blocked; - } - - public void setBlocked (Boolean blocked) { - this.blocked = blocked; - } - - public Boolean getCanCreateGroup () { - return this.canCreateGroup; - } - - public void setCanCreateGroup (Boolean canCreateGroup) { - this.canCreateGroup = canCreateGroup; - } - - public Boolean getCanCreateProject () { - return this.canCreateProject; - } - - public void setCanCreateProject (Boolean canCreateProject) { - this.canCreateProject = canCreateProject; - } - - public Boolean getCanCreateTeam () { - return this.canCreateTeam; - } - - public void setCanCreateTeam (Boolean canCreateTeam) { - this.canCreateTeam = canCreateTeam; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public Boolean getDarkScheme () { - return this.darkScheme; - } - - public void setDarkScheme (Boolean darkScheme) { - this.darkScheme = darkScheme; - } - - public String getEmail () { - return this.email; - } - - public void setEmail (String email) { - this.email = email; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Boolean getIsAdmin () { - return this.isAdmin; - } - - public void setIsAdmin (Boolean isAdmin) { - this.isAdmin = isAdmin; - } - - public String getLinkedin () { - return this.linkedin; - } - - public void setLinkedin (String linkedin) { - this.linkedin = linkedin; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getPrivateToken () { - return this.privateToken; - } + private String avatarUrl; + private String bio; + private Boolean blocked; + private Boolean canCreateGroup; + private Boolean canCreateProject; + private Integer colorSchemeId; + private Date createdAt; + private Date currentSignInAt; + private Boolean darkScheme; + private String email; + private Integer id; + private List identities; + private Boolean isAdmin; + private String linkedin; + private String name; + private String privateToken; + private Integer projectLimit; + private String skype; + private Integer themeId; + private String twitter; + private Boolean twoFactorEnabled; + private String username; + private String websiteUrl; + + public String getAvatarUrl() { + return avatarUrl; + } + + public void setAvatarUrl(String avatarUrl) { + this.avatarUrl = avatarUrl; + } + + public String getBio() { + return bio; + } + + public void setBio(String bio) { + this.bio = bio; + } + + public Boolean getBlocked() { + return blocked; + } + + public void setBlocked(Boolean blocked) { + this.blocked = blocked; + } + + public Boolean getCanCreateGroup() { + return canCreateGroup; + } + + public void setCanCreateGroup(Boolean canCreateGroup) { + this.canCreateGroup = canCreateGroup; + } + + public Boolean getCanCreateProject() { + return canCreateProject; + } + + public void setCanCreateProject(Boolean canCreateProject) { + this.canCreateProject = canCreateProject; + } + + public Integer getColorSchemeId() { + return colorSchemeId; + } + + public void setColorSchemeId(Integer colorSchemeId) { + this.colorSchemeId = colorSchemeId; + } + + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getCurrentSignInAt() { + return currentSignInAt; + } + + public void setCurrentSignInAt(Date currentSignInAt) { + this.currentSignInAt = currentSignInAt; + } + + public Boolean getDarkScheme() { + return darkScheme; + } + + public void setDarkScheme(Boolean darkScheme) { + this.darkScheme = darkScheme; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public List getIdentities() { + return identities; + } + + public void setIdentities(List identities) { + this.identities = identities; + } + + public Boolean getIsAdmin() { + return isAdmin; + } - public void setPrivateToken (String privateToken) { - this.privateToken = privateToken; - } + public void setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + } - public String getSkype () { - return this.skype; - } + public String getLinkedin() { + return linkedin; + } - public void setSkype (String skype) { - this.skype = skype; - } + public void setLinkedin(String linkedin) { + this.linkedin = linkedin; + } - public Integer getThemeId () { - return this.themeId; - } + public String getName() { + return name; + } - public void setThemeId (Integer themeId) { - this.themeId = themeId; - } + public void setName(String name) { + this.name = name; + } - public String getTwitter () { - return this.twitter; - } + public String getPrivateToken() { + return privateToken; + } - public void setTwitter (String twitter) { - this.twitter = twitter; - } + public void setPrivateToken(String privateToken) { + this.privateToken = privateToken; + } - public String getUsername () { - return this.username; - } + public Integer getProjectLimit() { + return projectLimit; + } - public void setUsername (String username) { - this.username = username; - } + public void setProjectLimit(Integer projectLimit) { + this.projectLimit = projectLimit; + } - public String getWebsiteUrl () { - return this.websiteUrl; - } + public String getSkype() { + return skype; + } - public void setWebsiteUrl (String websiteUrl) { - this.websiteUrl = websiteUrl; - } + public void setSkype(String skype) { + this.skype = skype; + } + + public Integer getThemeId() { + return themeId; + } + + public void setThemeId(Integer themeId) { + this.themeId = themeId; + } + + public String getTwitter() { + return twitter; + } + + public void setTwitter(String twitter) { + this.twitter = twitter; + } + + public Boolean getTwoFactorEnabled() { + return twoFactorEnabled; + } + + public void setTwoFactorEnabled(Boolean twoFactorEnabled) { + this.twoFactorEnabled = twoFactorEnabled; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getWebsiteUrl() { + return websiteUrl; + } + + public void setWebsiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/SystemHook.java b/src/main/java/com/messners/gitlab/api/models/SystemHook.java index 00ffc8cc088bc6104c7a0176ab54dbc272d93695..30ac58a2198ce69c537eaa1056209463a6202b19 100644 --- a/src/main/java/com/messners/gitlab/api/models/SystemHook.java +++ b/src/main/java/com/messners/gitlab/api/models/SystemHook.java @@ -8,58 +8,58 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class SystemHook { - private String eventName; - private String name; - private String ownerEmail; - private String ownerName; - private String path; - private Integer projectId; + private String eventName; + private String name; + private String ownerEmail; + private String ownerName; + private String path; + private Integer projectId; - public String getEventName () { - return this.eventName; - } + public String getEventName() { + return this.eventName; + } - public void setEventName (String eventName) { - this.eventName = eventName; - } + public void setEventName(String eventName) { + this.eventName = eventName; + } - public String getName () { - return this.name; - } + public String getName() { + return this.name; + } - public void setName (String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getOwnerEmail () { - return this.ownerEmail; - } + public String getOwnerEmail() { + return this.ownerEmail; + } - public void setOwnerEmail (String ownerEmail) { - this.ownerEmail = ownerEmail; - } + public void setOwnerEmail(String ownerEmail) { + this.ownerEmail = ownerEmail; + } - public String getOwnerName () { - return this.ownerName; - } + public String getOwnerName() { + return this.ownerName; + } - public void setOwnerName (String ownerName) { - this.ownerName = ownerName; - } + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } - public String getPath () { - return this.path; - } + public String getPath() { + return this.path; + } - public void setPath (String path) { - this.path = path; - } + public void setPath(String path) { + this.path = path; + } - public Integer getProjectId () { - return this.projectId; - } + public Integer getProjectId() { + return this.projectId; + } - public void setProjectId (Integer projectId) { - this.projectId = projectId; - } + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/Tag.java b/src/main/java/com/messners/gitlab/api/models/Tag.java index d01d2f34968e36765dece90adae42045c2e0649b..adddc51bbfc8237fa6b0186401faa0b13b56044d 100644 --- a/src/main/java/com/messners/gitlab/api/models/Tag.java +++ b/src/main/java/com/messners/gitlab/api/models/Tag.java @@ -8,31 +8,40 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) public class Tag { - private Commit commit; - private String name; - private Boolean isProtected; - - public Commit getCommit () { - return this.commit; - } - - public void setCommit (Commit commit) { - this.commit = commit; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public Boolean getProtected () { - return this.isProtected; - } - - public void setProtected (Boolean isProtected) { - this.isProtected = isProtected; - } + private Commit commit; + private String message; + private String name; + private Release release; + + public Commit getCommit() { + return this.commit; + } + + public void setCommit(Commit commit) { + this.commit = commit; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public Release getRelease() { + return release; + } + + public void setRelease(Release release) { + this.release = release; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/TreeItem.java b/src/main/java/com/messners/gitlab/api/models/TreeItem.java index 50855257ab0b027943ae163304f59eb9b85665e6..cd9af985659f61b2f8a61e242097b8f051e789b5 100644 --- a/src/main/java/com/messners/gitlab/api/models/TreeItem.java +++ b/src/main/java/com/messners/gitlab/api/models/TreeItem.java @@ -7,50 +7,58 @@ import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class TreeItem { - - public enum Type { - TREE, - BLOB; - - public String toString () { - return (name().toLowerCase()); - } - } - - private String id; - private String mode; - private String name; - private Type type; - - public String getId () { - return this.id; - } - - public void setId (String id) { - this.id = id; - } - - public String getMode () { - return this.mode; - } - - public void setMode (String mode) { - this.mode = mode; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public Type getType () { - return this.type; - } - - public void setType (Type type) { - this.type = type; - } + + public enum Type { + TREE, BLOB; + + public String toString() { + return (name().toLowerCase()); + } + } + + private String id; + private String mode; + private String name; + private String path; + private Type type; + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getMode() { + return this.mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPath() { + return this.path; + } + + public void setPath(String path) { + this.path = path; + } + + public Type getType() { + return this.type; + } + + public void setType(Type type) { + this.type = type; + } } diff --git a/src/main/java/com/messners/gitlab/api/models/User.java b/src/main/java/com/messners/gitlab/api/models/User.java index 4535e6187db065dc7125503fa4dc149a2803813c..3618fbc13365965b565ff05da27bccb4e5546995 100644 --- a/src/main/java/com/messners/gitlab/api/models/User.java +++ b/src/main/java/com/messners/gitlab/api/models/User.java @@ -1,170 +1,7 @@ package com.messners.gitlab.api.models; -import java.util.Date; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement -@XmlAccessorType(XmlAccessType.FIELD) -public class User { - - private String bio; - private Boolean canCreateGroup; - private Integer colorSchemeId; - private Date createdAt; - private String email; - private String externUid; - private Integer id; - private Boolean isAdmin; - private String linkedin; - private String name; - private String provider; - private String skype; - private String state; - private Integer themeId; - private String twitter; - private String username; - private String websiteUrl; - - public String getBio () { - return this.bio; - } - - public void setBio (String bio) { - this.bio = bio; - } - - public boolean getCanCreateGroup () { - return this.canCreateGroup; - } - - public void setCanCreateGroup (boolean canCreateGroup) { - this.canCreateGroup = canCreateGroup; - } - - public Integer getColorSchemeId () { - return this.colorSchemeId; - } - - public void setColorSchemeId (Integer colorSchemeId) { - this.colorSchemeId = colorSchemeId; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getEmail () { - return this.email; - } - - public void setEmail (String email) { - this.email = email; - } - - public String getExternUid () { - return this.externUid; - } - - public void setExternUid (String externUid) { - this.externUid = externUid; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public boolean getIsAdmin () { - return this.isAdmin; - } - - public void setIsAdmin (boolean isAdmin) { - this.isAdmin = isAdmin; - } - - public String getLinkedin () { - return this.linkedin; - } - - public void setLinkedin (String linkedin) { - this.linkedin = linkedin; - } - - public String getName () { - return this.name; - } - - public void setName (String name) { - this.name = name; - } - - public String getProvider () { - return this.provider; - } - - public void setProvider (String provider) { - this.provider = provider; - } - - public String getSkype () { - return this.skype; - } - - public void setSkype (String skype) { - this.skype = skype; - } - - public String getState () { - return this.state; - } - - public void setState (String state) { - this.state = state; - } - - public Integer getThemeId () { - return this.themeId; - } - - public void setThemeId (Integer themeId) { - this.themeId = themeId; - } - - public String getTwitter () { - return this.twitter; - } - - public void setTwitter (String twitter) { - this.twitter = twitter; - } - - public String getUsername () { - return this.username; - } - - public void setUsername (String username) { - this.username = username; - } - - public String getWebsiteUrl () { - return this.websiteUrl; - } - - public void setWebsiteUrl (String websiteUrl) { - this.websiteUrl = websiteUrl; - } - - public static final boolean isValid (User user) { - return (user != null && user.getId() != null); - } +public class User extends AbstractUser { } diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventObject.java b/src/main/java/com/messners/gitlab/api/webhook/EventObject.java index 5b55b37de55a3bb3084abc07bca219da45f85a21..6ca1527921d487d2683202539b7de7f6018c5b78 100644 --- a/src/main/java/com/messners/gitlab/api/webhook/EventObject.java +++ b/src/main/java/com/messners/gitlab/api/webhook/EventObject.java @@ -1,38 +1,44 @@ package com.messners.gitlab.api.webhook; import javax.xml.bind.annotation.XmlAccessType; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "objectKind", + visible = true +) +@JsonSubTypes({ + @JsonSubTypes.Type(value = IssueEvent.class, name = IssueEvent.OBJECT_KIND), + @JsonSubTypes.Type(value = PushEvent.class, name = PushEvent.OBJECT_KIND), + @JsonSubTypes.Type(value = MergeRequestEvent.class, name = MergeRequestEvent.OBJECT_KIND) +}) @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class EventObject { - - public enum ObjectKind { - MERGE_REQUEST, - ISSUE; - - public String toString () { - return (name().toLowerCase()); - } - } - - private EventObjectAttributes objectAttributes; - private ObjectKind objectKind; - - public EventObjectAttributes getObjectAttributes () { - return this.objectAttributes; - } + + public static enum ObjectKind { + ISSUE, MERGE_REQUEST, PUSH; + + @Override + public String toString() { + return (name().toLowerCase()); + } + } - public void setObjectAttributes (EventObjectAttributes objectAttributes) { - this.objectAttributes = objectAttributes; - } + private ObjectKind objectKind; - public ObjectKind getObjectKind () { - return this.objectKind; - } + public ObjectKind getObjectKind() { + return this.objectKind; + } - public void setObjectKind (ObjectKind objectKind) { - this.objectKind = objectKind; - } + public void setObjectKind(ObjectKind objectKind) { + this.objectKind = objectKind; + } } diff --git a/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java b/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java index 4e4a987887e7ca567476f63ad0cbd8c6fb072180..a68b81adb851ff80cb3afcba33bd507de1536f26 100644 --- a/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java +++ b/src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java @@ -7,187 +7,187 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement(name = "object_attributes") -@XmlAccessorType (XmlAccessType.FIELD) +@XmlAccessorType(XmlAccessType.FIELD) public class EventObjectAttributes { - private Integer assigneeId; - private Integer authorId; - private String branchName; - private Date createdAt; - private String description; - private Integer id; - private Integer iid; - private String mergeStatus; - private String milestoneId; - private Integer position; - private Integer projectId; - private String sourceBranch; - private Integer sourceProjectId; - private String stCommits; - private String stDiffs; - private String state; - private String targetBranch; - private Integer targetProjectId; - private String title; - private Date updatedAt; - - public Integer getAssigneeId () { - return this.assigneeId; - } - - public void setAssigneeId (Integer assigneeId) { - this.assigneeId = assigneeId; - } - - public Integer getAuthorId () { - return this.authorId; - } - - public void setAuthorId (Integer authorId) { - this.authorId = authorId; - } - - public String getBranchName () { - return this.branchName; - } - - public void setBranchName (String branchName) { - this.branchName = branchName; - } - - public Date getCreatedAt () { - return this.createdAt; - } - - public void setCreatedAt (Date createdAt) { - this.createdAt = createdAt; - } - - public String getDescription () { - return this.description; - } - - public void setDescription (String description) { - this.description = description; - } - - public Integer getId () { - return this.id; - } - - public void setId (Integer id) { - this.id = id; - } - - public Integer getIid () { - return this.iid; - } - - public void setIid (Integer iid) { - this.iid = iid; - } - - public String getMergeStatus () { - return this.mergeStatus; - } - - public void setMergeStatus (String mergeStatus) { - this.mergeStatus = mergeStatus; - } - - public String getMilestoneId () { - return this.milestoneId; - } - - public void setMilestoneId (String milestoneId) { - this.milestoneId = milestoneId; - } - - public Integer getPosition () { - return this.position; - } - - public void setPosition (Integer position) { - this.position = position; - } - - public Integer getProjectId () { - return this.projectId; - } - - public void setProjectId (Integer projectId) { - this.projectId = projectId; - } - - public String getSourceBranch () { - return this.sourceBranch; - } - - public void setSourceBranch (String sourceBranch) { - this.sourceBranch = sourceBranch; - } - - public Integer getSourceProjectId () { - return this.sourceProjectId; - } + private Integer assigneeId; + private Integer authorId; + private String branchName; + private Date createdAt; + private String description; + private Integer id; + private Integer iid; + private String mergeStatus; + private String milestoneId; + private Integer position; + private Integer projectId; + private String sourceBranch; + private Integer sourceProjectId; + private String stCommits; + private String stDiffs; + private String state; + private String targetBranch; + private Integer targetProjectId; + private String title; + private Date updatedAt; + + public Integer getAssigneeId() { + return this.assigneeId; + } + + public void setAssigneeId(Integer assigneeId) { + this.assigneeId = assigneeId; + } + + public Integer getAuthorId() { + return this.authorId; + } + + public void setAuthorId(Integer authorId) { + this.authorId = authorId; + } + + public String getBranchName() { + return this.branchName; + } + + public void setBranchName(String branchName) { + this.branchName = branchName; + } + + public Date getCreatedAt() { + return this.createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getIid() { + return this.iid; + } + + public void setIid(Integer iid) { + this.iid = iid; + } + + public String getMergeStatus() { + return this.mergeStatus; + } + + public void setMergeStatus(String mergeStatus) { + this.mergeStatus = mergeStatus; + } + + public String getMilestoneId() { + return this.milestoneId; + } + + public void setMilestoneId(String milestoneId) { + this.milestoneId = milestoneId; + } + + public Integer getPosition() { + return this.position; + } + + public void setPosition(Integer position) { + this.position = position; + } + + public Integer getProjectId() { + return this.projectId; + } + + public void setProjectId(Integer projectId) { + this.projectId = projectId; + } + + public String getSourceBranch() { + return this.sourceBranch; + } + + public void setSourceBranch(String sourceBranch) { + this.sourceBranch = sourceBranch; + } + + public Integer getSourceProjectId() { + return this.sourceProjectId; + } - public void setSourceProjectId (Integer sourceProjectId) { - this.sourceProjectId = sourceProjectId; - } + public void setSourceProjectId(Integer sourceProjectId) { + this.sourceProjectId = sourceProjectId; + } - public String getStCommits () { - return this.stCommits; - } + public String getStCommits() { + return this.stCommits; + } - public void setStCommits (String stCommits) { - this.stCommits = stCommits; - } + public void setStCommits(String stCommits) { + this.stCommits = stCommits; + } - public String getStDiffs () { - return this.stDiffs; - } + public String getStDiffs() { + return this.stDiffs; + } - public void setStDiffs (String stDiffs) { - this.stDiffs = stDiffs; - } + public void setStDiffs(String stDiffs) { + this.stDiffs = stDiffs; + } - public String getState () { - return this.state; - } + public String getState() { + return this.state; + } - public void setState (String state) { - this.state = state; - } + public void setState(String state) { + this.state = state; + } - public String getTargetBranch () { - return this.targetBranch; - } + public String getTargetBranch() { + return this.targetBranch; + } - public void setTargetBranch (String targetBranch) { - this.targetBranch = targetBranch; - } + public void setTargetBranch(String targetBranch) { + this.targetBranch = targetBranch; + } - public Integer getTargetProjectId () { - return this.targetProjectId; - } + public Integer getTargetProjectId() { + return this.targetProjectId; + } - public void setTargetProjectId (Integer targetProjectId) { - this.targetProjectId = targetProjectId; - } + public void setTargetProjectId(Integer targetProjectId) { + this.targetProjectId = targetProjectId; + } - public String getTitle () { - return this.title; - } + public String getTitle() { + return this.title; + } - public void setTitle (String title) { - this.title = title; - } + public void setTitle(String title) { + this.title = title; + } - public Date getUpdatedAt () { - return this.updatedAt; - } + public Date getUpdatedAt() { + return this.updatedAt; + } - public void setUpdatedAt (Date updatedAt) { - this.updatedAt = updatedAt; - } + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } } diff --git a/src/main/java/com/messners/gitlab/api/webhook/PushEvent.java b/src/main/java/com/messners/gitlab/api/webhook/PushEvent.java index f2c89aa05d9f40ac1614c119128794dd7fbb2e35..ab1048a2c7a7ef4fd9b0d9d205ea5650a0109030 100644 --- a/src/main/java/com/messners/gitlab/api/webhook/PushEvent.java +++ b/src/main/java/com/messners/gitlab/api/webhook/PushEvent.java @@ -5,26 +5,32 @@ import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; import com.fasterxml.jackson.annotation.JsonIgnore; - import com.messners.gitlab.api.models.Commit; +import com.messners.gitlab.api.models.Project; import com.messners.gitlab.api.models.Repository; -@XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) -public class PushEvent { +public class PushEvent extends EventObject { + + public static final String OBJECT_KIND = "push"; private String after; private String before; - private List commits; - private Integer projectId; private String ref; - private Repository repository; - private Integer totalCommitsCount; + private String checkoutSha; + private Integer userId; private String userName; + private String userEmail; + private String userAvatar; + + private Integer projectId; + private Project project; + private Repository repository; + private List commits; + private Integer totalCommitsCount; public String getAfter() { return this.after; @@ -41,13 +47,53 @@ public class PushEvent { public void setBefore(String before) { this.before = before; } + + public String getRef() { + return this.ref; + } - public List getCommits() { - return this.commits; + public void setRef(String ref) { + this.ref = ref; } - public void setCommits(List commits) { - this.commits = commits; + public String getCheckoutSha() { + return checkoutSha; + } + + public void setCheckoutSha(String checkoutSha) { + this.checkoutSha = checkoutSha; + } + + public Integer getUserId() { + return this.userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + public String getUserAvatar() { + return userAvatar; + } + + public void setUserAvatar(String userAvatar) { + this.userAvatar = userAvatar; } public Integer getProjectId() { @@ -58,12 +104,12 @@ public class PushEvent { this.projectId = projectId; } - public String getRef() { - return this.ref; + public Project getProject() { + return project; } - public void setRef(String ref) { - this.ref = ref; + public void setProject(Project project) { + this.project = project; } public Repository getRepository() { @@ -73,6 +119,14 @@ public class PushEvent { public void setRepository(Repository repository) { this.repository = repository; } + + public List getCommits() { + return this.commits; + } + + public void setCommits(List commits) { + this.commits = commits; + } public Integer getTotalCommitsCount() { return this.totalCommitsCount; @@ -82,22 +136,7 @@ public class PushEvent { this.totalCommitsCount = totalCommitsCount; } - public Integer getUserId() { - return this.userId; - } - - public void setUserId(Integer userId) { - this.userId = userId; - } - - public String getUserName() { - return this.userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - + /** * Gets the branch name from the ref. Will return null if the ref does not start with "refs/heads/". * diff --git a/src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java b/src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java index baf07719d67c4af45bb7e22ef0dce12453515803..7345fd4712976457f75ae9b57d35fbd54dd79d0c 100644 --- a/src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java +++ b/src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java @@ -14,8 +14,9 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; - +import com.fasterxml.jackson.databind.SerializationFeature; import com.messners.gitlab.api.models.Branch; +import com.messners.gitlab.api.models.Commit; import com.messners.gitlab.api.models.Diff; import com.messners.gitlab.api.models.Event; import com.messners.gitlab.api.models.Group; @@ -23,7 +24,6 @@ import com.messners.gitlab.api.models.Issue; import com.messners.gitlab.api.models.Key; import com.messners.gitlab.api.models.Member; import com.messners.gitlab.api.models.MergeRequest; -import com.messners.gitlab.api.models.MergeRequestComment; import com.messners.gitlab.api.models.Milestone; import com.messners.gitlab.api.models.Note; import com.messners.gitlab.api.models.Project; @@ -46,6 +46,7 @@ public class TestGitLabApiBeans { @BeforeClass public static void setup() { jacksonJson = new JacksonJson(); + jacksonJson.getObjectMapper().configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); } @Test @@ -57,7 +58,17 @@ public class TestGitLabApiBeans { branch = makeFakeApiCall(Branch.class, "bad-branch"); assertTrue(!Branch.isValid(branch)); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Test + public void testCommit() { + try { + Commit commit = makeFakeApiCall(Commit.class, "commit"); + assertTrue(compareJson(commit, "commit")); } catch (Exception e) { e.printStackTrace(); } @@ -139,7 +150,7 @@ public class TestGitLabApiBeans { e.printStackTrace(); } } - +/* @Test public void testMergeRequestComment() { @@ -150,7 +161,7 @@ public class TestGitLabApiBeans { e.printStackTrace(); } } - +*/ @Test public void testMergeRequest() { diff --git a/src/test/resources/com/messners/gitlab/api/branch.json b/src/test/resources/com/messners/gitlab/api/branch.json index d18c37ccccdb97b7b4481c9775f545d149a2a1ae..afd869a79bab46ac64845582b14635c67a41f9e1 100644 --- a/src/test/resources/com/messners/gitlab/api/branch.json +++ b/src/test/resources/com/messners/gitlab/api/branch.json @@ -1,21 +1,20 @@ - { - "name": "master", - "commit": { - "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", - "parents": [{ "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8" }], - "tree": "46e82de44b1061621357f24c05515327f2795a95", - "message": "add projects API", - "author": { - "name": "John Smith", - "email": "john@example.com" - }, - "committer": { - "name": "John Smith", - "email": "john@example.com" - }, - "authored_date": "2012-06-27T12:51:39Z", - "committed_date": "2012-06-28T10:44:20Z" - }, - "protected": true +{ + "name": "master", + "merged": false, + "protected": true, + "developers_can_push": false, + "developers_can_merge": false, + "commit": { + "author_email": "john@example.com", + "author_name": "John Smith", + "authored_date": "2012-06-27T05:51:39Z", + "committed_date": "2012-06-28T03:44:20Z", + "committer_email": "john@example.com", + "committer_name": "John Smith", + "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", + "message": "add projects API", + "parent_ids": [ + "4ad91d3c1144c406e50c7b33bae684bd6837faf8" + ] + } } - diff --git a/src/test/resources/com/messners/gitlab/api/commit.json b/src/test/resources/com/messners/gitlab/api/commit.json index ecd262127f54727860cfd55d8786cd0811391f8e..beb3c47721c4c36de6260f79c413f5fcbe8caa03 100644 --- a/src/test/resources/com/messners/gitlab/api/commit.json +++ b/src/test/resources/com/messners/gitlab/api/commit.json @@ -1,9 +1,22 @@ { - "id": "ed899a2f4b50b4370feeea94676502b42383c746", - "short_id": "ed899a2f4b5", - "title": "Replace sanitize with escape once", - "author_name": "Dmitriy Zaporozhets", - "author_email": "dzaporozhets@sphereconsultinginc.com", - "created_at": "2012-09-20T08:50:22Z" + "id": "6104942438c14ec7bd21c6cd5bd995272b3faff6", + "short_id": "6104942438c", + "title": "Sanitize for network graph", + "author_name": "randx", + "author_email": "dmitriy.zaporozhets@gmail.com", + "committer_name": "Dmitriy", + "committer_email": "dmitriy.zaporozhets@gmail.com", + "created_at": "2012-09-20T06:06:12Z", + "message": "Sanitize for network graph", + "committed_date": "2012-09-20T06:06:12Z", + "authored_date": "2012-09-20T06:06:12Z", + "parent_ids": [ + "ae1d9fb46aa2b07ee9836d49862ec4e2c46fbbba" + ], + "stats": { + "additions": 15, + "deletions": 10, + "total": 25 + }, + "status": "running" } - diff --git a/src/test/resources/com/messners/gitlab/api/event-object.json b/src/test/resources/com/messners/gitlab/api/event-object.json index bc8cddf4d3f1c7594d7d60630251f27ce4deafbc..335415ce9380e99b552afaeee8ea2fb6cca51ea0 100644 --- a/src/test/resources/com/messners/gitlab/api/event-object.json +++ b/src/test/resources/com/messners/gitlab/api/event-object.json @@ -16,6 +16,6 @@ "state":"opened", "iid":23, "merge_status":"unchecked", - "target_project_id":14, + "target_project_id":14 } } diff --git a/src/test/resources/com/messners/gitlab/api/event.json b/src/test/resources/com/messners/gitlab/api/event.json index 208e17648548c89f40c15b8448a74bed5d6b823b..2a62af8035f59ead8589c8fe020728b2e2a501f7 100644 --- a/src/test/resources/com/messners/gitlab/api/event.json +++ b/src/test/resources/com/messners/gitlab/api/event.json @@ -1,30 +1,44 @@ { - "project_id": 15, - "action_name": "opened", - "author_id": 1, - "data": { - "before": "50d4420237a9de7be1304607147aec22e4a14af7", - "after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", - "ref": "refs/heads/master", - "user_id": 1, - "user_name": "Dmitriy Zaporozhets", - "repository": { - "name": "gitlabhq", - "url": "git@dev.gitlab.org:gitlab/gitlabhq.git", - "description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.", - "homepage": "https://dev.gitlab.org/gitlab/gitlabhq" + "title": "this is a title", + "project_id": 15, + "action_name": "opened", + "target_id": 830, + "target_type": "Issue", + "author_id": 1, + "author": { + "name": "Dmitriy Zaporozhets", + "username": "root", + "id": 1, + "state": "active", + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/fox_avatar.png", + "web_url": "http://localhost:3000/root" }, - "commits": [{ - "id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", - "message": "Add simple search to projects in public area", - "timestamp": "2013-05-13T18:18:08Z", - "url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428", - "author": { - "name": "Dmitriy Zaporozhets", - "email": "dmitriy.zaporozhets@gmail.com" - } - }], - "total_commits_count": 1 - } -} - + "author_username": "john", + "data": { + "before": "50d4420237a9de7be1304607147aec22e4a14af7", + "after": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", + "ref": "refs/heads/master", + "user_id": 1, + "user_name": "Dmitriy Zaporozhets", + "repository": { + "name": "gitlabhq", + "url": "git@dev.gitlab.org:gitlab/gitlabhq.git", + "description": "GitLab: self hosted Git management software. \r\nDistributed under the MIT License.", + "homepage": "https://dev.gitlab.org/gitlab/gitlabhq" + }, + "commits": [ + { + "id": "c5feabde2d8cd023215af4d2ceeb7a64839fc428", + "message": "Add simple search to projects in public area", + "timestamp": "2013-05-13T18:18:08Z", + "url": "https://dev.gitlab.org/gitlab/gitlabhq/commit/c5feabde2d8cd023215af4d2ceeb7a64839fc428", + "author": { + "name": "Dmitriy Zaporozhets", + "email": "dmitriy.zaporozhets@gmail.com" + } + } + ], + "total_commits_count": 1 + }, + "target_title": "target title" +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/hook.json b/src/test/resources/com/messners/gitlab/api/hook.json index a42288141b68dd0f401106d148f62872e673dae3..305185b7f9fa358a3259a8cf3fbd33fe229e9e6e 100644 --- a/src/test/resources/com/messners/gitlab/api/hook.json +++ b/src/test/resources/com/messners/gitlab/api/hook.json @@ -5,5 +5,11 @@ "push_events": true, "issues_events": true, "merge_requests_events": true, + "tag_push_events": true, + "note_events": true, + "build_events": true, + "pipeline_events": true, + "wiki_page_events": true, + "enable_ssl_verification": true, "created_at": "2012-10-12T17:04:47Z" } \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/issue.json b/src/test/resources/com/messners/gitlab/api/issue.json index c5174a12b1d9cb98b5e1d663f6ce955d601dc242..b346f899421a3d0787c08d5a576014413657a97a 100644 --- a/src/test/resources/com/messners/gitlab/api/issue.json +++ b/src/test/resources/com/messners/gitlab/api/issue.json @@ -1,39 +1,39 @@ { - "id": 42, - "iid": 4, - "project_id": 8, - "title": "Add user settings", - "description": "", - "labels": [ - "feature" - ], - "milestone": { - "id": 1, - "title": "v1.0", - "description": "", - "due_date": "2012-07-20T00:00:00Z", - "state": "reopenend", - "updated_at": "2012-07-04T13:42:48Z", - "created_at": "2012-07-04T13:42:48Z" - }, - "assignee": { - "id": 2, - "username": "jack_smith", - "email": "jack@example.com", - "name": "Jack Smith", - "state": "active", - "created_at": "2012-05-23T08:01:01Z" - }, - "author": { - "id": 1, - "username": "john_smith", - "email": "john@example.com", - "name": "John Smith", - "state": "active", - "created_at": "2012-05-23T08:00:58Z" - }, - "state": "opened", - "updated_at": "2012-07-12T13:43:19Z", - "created_at": "2012-06-28T12:58:06Z" -} - + "project_id" : 4, + "milestone" : { + "project_id" : 4, + "state" : "closed", + "description" : "Rerum est voluptatem provident consequuntur molestias similique ipsum dolor.", + "iid" : 3, + "id" : 11, + "title" : "v3.0", + "created_at" : "2016-01-04T15:31:39.788Z", + "updated_at" : "2016-01-04T15:31:39.788Z" + }, + "author" : { + "state" : "active", + "web_url" : "https://gitlab.example.com/root", + "username" : "root", + "id" : 1, + "name" : "Administrator" + }, + "description" : "Omnis vero earum sunt corporis dolor et placeat.", + "state" : "closed", + "iid" : 1, + "assignee" : { + "web_url" : "https://gitlab.example.com/lennie", + "state" : "active", + "username" : "lennie", + "id" : 9, + "name" : "Dr. Luella Kovacek" + }, + "labels" : [], + "id" : 41, + "title" : "Ut commodi ullam eos dolores perferendis nihil sunt.", + "updated_at" : "2016-01-04T15:31:46.176Z", + "created_at" : "2016-01-04T15:31:46.176Z", + "subscribed": false, + "user_notes_count": 1, + "web_url": "http://example.com/example/example/issues/1", + "confidential": false +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/key.json b/src/test/resources/com/messners/gitlab/api/key.json index 14bedcb930314ccb27dc332bbe01207eb93235e0..1a8ca7ef18272f3aee9e28645432ae2ad1fc823c 100644 --- a/src/test/resources/com/messners/gitlab/api/key.json +++ b/src/test/resources/com/messners/gitlab/api/key.json @@ -1,7 +1,27 @@ { - "id": 1, - "title" : "Public key", - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", - "created_at":"2013-10-02T11:12:29Z" + "id": 1, + "title": "Sample key 25", + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1256k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + "created_at": "2015-09-03T07:24:44.627Z", + "user": { + "name": "John Smith", + "username": "john_smith", + "id": 25, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/cfa35b8cd2ec278026357769582fa563?s=40\u0026d=identicon", + "web_url": "http://localhost:3000/john_smith", + "created_at": "2015-09-03T07:24:01.670Z", + "is_admin": false, + "skype": "", + "linkedin": "", + "twitter": "", + "email": "john@example.com", + "theme_id": 2, + "color_scheme_id": 1, + "projects_limit": 10, + "identities": [], + "can_create_group": true, + "can_create_project": true, + "two_factor_enabled": false + } } - diff --git a/src/test/resources/com/messners/gitlab/api/member.json b/src/test/resources/com/messners/gitlab/api/member.json index 12b227b30192a0ffaa31dcc9708f60ee8ce081aa..d9f0866b3815e5a52153f486a3d33bee46e79659 100644 --- a/src/test/resources/com/messners/gitlab/api/member.json +++ b/src/test/resources/com/messners/gitlab/api/member.json @@ -1,10 +1,8 @@ { - "id": 1, - "username": "raymond_smith", - "email": "ray@smith.org", - "name": "Raymond Smith", - "state": "active", - "created_at": "2012-10-22T14:13:35Z", - "access_level": 30 -} - + "id": 1, + "username": "raymond_smith", + "name": "Raymond Smith", + "state": "active", + "created_at": "2012-10-22T14:13:35Z", + "access_level": 30 +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/milestone.json b/src/test/resources/com/messners/gitlab/api/milestone.json index efe7b9ec7c8bba603224be938bf7336ae113460c..28cf10319fa7ccea3c5faa3a457ed4acce6a782f 100644 --- a/src/test/resources/com/messners/gitlab/api/milestone.json +++ b/src/test/resources/com/messners/gitlab/api/milestone.json @@ -9,4 +9,3 @@ "updated_at":"2013-10-02T09:24:18Z", "created_at":"2013-10-02T09:24:18Z" } - diff --git a/src/test/resources/com/messners/gitlab/api/note.json b/src/test/resources/com/messners/gitlab/api/note.json index f6c3a29519980771b1792f8ff07920abd0174a47..adb96384f053c754f127b7f00721063c20460f46 100644 --- a/src/test/resources/com/messners/gitlab/api/note.json +++ b/src/test/resources/com/messners/gitlab/api/note.json @@ -1,15 +1,20 @@ { - "id":52, - "title":"Snippet", - "file_name":"snippet.rb", - "author":{ - "id":1, - "username":"pipin", - "email":"admin@example.com", - "name":"Pip", - "state":"active", - "created_at":"2013-09-30T13:46:01Z" + "id": 1659, + "body": "This is a good idea.", + "author": { + "id": 1, + "username": "pipin", + "email": "admin@example.com", + "name": "Pip", + "state": "active", + "created_at": "2013-09-30T13:46:01Z", + "avatar_url": "http://www.gravatar.com/avatar/5224fd70153710e92fb8bcf79ac29d67?s=80&d=identicon", + "web_url": "https://gitlab.example.com/pipin" }, - "updated_at":"2013-10-02T07:34:20Z", - "created_at":"2013-10-02T07:34:20Z" -} + "created_at": "2016-04-06T16:51:53.239Z", + "system": false, + "noteable_id": 52, + "noteable_type": "Snippet", + "upvote": false, + "downvote": false +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/project-snippet.json b/src/test/resources/com/messners/gitlab/api/project-snippet.json index 72683df852b3e4ce6cc66e8a39e4350953879873..a5c585f712693d2f35480918bda583c26711013a 100644 --- a/src/test/resources/com/messners/gitlab/api/project-snippet.json +++ b/src/test/resources/com/messners/gitlab/api/project-snippet.json @@ -11,6 +11,6 @@ "created_at": "2012-05-23T08:00:58Z" }, "updated_at": "2012-06-28T10:52:04Z", - "created_at": "2012-06-28T10:52:04Z" + "created_at": "2012-06-28T10:52:04Z", + "web_url": "http://example.com/example/example/snippets/1" } - diff --git a/src/test/resources/com/messners/gitlab/api/project.json b/src/test/resources/com/messners/gitlab/api/project.json index 881fb415081955433ccc95f30954c326530ab55f..fa62334e377872b1e23730efe0a5c338534221bc 100644 --- a/src/test/resources/com/messners/gitlab/api/project.json +++ b/src/test/resources/com/messners/gitlab/api/project.json @@ -1,34 +1,74 @@ { - "id": 6, - "default_branch": "master", - "public": false, - "visibility_level": 0, - "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", - "http_url_to_repo": "http://example.com/brightbox/puppet.git", - "web_url": "http://example.com/brightbox/puppet", - "owner": { - "id": 4, - "name": "Brightbox", - "created_at": "2013-09-30T13:46:02Z" - }, - "name": "Puppet", - "name_with_namespace": "Brightbox / Puppet", - "path": "puppet", - "path_with_namespace": "brightbox/puppet", - "issues_enabled": true, - "merge_requests_enabled": true, - "wall_enabled": false, - "wiki_enabled": true, - "snippets_enabled": false, + "id": 3, + "default_branch": "master", + "public": false, + "visibility_level": 0, + "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", + "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", + "web_url": "http://example.com/diaspora/diaspora-project-site", + "tag_list": [ + "example", + "disapora project" + ], + "owner": { + "id": 3, + "name": "Diaspora", + "created_at": "2013-09-30T13:46:02Z" + }, + "name": "Diaspora Project Site", + "name_with_namespace": "Diaspora / Diaspora Project Site", + "path": "diaspora-project-site", + "path_with_namespace": "diaspora/diaspora-project-site", + "issues_enabled": true, + "open_issues_count": 1, + "merge_requests_enabled": true, + "builds_enabled": true, + "wiki_enabled": true, + "snippets_enabled": false, + "container_registry_enabled": false, + "created_at": "2013-09-30T13:46:02Z", + "last_activity_at": "2013-09-30T13:46:02Z", + "creator_id": 3, + "namespace": { "created_at": "2013-09-30T13:46:02Z", - "last_activity_at": "2013-09-30T13:46:02Z", - "namespace": { - "created_at": "2013-09-30T13:46:02Z", - "description": "", - "id": 4, - "name": "Brightbox", - "owner_id": 1, - "path": "brightbox", - "updated_at": "2013-09-30T13:46:02Z" + "description": "", + "id": 3, + "name": "Diaspora", + "owner_id": 1, + "path": "diaspora", + "updated_at": "2013-09-30T13:46:02Z" + }, + "permissions": { + "project_access": { + "access_level": 10, + "notification_level": 3 + }, + "group_access": { + "access_level": 50, + "notification_level": 3 + } + }, + "archived": false, + "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", + "shared_runners_enabled": true, + "forks_count": 0, + "star_count": 0, + "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b", + "public_builds": true, + "shared_with_groups": [ + { + "group_id": 4, + "group_name": "Twitter", + "group_access_level": 30 + }, + { + "group_id": 3, + "group_name": "Gitlab Org", + "group_access_level": 10 } -} + ], + "repository_storage": "default", + "only_allow_merge_if_build_succeeds": false, + "only_allow_merge_if_all_discussions_are_resolved": false, + "request_access_enabled": false +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/push-event.json b/src/test/resources/com/messners/gitlab/api/push-event.json index ca91f3b133cd020a50b3eadd34ebbb1fca63675a..eb5ee10abd864240d1dc3f27c98e510334171304 100644 --- a/src/test/resources/com/messners/gitlab/api/push-event.json +++ b/src/test/resources/com/messners/gitlab/api/push-event.json @@ -1,10 +1,30 @@ { + "object_kind": "push", "before": "95790bf891e76fee5e1747ab589903a6a1f80f22", "after": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", "ref": "refs/heads/master", + "checkout_sha": "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", "user_id": 4, "user_name": "John Smith", + "user_email": "john@example.com", + "user_avatar": "https://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=8://s.gravatar.com/avatar/d4c74594d841139328695756648b6bd6?s=80", "project_id": 15, + "project":{ + "name":"Diaspora", + "description":"", + "web_url":"http://example.com/mike/diaspora", + "avatar_url":null, + "git_ssh_url":"git@example.com:mike/diaspora.git", + "git_http_url":"http://example.com/mike/diaspora.git", + "namespace":"Mike", + "visibility_level":0, + "path_with_namespace":"mike/diaspora", + "default_branch":"master", + "homepage":"http://example.com/mike/diaspora", + "url":"git@example.com:mike/diaspora.git", + "ssh_url":"git@example.com:mike/diaspora.git", + "http_url":"http://example.com/mike/diaspora.git" + }, "repository": { "name": "Diaspora", "url": "git@localhost:diaspora.git", diff --git a/src/test/resources/com/messners/gitlab/api/session.json b/src/test/resources/com/messners/gitlab/api/session.json index 18def9352fbbed78cbe9a8eb7812e9a9faaa65cb..d6b0c9e18c6fd766380c94b56469d4040d167963 100644 --- a/src/test/resources/com/messners/gitlab/api/session.json +++ b/src/test/resources/com/messners/gitlab/api/session.json @@ -1,19 +1,24 @@ { - "id": 1, - "username": "john_smith", - "email": "john@example.com", "name": "John Smith", - "private_token": "dd34asd13as", - "blocked": false, - "created_at": "2012-05-23T08:00:58Z", + "username": "john_smith", + "id": 32, + "state": "active", + "avatar_url": null, + "created_at": "2015-01-29T21:07:19.440Z", + "is_admin": true, + "bio": null, "skype": "", "linkedin": "", "twitter": "", "website_url": "", - "dark_scheme": false, + "email": "john@example.com", "theme_id": 1, - "is_admin": false, - "can_create_group" : true, - "can_create_team" : true, - "can_create_project" : true -} + "color_scheme_id": 1, + "projects_limit": 10, + "current_sign_in_at": "2015-07-07T07:10:58.392Z", + "identities": [], + "can_create_group": true, + "can_create_project": true, + "two_factor_enabled": false, + "private_token": "9koXpg98eAheJpvBs5tK" +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/tag.json b/src/test/resources/com/messners/gitlab/api/tag.json index 05ff01978576cca6b684ef08aa440498b9239213..884cebcb5d9dabb0399061de2d1d523b82c1f77a 100644 --- a/src/test/resources/com/messners/gitlab/api/tag.json +++ b/src/test/resources/com/messners/gitlab/api/tag.json @@ -1,23 +1,20 @@ { - "name": "v1.0.0", "commit": { + "author_name": "John Smith", + "author_email": "john@example.com", + "authored_date": "2012-05-28T04:42:42Z", + "committed_date": "2012-05-28T04:42:42Z", + "committer_name": "Jack Smith", + "committer_email": "jack@example.com", "id": "2695effb5807a22ff3d138d593fd856244e155e7", - "parents": [ - - ], - "tree": "38017f2f189336fe4497e9d230c5bb1bf873f08d", "message": "Initial commit", - "author": { - "name": "John Smith", - "email": "john@example.com" - }, - "committer": { - "name": "Jack Smith", - "email": "jack@example.com" - }, - "authored_date": "2012-05-28T11:42:42Z", - "committed_date": "2012-05-28T11:42:42Z" + "parent_ids": [ + "2a4b78934375d7f53875269ffd4f45fd83a84ebe" + ] }, - "protected": false -} - + "release": { + "tag_name": "1.0.0", + "description": "Amazing release. Wow" + }, + "name": "v1.0.0" +} \ No newline at end of file diff --git a/src/test/resources/com/messners/gitlab/api/tree.json b/src/test/resources/com/messners/gitlab/api/tree.json index 17449b65b34a9b20d0947977c6aa0905380dc013..bf1946619a6ade0f38f7c4e5de789f1ca45c53b9 100644 --- a/src/test/resources/com/messners/gitlab/api/tree.json +++ b/src/test/resources/com/messners/gitlab/api/tree.json @@ -1,31 +1,51 @@ -[{ - "name": "assets", - "type": "tree", - "mode": "040000", - "id": "6229c43a7e16fcc7e95f923f8ddadb8281d9c6c6" -}, { - "name": "contexts", - "type": "tree", - "mode": "040000", - "id": "faf1cdf33feadc7973118ca42d35f1e62977e91f" -}, { - "name": "controllers", - "type": "tree", - "mode": "040000", - "id": "95633e8d258bf3dfba3a5268fb8440d263218d74" -}, { - "name": "Rakefile", - "type": "blob", - "mode": "100644", - "id": "35b2f05cbb4566b71b34554cf184a9d0bd9d46d6" -}, { - "name": "VERSION", - "type": "blob", - "mode": "100644", - "id": "803e4a4f3727286c3093c63870c2b6524d30ec4f" -}, { - "name": "config.ru", - "type": "blob", - "mode": "100644", - "id": "dfd2d862237323aa599be31b473d70a8a817943b" -}] +[ + { + "id": "a1e8f8d745cc87e3a9248358d9352bb7f9a0aeba", + "name": "html", + "type": "tree", + "path": "files/html", + "mode": "040000" + }, + { + "id": "4535904260b1082e14f867f7a24fd8c21495bde3", + "name": "images", + "type": "tree", + "path": "files/images", + "mode": "040000" + }, + { + "id": "31405c5ddef582c5a9b7a85230413ff90e2fe720", + "name": "js", + "type": "tree", + "path": "files/js", + "mode": "040000" + }, + { + "id": "cc71111cfad871212dc99572599a568bfe1e7e00", + "name": "lfs", + "type": "tree", + "path": "files/lfs", + "mode": "040000" + }, + { + "id": "fd581c619bf59cfdfa9c8282377bb09c2f897520", + "name": "markdown", + "type": "tree", + "path": "files/markdown", + "mode": "040000" + }, + { + "id": "23ea4d11a4bdd960ee5320c5cb65b5b3fdbc60db", + "name": "ruby", + "type": "tree", + "path": "files/ruby", + "mode": "040000" + }, + { + "id": "7d70e02340bac451f281cecf0a980907974bd8be", + "name": "whitespace", + "type": "blob", + "path": "files/whitespace", + "mode": "100644" + } +] diff --git a/src/test/resources/com/messners/gitlab/api/user.json b/src/test/resources/com/messners/gitlab/api/user.json index 5b67e3f451139ae3ddfb607f4c80dcbb08145397..261300838a7c9b5e46caefe339fe5b2242e10dc2 100644 --- a/src/test/resources/com/messners/gitlab/api/user.json +++ b/src/test/resources/com/messners/gitlab/api/user.json @@ -1,18 +1,31 @@ { - "id": 1, - "username": "john_smith", - "email": "john@example.com", - "name": "John Smith", - "state": "active", - "created_at": "2012-05-23T08:00:58Z", - "skype": "", - "linkedin": "", - "twitter": "", - "website_url": "", - "extern_uid": "john.smith", - "provider": "provider_name", - "theme_id": 1, - "color_scheme_id": 2, - "is_admin": false, - "can_create_group": true -} + "id": 1, + "username": "john_smith", + "email": "john@example.com", + "name": "John Smith", + "state": "active", + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg", + "web_url": "http://localhost:3000/john_smith", + "created_at": "2012-05-23T08:00:58Z", + "is_admin": false, + "skype": "", + "linkedin": "", + "twitter": "", + "website_url": "", + "organization": "", + "last_sign_in_at": "2012-06-01T11:41:01Z", + "confirmed_at": "2012-05-23T09:05:22Z", + "theme_id": 1, + "color_scheme_id": 2, + "projects_limit": 100, + "current_sign_in_at": "2012-06-02T06:36:55Z", + "identities": [ + {"provider": "github", "extern_uid": "2435223452345"}, + {"provider": "bitbucket", "extern_uid": "john_smith"}, + {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"} + ], + "can_create_group": true, + "can_create_project": true, + "two_factor_enabled": true, + "external": false +} \ No newline at end of file