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
  • Field Details

    • ID

      public static final String ID
      See Also:
    • parent

      protected final io.jenkins.blueocean.rest.Reachable parent
  • Constructor Details

    • GithubScm

      public GithubScm(io.jenkins.blueocean.rest.Reachable parent)
  • Method Details

    • getLink

      public io.jenkins.blueocean.rest.hal.Link getLink()
    • getId

      @NonNull public String getId()
      Specified by:
      getId in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
    • getUri

      @NonNull public String getUri()
      Specified by:
      getUri in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
    • getCredentialDomainName

      public String getCredentialDomainName()
    • getCredentialId

      public String getCredentialId()
      Specified by:
      getCredentialId in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
    • getState

      public Object getState()
      Overrides:
      getState in class io.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 class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
    • getServers

      public io.jenkins.blueocean.rest.impl.pipeline.scm.ScmServerEndpointContainer getServers()
      Specified by:
      getServers in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
    • isOrganizationAvatarSupported

      public boolean isOrganizationAvatarSupported()
    • createCredentialId

      @NonNull protected String createCredentialId(@NonNull String apiUrl)
    • 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 class io.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.