Package org.kohsuke.github
Class GHAppCreateTokenBuilder
- java.lang.Object
-
- org.kohsuke.github.GHAppCreateTokenBuilder
-
public class GHAppCreateTokenBuilder extends Object
Creates a access token for a GitHub App Installation.- Author:
- Paulo Miguel Almeida
- See Also:
GHAppInstallation#createToken(Map)
,GHAppInstallation#createToken()
-
-
Field Summary
Fields Modifier and Type Field Description protected org.kohsuke.github.Requester
builder
The builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GHAppInstallationToken
create()
Creates an app token with all the parameters.GitHub
getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.GHAppCreateTokenBuilder
permissions(Map<String,GHPermissionType> permissions)
Set the permissions granted to the access token.GHAppCreateTokenBuilder
repositories(List<String> repositories)
By default the installation token has access to all repositories that the installation can access.GHAppCreateTokenBuilder
repositoryIds(List<Long> repositoryIds)
By default the installation token has access to all repositories that the installation can access.
-
-
-
Method Detail
-
repositoryIds
@BetaApi public GHAppCreateTokenBuilder repositoryIds(List<Long> repositoryIds)
By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide the repository_ids when creating the token. When you omit repository_ids, the response does not contain neither the repositories nor the permissions key.- Parameters:
repositoryIds
- Array containing the repositories Ids- Returns:
- a GHAppCreateTokenBuilder
-
repositories
@BetaApi public GHAppCreateTokenBuilder repositories(List<String> repositories)
By default the installation token has access to all repositories that the installation can access. To restrict the access to specific repositories, you can provide repository names when creating the token.- Parameters:
repositories
- Array containing the repository names- Returns:
- a GHAppCreateTokenBuilder
-
permissions
@BetaApi public GHAppCreateTokenBuilder permissions(Map<String,GHPermissionType> permissions)
Set the permissions granted to the access token. The permissions object includes the permission names and their access type.- Parameters:
permissions
- Map containing the permission names and types.- Returns:
- a GHAppCreateTokenBuilder
-
create
@Preview(MACHINE_MAN) public GHAppInstallationToken create() throws IOException
Creates an app token with all the parameters.You must use a JWT to access this endpoint.
- Returns:
- a GHAppInstallationToken
- Throws:
IOException
- on error
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHub
instance, use a local copy instead of pulling it out of objects.Get the rootGitHub
instance for this object.- Returns:
- the root
GitHub
instance
-
-