Class GHHookBuilder

java.lang.Object
io.github.coho04.githubapi.bases.GHBase
io.github.coho04.githubapi.builders.GHHookBuilder
All Implemented Interfaces:
HttpRequestInterface, JSONHelper

public class GHHookBuilder extends GHBase
Builder class for creating GitHub webhooks.
  • Constructor Details

    • GHHookBuilder

      public GHHookBuilder(Github github, String url)
      Constructs a GHHookBuilder.
      Parameters:
      github - the GitHub instance
      url - 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 class GHBase
      Returns:
      a new JSONObject
    • setConfigContentType

      public void setConfigContentType(String configContentType)
      Sets the content type for the webhook config.
      Parameters:
      configContentType - the content type
    • setConfigInsecureSSL

      public void setConfigInsecureSSL(String configInsecureSSL)
      Sets whether SSL verification is enabled for the webhook config.
      Parameters:
      configInsecureSSL - the insecure SSL setting
    • setConfigPassword

      public void setConfigPassword(String configPassword)
      Sets the password for the webhook config.
      Parameters:
      configPassword - the password
    • setConfigSecret

      public void setConfigSecret(String configSecret)
      Sets the secret for the webhook config.
      Parameters:
      configSecret - the secret
    • setConfigURL

      public void setConfigURL(String configURL)
      Sets the URL for the webhook config.
      Parameters:
      configURL - the URL
    • setConfigUsername

      public void setConfigUsername(String configUsername)
      Sets the username for the webhook config.
      Parameters:
      configUsername - the username
    • setEvents

      public void setEvents(List<String> events)
      Sets the events that trigger the webhook.
      Parameters:
      events - the list of events
    • addEvent

      public void addEvent(String event)
      Adds an event that triggers the webhook.
      Parameters:
      event - the event to add
    • setName

      public void setName(String name)
      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

      public String getUrl()
      Returns the URL for the webhook.
      Returns:
      the URL
    • getName

      public String getName()
      Returns the name of the webhook.
      Returns:
      the name
    • getGithub

      public Github getGithub()
      Returns the GitHub instance.
      Returns:
      the GitHub instance
    • getEvents

      public List<String> getEvents()
      Returns the list of events that trigger the webhook.
      Returns:
      the list of events
    • getConfigContentType

      public String getConfigContentType()
      Returns the content type for the webhook config.
      Returns:
      the content type
    • getConfigInsecureSSL

      public String getConfigInsecureSSL()
      Returns whether SSL verification is enabled for the webhook config.
      Returns:
      the insecure SSL setting
    • getConfigPassword

      public String getConfigPassword()
      Returns the password for the webhook config.
      Returns:
      the password
    • getConfigSecret

      public String getConfigSecret()
      Returns the secret for the webhook config.
      Returns:
      the secret
    • getConfigURL

      public String getConfigURL()
      Returns the URL for the webhook config.
      Returns:
      the URL
    • getConfigUsername

      public String 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

      public GHHook build()
      Builds and returns a GHHook object.
      Returns:
      the built GHHook