public class GitHubSCMSourceRequest extends jenkins.scm.api.trait.SCMSourceRequest
SCMSourceRequest
for GitHub.jenkins.scm.api.trait.SCMSourceRequest.IntermediateLambda<I>, jenkins.scm.api.trait.SCMSourceRequest.LazyRevisionLambda<H extends jenkins.scm.api.SCMHead,R extends jenkins.scm.api.SCMRevision,I>, jenkins.scm.api.trait.SCMSourceRequest.ProbeLambda<H extends jenkins.scm.api.SCMHead,I>, jenkins.scm.api.trait.SCMSourceRequest.RevisionLambda<H extends jenkins.scm.api.SCMHead,R extends jenkins.scm.api.SCMRevision>, jenkins.scm.api.trait.SCMSourceRequest.Witness<H extends jenkins.scm.api.SCMHead,R extends jenkins.scm.api.SCMRevision>
Modifier and Type | Method and Description |
---|---|
void |
checkApiRateLimit()
Checks the API rate limit and sleeps if over-used until the remaining limit is on-target for expected usage.
|
void |
close() |
Iterable<org.kohsuke.github.GHBranch> |
getBranches()
Returns the branch details or an empty list if either the request did not specify to
isFetchBranches()
or if the branch details have not been provided by setBranches(Iterable) yet. |
Set<String> |
getCollaboratorNames()
Returns the names of the repository collaborators or
null if those details have not been provided yet. |
Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> |
getForkPRStrategies()
Returns the
ChangeRequestCheckoutStrategy to create for each fork pull request. |
org.kohsuke.github.GitHub |
getGitHub()
Returns the
GitHub API connector to use for the request. |
Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> |
getOriginPRStrategies()
Returns the
ChangeRequestCheckoutStrategy to create for each origin pull request. |
org.kohsuke.github.GHPermissionType |
getPermissions(String username)
Returns the permissions of the supplied user.
|
GitHubPermissionsSource |
getPermissionsSource()
Returns the permission source.
|
Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>> |
getPRStrategies()
Returns the
ChangeRequestCheckoutStrategy to create for each pull request. |
Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> |
getPRStrategies(boolean fork)
Returns the
ChangeRequestCheckoutStrategy to create for pull requests of the specified type. |
Iterable<org.kohsuke.github.GHPullRequest> |
getPullRequests()
Returns the pull request details or an empty list if either the request did not specify to
isFetchPRs()
or if the pull request details have not been provided by setPullRequests(Iterable) yet. |
org.kohsuke.github.GHRepository |
getRepository()
Returns the
GHRepository . |
Set<String> |
getRequestedOriginBranchNames()
Gets requested origin branch names.
|
Set<Integer> |
getRequestedPullRequestNumbers()
Returns requested pull request numbers.
|
Set<String> |
getRequestedTagNames()
Gets requested tag names.
|
Iterable<org.kohsuke.github.GHRef> |
getTags()
Returns the branch details or an empty list if either the request did not specify to
isFetchBranches()
or if the branch details have not been provided by setBranches(Iterable) yet. |
boolean |
isFetchBranches()
Returns
true if branch details need to be fetched. |
boolean |
isFetchForkPRs()
Returns
true if fork pull request details need to be fetched. |
boolean |
isFetchOriginPRs()
Returns
true if origin pull request details need to be fetched. |
boolean |
isFetchPRs()
Returns
true if pull request details need to be fetched. |
boolean |
isFetchTags()
Returns
true if tag details need to be fetched. |
void |
setBranches(Iterable<org.kohsuke.github.GHBranch> branches)
Provides the requests with the branch details.
|
void |
setCollaboratorNames(Set<String> collaboratorNames)
Provides the request with the names of the repository collaborators.
|
void |
setGitHub(org.kohsuke.github.GitHub gitHub)
Provides the
GitHub API connector to use for the request. |
void |
setPermissionsSource(GitHubPermissionsSource permissionsSource)
Sets the permission source.
|
void |
setPullRequests(Iterable<org.kohsuke.github.GHPullRequest> pullRequests)
Provides the requests with the pull request details.
|
void |
setRepository(org.kohsuke.github.GHRepository repository)
Sets the
GHRepository . |
void |
setTags(Iterable<org.kohsuke.github.GHRef> tags)
Provides the requests with the tag details.
|
getCriteria, isComplete, isExcluded, isTrusted, listener, manage, process, process, process
public final boolean isFetchBranches()
true
if branch details need to be fetched.true
if branch details need to be fetched.public final boolean isFetchTags()
true
if tag details need to be fetched.true
if tag details need to be fetched.public final boolean isFetchPRs()
true
if pull request details need to be fetched.true
if pull request details need to be fetched.public final boolean isFetchOriginPRs()
true
if origin pull request details need to be fetched.true
if origin pull request details need to be fetched.public final boolean isFetchForkPRs()
true
if fork pull request details need to be fetched.true
if fork pull request details need to be fetched.@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getOriginPRStrategies()
ChangeRequestCheckoutStrategy
to create for each origin pull request.ChangeRequestCheckoutStrategy
to create for each origin pull request.@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getForkPRStrategies()
ChangeRequestCheckoutStrategy
to create for each fork pull request.ChangeRequestCheckoutStrategy
to create for each fork pull request.@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getPRStrategies(boolean fork)
ChangeRequestCheckoutStrategy
to create for pull requests of the specified type.fork
- true
to return strategies for the fork pull requests, false
for origin pull requests.ChangeRequestCheckoutStrategy
to create for each pull request.public final Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>> getPRStrategies()
ChangeRequestCheckoutStrategy
to create for each pull request.ChangeRequestCheckoutStrategy
to create for each pull request keyed by whether the
strategy applies to forks or not (Boolean.FALSE
is the key for origin pull requests)@CheckForNull public final Set<Integer> getRequestedPullRequestNumbers()
null
if the request was not scoped to a subset of pull
requests.@CheckForNull public final Set<String> getRequestedOriginBranchNames()
null
if the request was not scoped to a subset of branches.@CheckForNull public final Set<String> getRequestedTagNames()
null
if the request was not scoped to a subset of tags.public void setPullRequests(@CheckForNull Iterable<org.kohsuke.github.GHPullRequest> pullRequests)
pullRequests
- the pull request details.@NonNull public Iterable<org.kohsuke.github.GHPullRequest> getPullRequests()
isFetchPRs()
or if the pull request details have not been provided by setPullRequests(Iterable)
yet.getRequestedPullRequestNumbers()
or
may be empty if not isFetchPRs()
public final void setBranches(@CheckForNull Iterable<org.kohsuke.github.GHBranch> branches)
branches
- the branch details.@NonNull public final Iterable<org.kohsuke.github.GHBranch> getBranches()
isFetchBranches()
or if the branch details have not been provided by setBranches(Iterable)
yet.public final void setTags(@CheckForNull Iterable<org.kohsuke.github.GHRef> tags)
tags
- the tag details.@NonNull public final Iterable<org.kohsuke.github.GHRef> getTags()
isFetchBranches()
or if the branch details have not been provided by setBranches(Iterable)
yet.public final void setCollaboratorNames(@CheckForNull Set<String> collaboratorNames)
collaboratorNames
- the names of the repository collaborators.public final Set<String> getCollaboratorNames()
null
if those details have not been provided yet.null
if those details have not been provided yet.public final void checkApiRateLimit() throws IOException, InterruptedException
IOException
- if the rate limit could not be obtained.InterruptedException
- if interrupted while waiting.@CheckForNull public org.kohsuke.github.GitHub getGitHub()
GitHub
API connector to use for the request.GitHub
API connector to use for the request or null
if caller should establish
their own.public void setGitHub(@CheckForNull org.kohsuke.github.GitHub gitHub)
GitHub
API connector to use for the request.gitHub
- GitHub
API connector to use for the request.public org.kohsuke.github.GHRepository getRepository()
GHRepository
.GHRepository
.public void setRepository(org.kohsuke.github.GHRepository repository)
GHRepository
.repository
- the GHRepository
.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class jenkins.scm.api.trait.SCMSourceRequest
IOException
public org.kohsuke.github.GHPermissionType getPermissions(String username) throws IOException, InterruptedException
username
- the user.IOException
- if the permissions could not be retrieved.InterruptedException
- if interrupted while retrieving the permissions.@CheckForNull public GitHubPermissionsSource getPermissionsSource()
public void setPermissionsSource(@CheckForNull GitHubPermissionsSource permissionsSource)
permissionsSource
- the permission source.Copyright © 2016–2019. All rights reserved.