Class ImmutableInstallation

  • All Implemented Interfaces:
    Installation

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

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

    • Method Detail

      • id

        public int id()
        The installation ID.
        Specified by:
        id in interface Installation
        Returns:
        the int
      • account

        public User account()
        Account user.
        Specified by:
        account in interface Installation
        Returns:
        the user
      • appId

        public int appId()
        The APP ID the installations refers to.
        Specified by:
        appId in interface Installation
        Returns:
        the int
      • targetId

        public int targetId()
        The ID of the entity it is installed on. Usually a repo.
        Specified by:
        targetId in interface Installation
        Returns:
        the int
      • targetType

        public String targetType()
        Target type. Can be Organization.
        Specified by:
        targetType in interface Installation
        Returns:
        the string
      • events

        public List<String> events()
        Events list this installation will consume, such as push, pull_request, etc.
        Specified by:
        events in interface Installation
        Returns:
        the list
      • repositorySelection

        public Optional<String> repositorySelection()
        Indicates if the App is installed in all repos of the org, or just selected. Can be all or selected.
        Specified by:
        repositorySelection in interface Installation
        Returns:
        the optional string
      • withId

        public final ImmutableInstallation withId​(int value)
        Copy the current immutable object by setting a value for the id attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        Returns:
        A modified copy of the this object
      • withAccount

        public final ImmutableInstallation withAccount​(User value)
        Copy the current immutable object by setting a value for the account attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for account
        Returns:
        A modified copy of the this object
      • withAccessTokensUrl

        public final ImmutableInstallation withAccessTokensUrl​(String value)
        Copy the current immutable object by setting a value for the accessTokensUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for accessTokensUrl
        Returns:
        A modified copy of the this object
      • withRepositoriesUrl

        public final ImmutableInstallation withRepositoriesUrl​(String value)
        Copy the current immutable object by setting a value for the repositoriesUrl attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for repositoriesUrl
        Returns:
        A modified copy of the this object
      • withHtmlUrl

        public final ImmutableInstallation withHtmlUrl​(String value)
        Copy the current immutable object by setting a present value for the optional htmlUrl attribute.
        Parameters:
        value - The value for htmlUrl
        Returns:
        A modified copy of this object
      • withHtmlUrl

        public final ImmutableInstallation withHtmlUrl​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the htmlUrl attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for htmlUrl
        Returns:
        A modified copy of this object
      • withAppId

        public final ImmutableInstallation withAppId​(int value)
        Copy the current immutable object by setting a value for the appId attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for appId
        Returns:
        A modified copy of the this object
      • withTargetId

        public final ImmutableInstallation withTargetId​(int value)
        Copy the current immutable object by setting a value for the targetId attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for targetId
        Returns:
        A modified copy of the this object
      • withTargetType

        public final ImmutableInstallation withTargetType​(String value)
        Copy the current immutable object by setting a value for the targetType attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for targetType
        Returns:
        A modified copy of the this object
      • withPermissions

        public final ImmutableInstallation withPermissions​(Map<String,​? extends String> entries)
        Copy the current immutable object by replacing the permissions map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        entries - The entries to be added to the permissions map
        Returns:
        A modified copy of this object
      • withEvents

        public final ImmutableInstallation withEvents​(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 ImmutableInstallation withEvents​(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
      • withSingleFileName

        public final ImmutableInstallation withSingleFileName​(String value)
        Copy the current immutable object by setting a present value for the optional singleFileName attribute.
        Parameters:
        value - The value for singleFileName
        Returns:
        A modified copy of this object
      • withSingleFileName

        public final ImmutableInstallation withSingleFileName​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the singleFileName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for singleFileName
        Returns:
        A modified copy of this object
      • withRepositorySelection

        public final ImmutableInstallation withRepositorySelection​(String value)
        Copy the current immutable object by setting a present value for the optional repositorySelection attribute.
        Parameters:
        value - The value for repositorySelection
        Returns:
        A modified copy of this object
      • withRepositorySelection

        public final ImmutableInstallation withRepositorySelection​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the repositorySelection attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for repositorySelection
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableInstallation 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: id, account, accessTokensUrl, repositoriesUrl, htmlUrl, appId, targetId, targetType, permissions, events, singleFileName, repositorySelection.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableInstallation copyOf​(Installation instance)
        Creates an immutable copy of a Installation 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 Installation instance