mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-01 00:11:24 +00:00
We took a change that added an enum that was used purely for mapping from EventInfo.type to GHEvent. This seemed fine but that enum is used only by EventInfo. This change removed that enum and adds a map to EventInfo to do the required mapping. This avoids shoehorning mapping behavior in to the EnumUtils.
91 lines
1.7 KiB
Java
91 lines
1.7 KiB
Java
package org.kohsuke.github;
|
|
|
|
import java.util.Locale;
|
|
|
|
/**
|
|
* Hook event type.
|
|
*
|
|
* @author Kohsuke Kawaguchi
|
|
* @see GHEventInfo
|
|
* @see <a href="https://developer.github.com/v3/activity/events/types/">Event type reference</a>
|
|
*/
|
|
public enum GHEvent {
|
|
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,
|
|
META,
|
|
MILESTONE,
|
|
ORGANIZATION,
|
|
ORG_BLOCK,
|
|
PACKAGE,
|
|
PAGE_BUILD,
|
|
PROJECT_CARD,
|
|
PROJECT_COLUMN,
|
|
PROJECT,
|
|
PING,
|
|
PUBLIC,
|
|
PULL_REQUEST,
|
|
PULL_REQUEST_REVIEW,
|
|
PULL_REQUEST_REVIEW_COMMENT,
|
|
PUSH,
|
|
REGISTRY_PACKAGE,
|
|
RELEASE,
|
|
REPOSITORY_DISPATCH, // only valid for org hooks
|
|
REPOSITORY,
|
|
REPOSITORY_IMPORT,
|
|
REPOSITORY_VULNERABILITY_ALERT,
|
|
SCHEDULE,
|
|
SECURITY_ADVISORY,
|
|
STAR,
|
|
STATUS,
|
|
TEAM,
|
|
TEAM_ADD,
|
|
WATCH,
|
|
WORKFLOW_DISPATCH,
|
|
WORKFLOW_RUN,
|
|
|
|
/**
|
|
* Special event type that means we haven't found an enum value corresponding to the event.
|
|
*/
|
|
UNKNOWN,
|
|
|
|
/**
|
|
* Special event type that means "every possible event"
|
|
*/
|
|
ALL;
|
|
|
|
/**
|
|
* Returns GitHub's internal representation of this event.
|
|
*/
|
|
String symbol() {
|
|
if (this == ALL)
|
|
return "*";
|
|
return name().toLowerCase(Locale.ENGLISH);
|
|
}
|
|
}
|