Package org.kohsuke.github
Class GHEventInfo
- java.lang.Object
-
- org.kohsuke.github.GHEventInfo
-
public class GHEventInfo extends Object
Represents an event.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GHEventInfo.GHEventRepository
Inside the event JSON model, GitHub uses a slightly different format.
-
Constructor Summary
Constructors Constructor Description GHEventInfo()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GHUser
getActor()
Gets actor.String
getActorLogin()
Gets actor login.Date
getCreatedAt()
Gets created at.long
getId()
Gets id.GHOrganization
getOrganization()
Gets organization.<T extends GHEventPayload>
TgetPayload(Class<T> type)
Retrieves the payload.GHRepository
getRepository()
Gets repository.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.GHEvent
getType()
Gets type.
-
-
-
Method Detail
-
getType
public GHEvent getType()
Gets type.- Returns:
- the type
-
getId
public long getId()
Gets id.- Returns:
- the id
-
getCreatedAt
public Date getCreatedAt()
Gets created at.- Returns:
- the created at
-
getRepository
public GHRepository getRepository() throws IOException
Gets repository.- Returns:
- Repository where the change was made.
- Throws:
IOException
- on error
-
getActor
public GHUser getActor() throws IOException
Gets actor.- Returns:
- the
GHUser
actor for this event. - Throws:
IOException
- on error
-
getActorLogin
public String getActorLogin() throws IOException
Gets actor login.- Returns:
- the login of the actor.
- Throws:
IOException
- on error
-
getOrganization
public GHOrganization getOrganization() throws IOException
Gets organization.- Returns:
- the organization
- Throws:
IOException
- the io exception
-
getPayload
public <T extends GHEventPayload> T getPayload(Class<T> type) throws IOException
Retrieves the payload.- Type Parameters:
T
- the type parameter- Parameters:
type
- Specify one of theGHEventPayload
subtype that defines a type-safe access to the payload. This must match the event type.- Returns:
- parsed event payload
- Throws:
IOException
- if payload cannot be parsed
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-