Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add optional id for events #178

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
public class ActivityEvent {
@EqualsAndHashCode(callSuper = true)
public class ActivityEvent extends InnerEvent {
@JsonProperty
private String activityId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class ConnectionAcceptedEvent {
public class ConnectionAcceptedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class ConnectionRequestedEvent {
public class ConnectionRequestedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.Data;

@Data
public class FormRepliedEvent {
public class FormRepliedEvent extends InnerEvent {
@JsonProperty
private String formId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class ImCreatedEvent {
public class ImCreatedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.symphony.bdk.workflow.swadl.v1.event;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class InnerEvent {
@JsonProperty
private String id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import lombok.Data;

@Data
public class MessageReceivedEvent {
public class MessageReceivedEvent extends InnerEvent {
@JsonProperty
private String content = "";
@JsonProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class MessageSuppressedEvent {
public class MessageSuppressedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class PostSharedEvent {
public class PostSharedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Not a Datafeed event. Manually created when API calls are made to the bot directly.
*/
@Data
public class RequestReceivedEvent {
public class RequestReceivedEvent extends InnerEvent {
@JsonProperty
private String token;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomCreatedEvent {
public class RoomCreatedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomDeactivatedEvent {
public class RoomDeactivatedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomMemberDemotedFromOwnerEvent {
public class RoomMemberDemotedFromOwnerEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomMemberPromotedToOwnerEvent {
public class RoomMemberPromotedToOwnerEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomReactivatedEvent {
public class RoomReactivatedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class RoomUpdatedEvent {
public class RoomUpdatedEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import javax.annotation.Nullable;

@Data
public class TimerFiredEvent {
public class TimerFiredEvent extends InnerEvent {
@JsonProperty
@Nullable
private String at;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class UserJoinedRoomEvent {
public class UserJoinedRoomEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class UserLeftRoomEvent {
public class UserLeftRoomEvent extends InnerEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import lombok.Data;

@Data
public class UserRequestedToJoinRoomEvent {
public class UserRequestedToJoinRoomEvent extends InnerEvent {
}
25 changes: 25 additions & 0 deletions workflow-language/src/main/resources/swadl-schema-1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,11 @@
"description": "If true, the event is only triggered if the bot is mentioned.",
"type": "boolean",
"default": false
},
"id": {
"description": "Event's identifier, should be unique across workflow. As it can be used as a variable identifier only alphanumerical characters are allowed.",
"type": "string",
"pattern": "^(?!variables$)([a-zA-Z][a-zA-Z0-9_]+)$"
}
}
},
Expand Down Expand Up @@ -1272,6 +1277,11 @@
"room-member-promoted-to-owner-event-inner": {
"type": "object",
"properties": {
"id": {
"description": "Event's identifier, should be unique across workflow. As it can be used as a variable identifier only alphanumerical characters are allowed.",
"type": "string",
"pattern": "^(?!variables$)([a-zA-Z][a-zA-Z0-9_]+)$"
}
}
},
"room-member-demoted-from-owner-event-inner": {
Expand All @@ -1282,11 +1292,21 @@
"user-joined-room-event-inner": {
"type": "object",
"properties": {
"id": {
"description": "Event's identifier, should be unique across workflow. As it can be used as a variable identifier only alphanumerical characters are allowed.",
"type": "string",
"pattern": "^(?!variables$)([a-zA-Z][a-zA-Z0-9_]+)$"
}
}
},
"user-left-room-event-inner": {
"type": "object",
"properties": {
"id": {
"description": "Event's identifier, should be unique across workflow. As it can be used as a variable identifier only alphanumerical characters are allowed.",
"type": "string",
"pattern": "^(?!variables$)([a-zA-Z][a-zA-Z0-9_]+)$"
}
}
},
"user-requested-join-room-event-inner": {
Expand Down Expand Up @@ -1334,6 +1354,11 @@
"activity-id": {
"description": "The completed (without errors) activity triggering this event.",
"$ref": "#/definitions/id"
},
"id": {
"description": "Event's identifier, should be unique across workflow. As it can be used as a variable identifier only alphanumerical characters are allowed.",
"type": "string",
"pattern": "^(?!variables$)([a-zA-Z][a-zA-Z0-9_]+)$"
}
},
"required": [
Expand Down