Package com.spotify.github.v3.checks
Class ImmutableInstallation
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableInstallation
-
- All Implemented Interfaces:
Installation
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableInstallation extends Object implements Installation
Immutable implementation ofInstallation
.Use the builder to create immutable instances:
ImmutableInstallation.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableInstallation.Builder
Builds instances of typeImmutableInstallation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
accessTokensUrl()
Access tokens url.User
account()
Account user.int
appId()
The APP ID the installations refers to.static ImmutableInstallation.Builder
builder()
Creates a builder forImmutableInstallation
.static ImmutableInstallation
copyOf(Installation instance)
Creates an immutable copy of aInstallation
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableInstallation
that have equal attribute values.List<String>
events()
Events list this installation will consume, such as push, pull_request, etc.int
hashCode()
Computes a hash code from attributes:id
,account
,accessTokensUrl
,repositoriesUrl
,htmlUrl
,appId
,targetId
,targetType
,permissions
,events
,singleFileName
,repositorySelection
.Optional<String>
htmlUrl()
Html URL to Github.int
id()
The installation ID.Map<String,String>
permissions()
Permissions map this installation has.String
repositoriesUrl()
Repositories url.Optional<String>
repositorySelection()
Indicates if the App is installed in all repos of the org, or just selected.Optional<String>
singleFileName()
Single file name optional.int
targetId()
The ID of the entity it is installed on.String
targetType()
Target type.String
toString()
Prints the immutable valueInstallation
with attribute values.ImmutableInstallation
withAccessTokensUrl(String value)
Copy the current immutable object by setting a value for theaccessTokensUrl
attribute.ImmutableInstallation
withAccount(User value)
Copy the current immutable object by setting a value for theaccount
attribute.ImmutableInstallation
withAppId(int value)
Copy the current immutable object by setting a value for theappId
attribute.ImmutableInstallation
withEvents(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableInstallation
withEvents(String... elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableInstallation
withHtmlUrl(String value)
Copy the current immutable object by setting a present value for the optionalhtmlUrl
attribute.ImmutableInstallation
withHtmlUrl(Optional<String> optional)
Copy the current immutable object by setting an optional value for thehtmlUrl
attribute.ImmutableInstallation
withId(int value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableInstallation
withPermissions(Map<String,? extends String> entries)
Copy the current immutable object by replacing thepermissions
map with the specified map.ImmutableInstallation
withRepositoriesUrl(String value)
Copy the current immutable object by setting a value for therepositoriesUrl
attribute.ImmutableInstallation
withRepositorySelection(String value)
Copy the current immutable object by setting a present value for the optionalrepositorySelection
attribute.ImmutableInstallation
withRepositorySelection(Optional<String> optional)
Copy the current immutable object by setting an optional value for therepositorySelection
attribute.ImmutableInstallation
withSingleFileName(String value)
Copy the current immutable object by setting a present value for the optionalsingleFileName
attribute.ImmutableInstallation
withSingleFileName(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesingleFileName
attribute.ImmutableInstallation
withTargetId(int value)
Copy the current immutable object by setting a value for thetargetId
attribute.ImmutableInstallation
withTargetType(String value)
Copy the current immutable object by setting a value for thetargetType
attribute.
-
-
-
Method Detail
-
id
public int id()
The installation ID.- Specified by:
id
in interfaceInstallation
- Returns:
- the int
-
account
public User account()
Account user.- Specified by:
account
in interfaceInstallation
- Returns:
- the user
-
accessTokensUrl
public String accessTokensUrl()
Access tokens url.- Specified by:
accessTokensUrl
in interfaceInstallation
- Returns:
- the url string
-
repositoriesUrl
public String repositoriesUrl()
Repositories url.- Specified by:
repositoriesUrl
in interfaceInstallation
- Returns:
- the url string
-
htmlUrl
public Optional<String> htmlUrl()
Html URL to Github.- Specified by:
htmlUrl
in interfaceInstallation
- Returns:
- the optional url
-
appId
public int appId()
The APP ID the installations refers to.- Specified by:
appId
in interfaceInstallation
- Returns:
- the int
-
targetId
public int targetId()
The ID of the entity it is installed on. Usually a repo.- Specified by:
targetId
in interfaceInstallation
- Returns:
- the int
-
targetType
public String targetType()
Target type. Can be Organization.- Specified by:
targetType
in interfaceInstallation
- Returns:
- the string
-
permissions
public Map<String,String> permissions()
Permissions map this installation has.- Specified by:
permissions
in interfaceInstallation
- Returns:
- the map
-
events
public List<String> events()
Events list this installation will consume, such as push, pull_request, etc.- Specified by:
events
in interfaceInstallation
- Returns:
- the list
-
singleFileName
public Optional<String> singleFileName()
Single file name optional.- Specified by:
singleFileName
in interfaceInstallation
- Returns:
- the optional
-
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 interfaceInstallation
- Returns:
- the optional string
-
withId
public final ImmutableInstallation withId(int value)
Copy the current immutable object by setting a value for theid
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 theaccount
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 theaccessTokensUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 therepositoriesUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 optionalhtmlUrl
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 thehtmlUrl
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 theappId
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 thetargetId
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- 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 thetargetType
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 thepermissions
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 returningthis
.- 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 ofevents
.- 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 ofevents
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- 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 optionalsingleFileName
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 thesingleFileName
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 optionalrepositorySelection
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 therepositorySelection
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 ofImmutableInstallation
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id
,account
,accessTokensUrl
,repositoriesUrl
,htmlUrl
,appId
,targetId
,targetType
,permissions
,events
,singleFileName
,repositorySelection
.
-
toString
public String toString()
Prints the immutable valueInstallation
with attribute values.
-
copyOf
public static ImmutableInstallation copyOf(Installation instance)
Creates an immutable copy of aInstallation
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
-
builder
public static ImmutableInstallation.Builder builder()
Creates a builder forImmutableInstallation
.ImmutableInstallation.builder() .id(int) // required
id
.account(com.spotify.github.v3.User) // requiredaccount
.accessTokensUrl(String) // requiredaccessTokensUrl
.repositoriesUrl(String) // requiredrepositoriesUrl
.htmlUrl(String) // optionalhtmlUrl
.appId(int) // requiredappId
.targetId(int) // requiredtargetId
.targetType(String) // requiredtargetType
.putPermissions|putAllPermissions(String => String) //permissions
mappings .addEvents|addAllEvents(String) //events
elements .singleFileName(String) // optionalsingleFileName
.repositorySelection(String) // optionalrepositorySelection
.build();- Returns:
- A new ImmutableInstallation builder
-
-