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 classImmutableInstallation.BuilderBuilds instances of typeImmutableInstallation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaccessTokensUrl()Access tokens url.Useraccount()Account user.intappId()The APP ID the installations refers to.static ImmutableInstallation.Builderbuilder()Creates a builder forImmutableInstallation.static ImmutableInstallationcopyOf(Installation instance)Creates an immutable copy of aInstallationvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableInstallationthat have equal attribute values.List<String>events()Events list this installation will consume, such as push, pull_request, etc.inthashCode()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.intid()The installation ID.Map<String,String>permissions()Permissions map this installation has.StringrepositoriesUrl()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.inttargetId()The ID of the entity it is installed on.StringtargetType()Target type.StringtoString()Prints the immutable valueInstallationwith attribute values.ImmutableInstallationwithAccessTokensUrl(String value)Copy the current immutable object by setting a value for theaccessTokensUrlattribute.ImmutableInstallationwithAccount(User value)Copy the current immutable object by setting a value for theaccountattribute.ImmutableInstallationwithAppId(int value)Copy the current immutable object by setting a value for theappIdattribute.ImmutableInstallationwithEvents(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofevents.ImmutableInstallationwithEvents(String... elements)Copy the current immutable object with elements that replace the content ofevents.ImmutableInstallationwithHtmlUrl(String value)Copy the current immutable object by setting a present value for the optionalhtmlUrlattribute.ImmutableInstallationwithHtmlUrl(Optional<String> optional)Copy the current immutable object by setting an optional value for thehtmlUrlattribute.ImmutableInstallationwithId(int value)Copy the current immutable object by setting a value for theidattribute.ImmutableInstallationwithPermissions(Map<String,? extends String> entries)Copy the current immutable object by replacing thepermissionsmap with the specified map.ImmutableInstallationwithRepositoriesUrl(String value)Copy the current immutable object by setting a value for therepositoriesUrlattribute.ImmutableInstallationwithRepositorySelection(String value)Copy the current immutable object by setting a present value for the optionalrepositorySelectionattribute.ImmutableInstallationwithRepositorySelection(Optional<String> optional)Copy the current immutable object by setting an optional value for therepositorySelectionattribute.ImmutableInstallationwithSingleFileName(String value)Copy the current immutable object by setting a present value for the optionalsingleFileNameattribute.ImmutableInstallationwithSingleFileName(Optional<String> optional)Copy the current immutable object by setting an optional value for thesingleFileNameattribute.ImmutableInstallationwithTargetId(int value)Copy the current immutable object by setting a value for thetargetIdattribute.ImmutableInstallationwithTargetType(String value)Copy the current immutable object by setting a value for thetargetTypeattribute.
-
-
-
Method Detail
-
id
public int id()
The installation ID.- Specified by:
idin interfaceInstallation- Returns:
- the int
-
account
public User account()
Account user.- Specified by:
accountin interfaceInstallation- Returns:
- the user
-
accessTokensUrl
public String accessTokensUrl()
Access tokens url.- Specified by:
accessTokensUrlin interfaceInstallation- Returns:
- the url string
-
repositoriesUrl
public String repositoriesUrl()
Repositories url.- Specified by:
repositoriesUrlin interfaceInstallation- Returns:
- the url string
-
htmlUrl
public Optional<String> htmlUrl()
Html URL to Github.- Specified by:
htmlUrlin interfaceInstallation- Returns:
- the optional url
-
appId
public int appId()
The APP ID the installations refers to.- Specified by:
appIdin interfaceInstallation- Returns:
- the int
-
targetId
public int targetId()
The ID of the entity it is installed on. Usually a repo.- Specified by:
targetIdin interfaceInstallation- Returns:
- the int
-
targetType
public String targetType()
Target type. Can be Organization.- Specified by:
targetTypein interfaceInstallation- Returns:
- the string
-
permissions
public Map<String,String> permissions()
Permissions map this installation has.- Specified by:
permissionsin interfaceInstallation- Returns:
- the map
-
events
public List<String> events()
Events list this installation will consume, such as push, pull_request, etc.- Specified by:
eventsin interfaceInstallation- Returns:
- the list
-
singleFileName
public Optional<String> singleFileName()
Single file name optional.- Specified by:
singleFileNamein 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:
repositorySelectionin interfaceInstallation- Returns:
- the optional string
-
withId
public final ImmutableInstallation withId(int value)
Copy the current immutable object by setting a value for theidattribute. 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
thisobject
-
withAccount
public final ImmutableInstallation withAccount(User value)
Copy the current immutable object by setting a value for theaccountattribute. 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
thisobject
-
withAccessTokensUrl
public final ImmutableInstallation withAccessTokensUrl(String value)
Copy the current immutable object by setting a value for theaccessTokensUrlattribute. 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
thisobject
-
withRepositoriesUrl
public final ImmutableInstallation withRepositoriesUrl(String value)
Copy the current immutable object by setting a value for therepositoriesUrlattribute. 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
thisobject
-
withHtmlUrl
public final ImmutableInstallation withHtmlUrl(String value)
Copy the current immutable object by setting a present value for the optionalhtmlUrlattribute.- Parameters:
value- The value for htmlUrl- Returns:
- A modified copy of
thisobject
-
withHtmlUrl
public final ImmutableInstallation withHtmlUrl(Optional<String> optional)
Copy the current immutable object by setting an optional value for thehtmlUrlattribute. 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
thisobject
-
withAppId
public final ImmutableInstallation withAppId(int value)
Copy the current immutable object by setting a value for theappIdattribute. 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
thisobject
-
withTargetId
public final ImmutableInstallation withTargetId(int value)
Copy the current immutable object by setting a value for thetargetIdattribute. 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
thisobject
-
withTargetType
public final ImmutableInstallation withTargetType(String value)
Copy the current immutable object by setting a value for thetargetTypeattribute. 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
thisobject
-
withPermissions
public final ImmutableInstallation withPermissions(Map<String,? extends String> entries)
Copy the current immutable object by replacing thepermissionsmap 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
thisobject
-
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
thisobject
-
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
thisobject
-
withSingleFileName
public final ImmutableInstallation withSingleFileName(String value)
Copy the current immutable object by setting a present value for the optionalsingleFileNameattribute.- Parameters:
value- The value for singleFileName- Returns:
- A modified copy of
thisobject
-
withSingleFileName
public final ImmutableInstallation withSingleFileName(Optional<String> optional)
Copy the current immutable object by setting an optional value for thesingleFileNameattribute. 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
thisobject
-
withRepositorySelection
public final ImmutableInstallation withRepositorySelection(String value)
Copy the current immutable object by setting a present value for the optionalrepositorySelectionattribute.- Parameters:
value- The value for repositorySelection- Returns:
- A modified copy of
thisobject
-
withRepositorySelection
public final ImmutableInstallation withRepositorySelection(Optional<String> optional)
Copy the current immutable object by setting an optional value for therepositorySelectionattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableInstallationthat 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 valueInstallationwith attribute values.
-
copyOf
public static ImmutableInstallation copyOf(Installation instance)
Creates an immutable copy of aInstallationvalue. 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) // requiredid.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) //permissionsmappings .addEvents|addAllEvents(String) //eventselements .singleFileName(String) // optionalsingleFileName.repositorySelection(String) // optionalrepositorySelection.build();- Returns:
- A new ImmutableInstallation builder
-
-