diff --git a/slack-api-model/src/main/java/com/slack/api/model/connect/ConnectRequestActor.java b/slack-api-model/src/main/java/com/slack/api/model/connect/ConnectRequestActor.java new file mode 100644 index 000000000..00291f893 --- /dev/null +++ b/slack-api-model/src/main/java/com/slack/api/model/connect/ConnectRequestActor.java @@ -0,0 +1,16 @@ +package com.slack.api.model.connect; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +@Data +public class ConnectRequestActor { + private String id; + private String name; + @SerializedName("is_bot") + private boolean bot; + private String teamId; + private String timezone; + private String realName; + private String displayName; +} diff --git a/slack-api-model/src/main/java/com/slack/api/model/event/AppDeletedEvent.java b/slack-api-model/src/main/java/com/slack/api/model/event/AppDeletedEvent.java new file mode 100644 index 000000000..496167a89 --- /dev/null +++ b/slack-api-model/src/main/java/com/slack/api/model/event/AppDeletedEvent.java @@ -0,0 +1,20 @@ +package com.slack.api.model.event; + +import lombok.Data; + +/** + * https://api.slack.com/events/app_deleted + */ +@Data +public class AppDeletedEvent implements Event { + + public static final String TYPE_NAME = "app_deleted"; + + private final String type = TYPE_NAME; + private String appId; + private String appName; + private String appOwnerId; + private String teamId; + private String teamDomain; + private String eventTs; +} \ No newline at end of file diff --git a/slack-api-model/src/main/java/com/slack/api/model/event/AppInstalledEvent.java b/slack-api-model/src/main/java/com/slack/api/model/event/AppInstalledEvent.java new file mode 100644 index 000000000..782422db5 --- /dev/null +++ b/slack-api-model/src/main/java/com/slack/api/model/event/AppInstalledEvent.java @@ -0,0 +1,21 @@ +package com.slack.api.model.event; + +import lombok.Data; + +/** + * https://api.slack.com/events/app_installed + */ +@Data +public class AppInstalledEvent implements Event { + + public static final String TYPE_NAME = "app_installed"; + + private final String type = TYPE_NAME; + private String appId; + private String appName; + private String appOwnerId; + private String user_id; + private String teamId; + private String teamDomain; + private String eventTs; +} \ No newline at end of file diff --git a/slack-api-model/src/main/java/com/slack/api/model/event/AppUninstalledTeamEvent.java b/slack-api-model/src/main/java/com/slack/api/model/event/AppUninstalledTeamEvent.java new file mode 100644 index 000000000..85a7c592a --- /dev/null +++ b/slack-api-model/src/main/java/com/slack/api/model/event/AppUninstalledTeamEvent.java @@ -0,0 +1,21 @@ +package com.slack.api.model.event; + +import lombok.Data; + +/** + * https://api.slack.com/events/app_uninstalled_team + */ +@Data +public class AppUninstalledTeamEvent implements Event { + + public static final String TYPE_NAME = "app_uninstalled_team"; + + private final String type = TYPE_NAME; + private String appId; + private String appName; + private String appOwnerId; + private String user_id; + private String teamId; + private String teamDomain; + private String eventTs; +} \ No newline at end of file diff --git a/slack-api-model/src/main/java/com/slack/api/model/event/SharedChannelInviteRequestedEvent.java b/slack-api-model/src/main/java/com/slack/api/model/event/SharedChannelInviteRequestedEvent.java new file mode 100644 index 000000000..d8d6e065c --- /dev/null +++ b/slack-api-model/src/main/java/com/slack/api/model/event/SharedChannelInviteRequestedEvent.java @@ -0,0 +1,37 @@ +package com.slack.api.model.event; + +import com.google.gson.annotations.SerializedName; +import com.slack.api.model.connect.ConnectRequestActor; +import com.slack.api.model.connect.ConnectTeam; +import lombok.Data; + +import java.util.List; + +/** + * https://api.slack.com/events/shared_channel_invite_requested + */ +@Data +public class SharedChannelInviteRequestedEvent implements Event { + + public static final String TYPE_NAME = "shared_channel_invite_requested"; + + private final String type = TYPE_NAME; + private ConnectRequestActor actor; + private String channelId; + private String eventType; + private String channelName; + private String channelType; + private List targetUsers; + private List teamsInChannel; + @SerializedName("is_external_limited") + private boolean externalLimited; + private Integer channelDateCreated; + private Integer channelMessageLatestCountedTimestamp; + private String eventTs; + + @Data + public static class TargetUser { + private String email; + private String inviteId; + } +} \ No newline at end of file diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppDeletedHandler.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppDeletedHandler.java new file mode 100644 index 000000000..3123bb213 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppDeletedHandler.java @@ -0,0 +1,13 @@ +package com.slack.api.app_backend.events.handler; + +import com.slack.api.app_backend.events.EventHandler; +import com.slack.api.app_backend.events.payload.AppDeletedPayload; +import com.slack.api.model.event.AppDeletedEvent; + +public abstract class AppDeletedHandler extends EventHandler { + + @Override + public String getEventType() { + return AppDeletedEvent.TYPE_NAME; + } +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppInstalledHandler.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppInstalledHandler.java new file mode 100644 index 000000000..81a1d5542 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppInstalledHandler.java @@ -0,0 +1,13 @@ +package com.slack.api.app_backend.events.handler; + +import com.slack.api.app_backend.events.EventHandler; +import com.slack.api.app_backend.events.payload.AppInstalledPayload; +import com.slack.api.model.event.AppInstalledEvent; + +public abstract class AppInstalledHandler extends EventHandler { + + @Override + public String getEventType() { + return AppInstalledEvent.TYPE_NAME; + } +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppUninstalledTeamHandler.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppUninstalledTeamHandler.java new file mode 100644 index 000000000..ec6166041 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/AppUninstalledTeamHandler.java @@ -0,0 +1,13 @@ +package com.slack.api.app_backend.events.handler; + +import com.slack.api.app_backend.events.EventHandler; +import com.slack.api.app_backend.events.payload.AppUninstalledTeamPayload; +import com.slack.api.model.event.AppUninstalledTeamEvent; + +public abstract class AppUninstalledTeamHandler extends EventHandler { + + @Override + public String getEventType() { + return AppUninstalledTeamEvent.TYPE_NAME; + } +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/FunctionExecutedHandler.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/FunctionExecutedHandler.java new file mode 100644 index 000000000..5dac4adf4 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/FunctionExecutedHandler.java @@ -0,0 +1,13 @@ +package com.slack.api.app_backend.events.handler; + +import com.slack.api.app_backend.events.EventHandler; +import com.slack.api.app_backend.events.payload.FunctionExecutedPayload; +import com.slack.api.model.event.FunctionExecutedEvent; + +public abstract class FunctionExecutedHandler extends EventHandler { + + @Override + public String getEventType() { + return FunctionExecutedEvent.TYPE_NAME; + } +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/SharedChannelInviteRequestedHandler.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/SharedChannelInviteRequestedHandler.java new file mode 100644 index 000000000..5c88a4f73 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/handler/SharedChannelInviteRequestedHandler.java @@ -0,0 +1,13 @@ +package com.slack.api.app_backend.events.handler; + +import com.slack.api.app_backend.events.EventHandler; +import com.slack.api.app_backend.events.payload.SharedChannelInviteRequestedPayload; +import com.slack.api.model.event.SharedChannelInviteRequestedEvent; + +public abstract class SharedChannelInviteRequestedHandler extends EventHandler { + + @Override + public String getEventType() { + return SharedChannelInviteRequestedEvent.TYPE_NAME; + } +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppDeletedPayload.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppDeletedPayload.java new file mode 100644 index 000000000..1d6dabb06 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppDeletedPayload.java @@ -0,0 +1,25 @@ +package com.slack.api.app_backend.events.payload; + +import com.slack.api.model.event.AppDeletedEvent; +import lombok.Data; + +import java.util.List; + +@Data +public class AppDeletedPayload implements EventsApiPayload { + + private String token; + private String enterpriseId; + private String teamId; + private String apiAppId; + private String type; + private List authedUsers; + private List authedTeams; + private List authorizations; + private boolean isExtSharedChannel; + private String eventId; + private Integer eventTime; + private String eventContext; + + private AppDeletedEvent event; +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppInstalledPayload.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppInstalledPayload.java new file mode 100644 index 000000000..84f26be1a --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppInstalledPayload.java @@ -0,0 +1,25 @@ +package com.slack.api.app_backend.events.payload; + +import com.slack.api.model.event.AppInstalledEvent; +import lombok.Data; + +import java.util.List; + +@Data +public class AppInstalledPayload implements EventsApiPayload { + + private String token; + private String enterpriseId; + private String teamId; + private String apiAppId; + private String type; + private List authedUsers; + private List authedTeams; + private List authorizations; + private boolean isExtSharedChannel; + private String eventId; + private Integer eventTime; + private String eventContext; + + private AppInstalledEvent event; +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppUninstalledTeamPayload.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppUninstalledTeamPayload.java new file mode 100644 index 000000000..17216572f --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/AppUninstalledTeamPayload.java @@ -0,0 +1,25 @@ +package com.slack.api.app_backend.events.payload; + +import com.slack.api.model.event.AppUninstalledTeamEvent; +import lombok.Data; + +import java.util.List; + +@Data +public class AppUninstalledTeamPayload implements EventsApiPayload { + + private String token; + private String enterpriseId; + private String teamId; + private String apiAppId; + private String type; + private List authedUsers; + private List authedTeams; + private List authorizations; + private boolean isExtSharedChannel; + private String eventId; + private Integer eventTime; + private String eventContext; + + private AppUninstalledTeamEvent event; +} diff --git a/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/SharedChannelInviteRequestedPayload.java b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/SharedChannelInviteRequestedPayload.java new file mode 100644 index 000000000..909d71352 --- /dev/null +++ b/slack-app-backend/src/main/java/com/slack/api/app_backend/events/payload/SharedChannelInviteRequestedPayload.java @@ -0,0 +1,25 @@ +package com.slack.api.app_backend.events.payload; + +import com.slack.api.model.event.SharedChannelInviteRequestedEvent; +import lombok.Data; + +import java.util.List; + +@Data +public class SharedChannelInviteRequestedPayload implements EventsApiPayload { + + private String token; + private String enterpriseId; + private String teamId; + private String apiAppId; + private String type; + private List authedUsers; + private List authedTeams; + private List authorizations; + private boolean isExtSharedChannel; + private String eventId; + private Integer eventTime; + private String eventContext; + + private SharedChannelInviteRequestedEvent event; +}