Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Object Attributes #1198

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.gitlab4j.api.utils.JacksonJson;
import org.gitlab4j.api.webhook.MergeRequestEvent.ObjectAttributes;

import com.fasterxml.jackson.annotation.JsonProperty;

public class ExternalStatusCheckEvent implements Serializable {
private static final long serialVersionUID = 1L;

Expand All @@ -15,7 +17,10 @@ public class ExternalStatusCheckEvent implements Serializable {
private EventUser user;
private EventProject project;
private EventRepository repository;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private List<EventLabel> labels;
private MergeRequestChanges changes;
private List<Assignee> assignees;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/IssueEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.gitlab4j.api.models.Assignee;
import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonProperty;

public class IssueEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;

Expand All @@ -14,7 +16,10 @@ public class IssueEvent extends AbstractEvent {
private EventUser user;
private EventProject project;
private EventRepository repository;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private List<Assignee> assignees;
private Assignee assignee;
private List<EventLabel> labels;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/MergeRequestEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.gitlab4j.api.models.Reviewer;
import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonProperty;

public class MergeRequestEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;

Expand All @@ -15,7 +17,10 @@ public class MergeRequestEvent extends AbstractEvent {
private EventUser user;
private EventProject project;
private EventRepository repository;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private List<EventLabel> labels;
private MergeRequestChanges changes;
private List<Assignee> assignees;
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/NoteEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;

public class NoteEvent extends AbstractEvent {
Expand All @@ -19,10 +20,16 @@ public class NoteEvent extends AbstractEvent {
private Long projectId;
private EventProject project;
private EventRepository repository;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private EventCommit commit;
private EventIssue issue;

@JsonProperty(value = "merge_request")
private EventMergeRequest mergeRequest;

private EventSnippet snippet;

@Override
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/PipelineEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
import org.gitlab4j.api.models.Variable;
import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonProperty;

public class PipelineEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;

public static final String X_GITLAB_EVENT = "Pipeline Hook";
public static final String OBJECT_KIND = "pipeline";

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private EventUser user;
private EventProject project;
private EventCommit commit;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/WikiPageEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonProperty;

public class WikiPageEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;

Expand All @@ -11,6 +13,8 @@ public class WikiPageEvent extends AbstractEvent {
private EventUser user;
private EventProject project;
private Wiki wiki;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

public String getObjectKind() {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/gitlab4j/api/webhook/WorkItemEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.gitlab4j.api.models.User;
import org.gitlab4j.api.utils.JacksonJson;

import com.fasterxml.jackson.annotation.JsonProperty;

public class WorkItemEvent extends AbstractEvent {
private static final long serialVersionUID = 1L;

Expand All @@ -14,7 +16,10 @@ public class WorkItemEvent extends AbstractEvent {
private User user;
private EventProject project;
private EventRepository repository;

@JsonProperty(value = "object_attributes")
private ObjectAttributes objectAttributes;

private List<EventLabel> labels;
private WorkItemChanges changes;

Expand Down