Class GithubScm
- java.lang.Object
-
- io.jenkins.blueocean.rest.model.Resource
-
- io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
- io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm
-
- io.jenkins.blueocean.blueocean_github_pipeline.GithubScm
-
- All Implemented Interfaces:
io.jenkins.blueocean.rest.Reachable
- Direct Known Subclasses:
GithubEnterpriseScm
public class GithubScm extends io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm
- Author:
- Vivek Pandey
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GithubScm.GithubScmFactory
-
Constructor Summary
Constructors Constructor Description GithubScm(io.jenkins.blueocean.rest.Reachable parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static HttpURLConnection
connect(String apiUrl, String accessToken)
protected String
createCredentialId(String apiUrl)
protected String
getCredentialDescription()
String
getCredentialDomainName()
String
getCredentialId()
protected String
getCustomApiUri()
String
getId()
io.jenkins.blueocean.rest.hal.Link
getLink()
io.jenkins.blueocean.rest.model.Container<io.jenkins.blueocean.rest.impl.pipeline.scm.ScmOrganization>
getOrganizations()
GithubRepository
getRepository(String jobName)
io.jenkins.blueocean.rest.impl.pipeline.scm.ScmServerEndpointContainer
getServers()
Object
getState()
String
getUri()
boolean
isOrganizationAvatarSupported()
org.kohsuke.stapler.HttpResponse
validateAndCreate(net.sf.json.JSONObject request)
protected void
validateExistingAccessToken()
Ensure any existing access token is valid and has the proper scopes.
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
parent
protected final io.jenkins.blueocean.rest.Reachable parent
-
-
Method Detail
-
getLink
public io.jenkins.blueocean.rest.hal.Link getLink()
-
getId
@NonNull public String getId()
- Specified by:
getId
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
getUri
@NonNull public String getUri()
- Specified by:
getUri
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
getCredentialDomainName
public String getCredentialDomainName()
-
getCredentialId
public String getCredentialId()
- Specified by:
getCredentialId
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
getState
public Object getState()
- Overrides:
getState
in classio.jenkins.blueocean.rest.model.Resource
-
getRepository
@GET @WebMethod(name="repository") public GithubRepository getRepository(@QueryParameter String jobName)
- Parameters:
jobName
- the job name- Returns:
- GHRepository used by the job
-
getOrganizations
public io.jenkins.blueocean.rest.model.Container<io.jenkins.blueocean.rest.impl.pipeline.scm.ScmOrganization> getOrganizations()
- Specified by:
getOrganizations
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
getServers
public io.jenkins.blueocean.rest.impl.pipeline.scm.ScmServerEndpointContainer getServers()
- Specified by:
getServers
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
isOrganizationAvatarSupported
public boolean isOrganizationAvatarSupported()
-
getCredentialDescription
@NonNull protected String getCredentialDescription()
-
getCustomApiUri
@NonNull protected String getCustomApiUri()
-
validateAndCreate
public org.kohsuke.stapler.HttpResponse validateAndCreate(@JsonBody net.sf.json.JSONObject request)
- Specified by:
validateAndCreate
in classio.jenkins.blueocean.rest.impl.pipeline.scm.Scm
-
connect
protected static HttpURLConnection connect(String apiUrl, String accessToken) throws IOException
- Throws:
IOException
-
validateExistingAccessToken
protected void validateExistingAccessToken()
Ensure any existing access token is valid and has the proper scopes.
-
-