Class ImmutableCheckRunResponse

  • All Implemented Interfaces:
    CheckRunBase, CheckRunResponse

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

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

    • Method Detail

      • headSha

        public String headSha()
        The SHA of the commit.
        Specified by:
        headSha in interface CheckRunBase
        Returns:
        the string
      • name

        public String name()
        The name of the check. For example, "code-coverage".
        Specified by:
        name in interface CheckRunBase
        Returns:
        the string
      • status

        public CheckRunStatus status()
        The current status. Can be one of queued, in_progress, or completed.
        Specified by:
        status in interface CheckRunBase
        Returns:
        the check run status enum
      • conclusion

        public Optional<CheckRunConclusion> conclusion()
        The final conclusion of the check. Can be one of success, failure, neutral, cancelled, timed_out, or action_required. When the conclusion is action_required, additional details should be provided on the site specified by details_url. Required if you provide completedAt or a status of completed.
        Specified by:
        conclusion in interface CheckRunBase
        Returns:
        the conclusion
      • externalId

        public Optional<String> externalId()
        A reference for the run on the integrator's system.
        Specified by:
        externalId in interface CheckRunBase
        Returns:
        the optional string
      • detailsUrl

        public Optional<String> detailsUrl()
        The URL of the integrator's site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used.
        Specified by:
        detailsUrl in interface CheckRunBase
        Returns:
        the optional
      • id

        public long id()
        The CheckRun ID.
        Specified by:
        id in interface CheckRunResponse
        Returns:
        the int
      • withHeadSha

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

        public final ImmutableCheckRunResponse withName​(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
        Returns:
        A modified copy of the this object
      • withStatus

        public final ImmutableCheckRunResponse withStatus​(CheckRunStatus value)
        Copy the current immutable object by setting a value for the status attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for status
        Returns:
        A modified copy of the this object
      • withConclusion

        public final ImmutableCheckRunResponse withConclusion​(CheckRunConclusion value)
        Copy the current immutable object by setting a present value for the optional conclusion attribute.
        Parameters:
        value - The value for conclusion
        Returns:
        A modified copy of this object
      • withConclusion

        public final ImmutableCheckRunResponse withConclusion​(Optional<? extends CheckRunConclusion> optional)
        Copy the current immutable object by setting an optional value for the conclusion 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 conclusion
        Returns:
        A modified copy of this object
      • withStartedAt

        public final ImmutableCheckRunResponse withStartedAt​(ZonedDateTime value)
        Copy the current immutable object by setting a present value for the optional startedAt attribute.
        Parameters:
        value - The value for startedAt
        Returns:
        A modified copy of this object
      • withStartedAt

        public final ImmutableCheckRunResponse withStartedAt​(Optional<? extends ZonedDateTime> optional)
        Copy the current immutable object by setting an optional value for the startedAt attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for startedAt
        Returns:
        A modified copy of this object
      • withCompletedAt

        public final ImmutableCheckRunResponse withCompletedAt​(ZonedDateTime value)
        Copy the current immutable object by setting a present value for the optional completedAt attribute.
        Parameters:
        value - The value for completedAt
        Returns:
        A modified copy of this object
      • withCompletedAt

        public final ImmutableCheckRunResponse withCompletedAt​(Optional<? extends ZonedDateTime> optional)
        Copy the current immutable object by setting an optional value for the completedAt attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for completedAt
        Returns:
        A modified copy of this object
      • withExternalId

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

        public final ImmutableCheckRunResponse withExternalId​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the externalId 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 externalId
        Returns:
        A modified copy of this object
      • withDetailsUrl

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

        public final ImmutableCheckRunResponse withDetailsUrl​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the detailsUrl 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 detailsUrl
        Returns:
        A modified copy of this object
      • withId

        public final ImmutableCheckRunResponse withId​(long 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
      • withUrl

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

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

        public final ImmutableCheckRunResponse withOutput​(CheckRunOutput value)
        Copy the current immutable object by setting a value for the output attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for output
        Returns:
        A modified copy of the this object
      • withCheckSuite

        public final ImmutableCheckRunResponse withCheckSuite​(CheckSuite value)
        Copy the current immutable object by setting a present value for the optional checkSuite attribute.
        Parameters:
        value - The value for checkSuite
        Returns:
        A modified copy of this object
      • withCheckSuite

        public final ImmutableCheckRunResponse withCheckSuite​(Optional<? extends CheckSuite> optional)
        Copy the current immutable object by setting an optional value for the checkSuite attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for checkSuite
        Returns:
        A modified copy of this object
      • withApp

        public final ImmutableCheckRunResponse withApp​(App value)
        Copy the current immutable object by setting a present value for the optional app attribute.
        Parameters:
        value - The value for app
        Returns:
        A modified copy of this object
      • withApp

        public final ImmutableCheckRunResponse withApp​(Optional<? extends App> optional)
        Copy the current immutable object by setting an optional value for the app attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for app
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableCheckRunResponse 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: headSha, name, status, conclusion, startedAt, completedAt, externalId, detailsUrl, id, url, htmlUrl, output, checkSuite, app.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableCheckRunResponse copyOf​(CheckRunResponse instance)
        Creates an immutable copy of a CheckRunResponse 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 CheckRunResponse instance
      • builder

        public static ImmutableCheckRunResponse.Builder builder()
        Creates a builder for ImmutableCheckRunResponse.
         ImmutableCheckRunResponse.builder()
            .headSha(String) // required headSha
            .name(String) // required name
            .status(com.spotify.github.v3.checks.CheckRunStatus) // required status
            .conclusion(com.spotify.github.v3.checks.CheckRunConclusion) // optional conclusion
            .startedAt(java.time.ZonedDateTime) // optional startedAt
            .completedAt(java.time.ZonedDateTime) // optional completedAt
            .externalId(String) // optional externalId
            .detailsUrl(String) // optional detailsUrl
            .id(long) // required id
            .url(String) // required url
            .htmlUrl(String) // required htmlUrl
            .output(com.spotify.github.v3.checks.CheckRunOutput) // required output
            .checkSuite(com.spotify.github.v3.checks.CheckSuite) // optional checkSuite
            .app(com.spotify.github.v3.checks.App) // optional app
            .build();
         
        Returns:
        A new ImmutableCheckRunResponse builder