Class ClientFactory


  • public class ClientFactory
    extends Object
    Creates clients for communicating with Google APIs.
    • Constructor Detail

      • ClientFactory

        public ClientFactory​(ItemGroup itemGroup,
                             com.google.common.collect.ImmutableList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements,
                             String credentialsId,
                             Optional<com.google.api.client.http.HttpTransport> httpTransport)
                      throws AbortException
        Creates a ClientFactory instance.
        Parameters:
        itemGroup - A handle to the Jenkins instance.
        domainRequirements - A list of domain requirements.
        credentialsId - The ID of the GoogleRobotCredentials to be retrieved from Jenkins and utilized for authorization.
        httpTransport - If specified, the HTTP transport this factory will utilize for clients it creates.
        Throws:
        AbortException - If failed to create a new client factory.
      • ClientFactory

        public ClientFactory​(ItemGroup itemGroup,
                             String credentialsId)
                      throws AbortException
        Creates a ClientFactory instance without specifying domainRequirements or httpTransport.
        Parameters:
        itemGroup - A handle to the Jenkins instance.
        credentialsId - The ID of the GoogleRobotCredentials to be retrieved from Jenkins and utilized for authorization.
        Throws:
        AbortException - If failed to create a new client factory.
    • Method Detail

      • getDefaultProjectId

        public String getDefaultProjectId()
        Returns:
        The default Project ID associated with this ClientFactory's credentials.
      • getCredentialsId

        public String getCredentialsId()
        Returns:
        The Credentials ID for this ClientFactory.