From e24324bca611118041ce80e1eda7809f2d384fca Mon Sep 17 00:00:00 2001 From: Jinyang li Date: Mon, 9 Dec 2024 02:11:25 -0500 Subject: [PATCH 1/3] Create EventType.java Make it easier for parsing github events from request header --- .../github/v3/activity/events/EventType.java | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/main/java/com/spotify/github/v3/activity/events/EventType.java diff --git a/src/main/java/com/spotify/github/v3/activity/events/EventType.java b/src/main/java/com/spotify/github/v3/activity/events/EventType.java new file mode 100644 index 00000000..433dbfde --- /dev/null +++ b/src/main/java/com/spotify/github/v3/activity/events/EventType.java @@ -0,0 +1,98 @@ +/*- + * -\-\- + * github-api + * -- + * Copyright (C) 2016 - 2020 Spotify AB + * -- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * -/-/- + */ + +package com.spotify.github.v3.activity.events; + +import java.util.Locale; + +public enum EventType { + BRANCH_PROTECTION_RULE, + CHECK_RUN, + CHECK_SUITE, + CODE_SCANNING_ALERT, + COMMIT_COMMENT, + CONTENT_REFERENCE, + CREATE, + DELETE, + DEPLOY_KEY, + DEPLOYMENT, + DEPLOYMENT_STATUS, + DISCUSSION, + DISCUSSION_COMMENT, + DOWNLOAD, + FOLLOW, + FORK, + FORK_APPLY, + GITHUB_APP_AUTHORIZATION, + GIST, + GOLLUM, + INSTALLATION, + INSTALLATION_REPOSITORIES, + INTEGRATION_INSTALLATION_REPOSITORIES, + ISSUE_COMMENT, + ISSUES, + LABEL, + MARKETPLACE_PURCHASE, + MEMBER, + MEMBERSHIP, + MERGE_QUEUE_ENTRY, + MERGE_GROUP, + META, + MILESTONE, + ORGANIZATION, + ORG_BLOCK, + PACKAGE, + PAGE_BUILD, + PROJECT_CARD, + PROJECT_COLUMN, + PROJECT, + PING, + PUBLIC, + PULL_REQUEST, + PULL_REQUEST_REVIEW, + PULL_REQUEST_REVIEW_COMMENT, + PULL_REQUEST_REVIEW_THREAD, + PUSH, + REGISTRY_PACKAGE, + RELEASE, + REPOSITORY_DISPATCH, + REPOSITORY, + REPOSITORY_IMPORT, + REPOSITORY_VULNERABILITY_ALERT, + SCHEDULE, + SECURITY_ADVISORY, + STAR, + STATUS, + TEAM, + TEAM_ADD, + WATCH, + WORKFLOW_JOB, + WORKFLOW_DISPATCH, + WORKFLOW_RUN, + UNKNOWN, + ALL; + + private EventType() { + } + + String toString() { + return this.name().toLowerCase(); + } +} From 30f9699fc8fef1aed4a0f7d36b62ab152f0ebd36 Mon Sep 17 00:00:00 2001 From: Jinyang li Date: Thu, 11 Dec 2025 10:51:06 -0500 Subject: [PATCH 2/3] Update EventType.java --- .../com/spotify/github/v3/activity/events/EventType.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/com/spotify/github/v3/activity/events/EventType.java b/src/main/java/com/spotify/github/v3/activity/events/EventType.java index 433dbfde..f72da664 100644 --- a/src/main/java/com/spotify/github/v3/activity/events/EventType.java +++ b/src/main/java/com/spotify/github/v3/activity/events/EventType.java @@ -20,8 +20,6 @@ package com.spotify.github.v3.activity.events; -import java.util.Locale; - public enum EventType { BRANCH_PROTECTION_RULE, CHECK_RUN, @@ -89,9 +87,6 @@ public enum EventType { UNKNOWN, ALL; - private EventType() { - } - String toString() { return this.name().toLowerCase(); } From 7ba5a99033d7a298d6372da1a0da11b32f8da501 Mon Sep 17 00:00:00 2001 From: Jinyang li Date: Thu, 11 Dec 2025 10:56:16 -0500 Subject: [PATCH 3/3] Update EventType.java --- .../java/com/spotify/github/v3/activity/events/EventType.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/spotify/github/v3/activity/events/EventType.java b/src/main/java/com/spotify/github/v3/activity/events/EventType.java index f72da664..1081830e 100644 --- a/src/main/java/com/spotify/github/v3/activity/events/EventType.java +++ b/src/main/java/com/spotify/github/v3/activity/events/EventType.java @@ -87,7 +87,8 @@ public enum EventType { UNKNOWN, ALL; - String toString() { + @Override + public String toString() { return this.name().toLowerCase(); } }