Class GHHookBuilder
java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.builders.GHHookBuilder
- All Implemented Interfaces:
HttpRequestInterface
,JSONHelper
Builder class for creating GitHub webhooks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.coho04.githubapi.interfaces.JSONHelper
JSONHelper.JSONToObject<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an event that triggers the webhook.build()
Builds and returns a GHHook object.Returns the content type for the webhook config.Returns whether SSL verification is enabled for the webhook config.Returns the password for the webhook config.Returns the secret for the webhook config.Returns the URL for the webhook config.Returns the username for the webhook config.Returns the list of events that trigger the webhook.Returns the GitHub instance.getName()
Returns the name of the webhook.getUrl()
Returns the URL for the webhook.boolean
isActive()
Returns whether the webhook is active.void
setActive
(boolean active) Sets whether the webhook is active.void
setConfigContentType
(String configContentType) Sets the content type for the webhook config.void
setConfigInsecureSSL
(String configInsecureSSL) Sets whether SSL verification is enabled for the webhook config.void
setConfigPassword
(String configPassword) Sets the password for the webhook config.void
setConfigSecret
(String configSecret) Sets the secret for the webhook config.void
setConfigURL
(String configURL) Sets the URL for the webhook config.void
setConfigUsername
(String configUsername) Sets the username for the webhook config.void
Sets the events that trigger the webhook.void
Sets the name of the webhook.org.json.JSONObject
Returns a new JSONObject.Methods inherited from class io.github.coho04.githubapi.bases.GHBase
fetchArrayData, fetchArrayData, fetchPaginatedData, fetchPaginatedData, fetchPaginatedData, getBaseUrl
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
-
GHHookBuilder
Constructs a GHHookBuilder.- Parameters:
github
- the GitHub instanceurl
- the URL for the webhook
-
-
Method Details
-
toJSONObject
public org.json.JSONObject toJSONObject()Description copied from class:GHBase
Returns a new JSONObject.- Overrides:
toJSONObject
in classGHBase
- Returns:
- a new JSONObject
-
setConfigContentType
Sets the content type for the webhook config.- Parameters:
configContentType
- the content type
-
setConfigInsecureSSL
Sets whether SSL verification is enabled for the webhook config.- Parameters:
configInsecureSSL
- the insecure SSL setting
-
setConfigPassword
Sets the password for the webhook config.- Parameters:
configPassword
- the password
-
setConfigSecret
Sets the secret for the webhook config.- Parameters:
configSecret
- the secret
-
setConfigURL
Sets the URL for the webhook config.- Parameters:
configURL
- the URL
-
setConfigUsername
Sets the username for the webhook config.- Parameters:
configUsername
- the username
-
setEvents
Sets the events that trigger the webhook.- Parameters:
events
- the list of events
-
addEvent
Adds an event that triggers the webhook.- Parameters:
event
- the event to add
-
setName
Sets the name of the webhook.- Parameters:
name
- the name
-
setActive
public void setActive(boolean active) Sets whether the webhook is active.- Parameters:
active
- the active state
-
getUrl
Returns the URL for the webhook.- Returns:
- the URL
-
getName
Returns the name of the webhook.- Returns:
- the name
-
getGithub
Returns the GitHub instance.- Returns:
- the GitHub instance
-
getEvents
Returns the list of events that trigger the webhook.- Returns:
- the list of events
-
getConfigContentType
Returns the content type for the webhook config.- Returns:
- the content type
-
getConfigInsecureSSL
Returns whether SSL verification is enabled for the webhook config.- Returns:
- the insecure SSL setting
-
getConfigPassword
Returns the password for the webhook config.- Returns:
- the password
-
getConfigSecret
Returns the secret for the webhook config.- Returns:
- the secret
-
getConfigURL
Returns the URL for the webhook config.- Returns:
- the URL
-
getConfigUsername
Returns the username for the webhook config.- Returns:
- the username
-
isActive
public boolean isActive()Returns whether the webhook is active.- Returns:
- the active state
-
build
Builds and returns a GHHook object.- Returns:
- the built GHHook
-