Class GHHook
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.entities.GHHook
- All Implemented Interfaces:
HttpRequestInterface
,JSONHelper
This class represents a GitHub Hook.
It provides methods for fetching data about the hook such as its id, url, pingUrl, deliveriesUrl, name, events, active status, config, updatedAt, createdAt, and type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T>
-
Constructor Summary
ConstructorsConstructorDescriptionGHHook
(org.json.JSONObject jsonObject) Constructs a new GHHook instance with the provided JSON object. -
Method Summary
Modifier and TypeMethodDescriptionorg.json.JSONObject
Returns the config of the hook.Returns the creation date of the hook.Returns the deliveries url of the hook.Returns the events of the hook.int
getId()
Returns the id of the hook.getName()
Returns the name of the hook.Returns the ping url of the hook.getType()
Returns the type of the hook.Returns the update date of the hook.getUrl()
Returns the url of the hook.boolean
isActive()
Returns whether the hook is active.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl, toJSONObject
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.coho04.githubapi.interfaces.HttpRequestInterface
extractNextPageUrl, sendDeleteRequest, sendDeleteRequestWithResponseCode, sendGetRequest, sendGetRequestWithLinkHeader, sendGetRequestWithResponseCode, sendPatchRequest, sendPostRequest, sendPutRequest
Methods inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
getArrayOrNull, getBooleanOrNull, getIntOrNull, getJSONArrayToStringList, getJSONObjectOrNull, getLocalDateOrNull, getLongOrNull, getStringOrNull
-
Constructor Details
-
GHHook
public GHHook(org.json.JSONObject jsonObject) Constructs a new GHHook instance with the provided JSON object.- Parameters:
jsonObject
- the JSON object containing the hook data
-
-
Method Details
-
getCreatedAt
Returns the creation date of the hook.- Returns:
- the creation date of the hook
-
getUpdatedAt
Returns the update date of the hook.- Returns:
- the update date of the hook
-
getName
Returns the name of the hook.- Returns:
- the name of the hook
-
getId
public int getId()Returns the id of the hook.- Returns:
- the id of the hook
-
getConfig
public org.json.JSONObject getConfig()Returns the config of the hook.- Returns:
- the config of the hook
-
getEvents
Returns the events of the hook.- Returns:
- the events of the hook
-
getDeliveriesUrl
Returns the deliveries url of the hook.- Returns:
- the deliveries url of the hook
-
getPingUrl
Returns the ping url of the hook.- Returns:
- the ping url of the hook
-
getType
Returns the type of the hook.- Returns:
- the type of the hook
-
getUrl
Returns the url of the hook.- Returns:
- the url of the hook
-
isActive
public boolean isActive()Returns whether the hook is active.- Returns:
- whether the hook is active
-