Class ImmutableWebhook

  • All Implemented Interfaces:
    UpdateTracking, Webhook

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableWebhook
    extends Object
    implements Webhook
    Immutable implementation of Webhook.

    Use the builder to create immutable instances: ImmutableWebhook.builder().

    • Method Detail

      • url

        @Nullable
        public URI url()
        URL
        Specified by:
        url in interface Webhook
      • testUrl

        @Nullable
        public URI testUrl()
        Test URL
        Specified by:
        testUrl in interface Webhook
      • pingUrl

        @Nullable
        public URI pingUrl()
        Ping URL
        Specified by:
        pingUrl in interface Webhook
      • name

        @Nullable
        public String name()
        Name
        Specified by:
        name in interface Webhook
      • events

        @Nullable
        public List<String> events()
        Determines what events the hook is triggered for. Default: ["push"]
        Specified by:
        events in interface Webhook
      • active

        @Nullable
        public Boolean active()
        Determines whether the hook is actually triggered on pushes.
        Specified by:
        active in interface Webhook
      • config

        @Nullable
        public WebhookConfig config()
        These settings vary between hooks and some are defined in the github-services repository.
        Specified by:
        config in interface Webhook
      • withCreatedAt

        public final ImmutableWebhook withCreatedAt​(@Nullable
                                                    GitHubInstant value)
        Copy the current immutable object by setting a value for the createdAt attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for createdAt (can be null)
        Returns:
        A modified copy of the this object
      • withUpdatedAt

        public final ImmutableWebhook withUpdatedAt​(@Nullable
                                                    GitHubInstant value)
        Copy the current immutable object by setting a value for the updatedAt attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for updatedAt (can be null)
        Returns:
        A modified copy of the this object
      • withId

        public final ImmutableWebhook withId​(@Nullable
                                             Integer value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id (can be null)
        Returns:
        A modified copy of the this object
      • withUrl

        public final ImmutableWebhook withUrl​(@Nullable
                                              URI value)
        Copy the current immutable object by setting a value for the url attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for url (can be null)
        Returns:
        A modified copy of the this object
      • withTestUrl

        public final ImmutableWebhook withTestUrl​(@Nullable
                                                  URI value)
        Copy the current immutable object by setting a value for the testUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for testUrl (can be null)
        Returns:
        A modified copy of the this object
      • withPingUrl

        public final ImmutableWebhook withPingUrl​(@Nullable
                                                  URI value)
        Copy the current immutable object by setting a value for the pingUrl attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for pingUrl (can be null)
        Returns:
        A modified copy of the this object
      • withName

        public final ImmutableWebhook withName​(@Nullable
                                               String value)
        Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for name (can be null)
        Returns:
        A modified copy of the this object
      • withEvents

        public final ImmutableWebhook withEvents​(@Nullable
                                                 String... elements)
        Copy the current immutable object with elements that replace the content of events.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withEvents

        public final ImmutableWebhook withEvents​(@Nullable
                                                 Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of events. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of events elements to set
        Returns:
        A modified copy of this object
      • withActive

        public final ImmutableWebhook withActive​(@Nullable
                                                 Boolean value)
        Copy the current immutable object by setting a value for the active attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for active (can be null)
        Returns:
        A modified copy of the this object
      • withConfig

        public final ImmutableWebhook withConfig​(@Nullable
                                                 WebhookConfig value)
        Copy the current immutable object by setting a value for the config attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for config (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableWebhook that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: createdAt, updatedAt, id, url, testUrl, pingUrl, name, events, active, config.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Webhook with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableWebhook copyOf​(Webhook instance)
        Creates an immutable copy of a Webhook value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable Webhook instance
      • builder

        public static ImmutableWebhook.Builder builder()
        Creates a builder for ImmutableWebhook.
         ImmutableWebhook.builder()
            .createdAt(com.spotify.github.GitHubInstant | null) // nullable createdAt
            .updatedAt(com.spotify.github.GitHubInstant | null) // nullable updatedAt
            .id(Integer | null) // nullable id
            .url(java.net.URI | null) // nullable url
            .testUrl(java.net.URI | null) // nullable testUrl
            .pingUrl(java.net.URI | null) // nullable pingUrl
            .name(String | null) // nullable name
            .events(List&lt;String&gt; | null) // nullable events
            .active(Boolean | null) // nullable active
            .config(com.spotify.github.v3.hooks.WebhookConfig | null) // nullable config
            .build();
         
        Returns:
        A new ImmutableWebhook builder