Package com.octopusdeploy.api
Class ProjectsApi
- java.lang.Object
-
- com.octopusdeploy.api.ProjectsApi
-
public class ProjectsApi extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ProjectsApi(AuthenticatedWebClient webClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Project>
getAllProjects()
Uses the authenticated web client to pull all projects from the api and convert them to POJOsProject
getProjectByName(java.lang.String name)
Loads in the full list of projects from the API, then selects one project by name.Project
getProjectByName(java.lang.String name, boolean ignoreCase)
Loads in the full list of projects from the API, then selects one project by name.
-
-
-
Constructor Detail
-
ProjectsApi
public ProjectsApi(AuthenticatedWebClient webClient)
-
-
Method Detail
-
getAllProjects
public java.util.Set<Project> getAllProjects() throws java.lang.IllegalArgumentException, java.io.IOException
Uses the authenticated web client to pull all projects from the api and convert them to POJOs- Returns:
- a Set of Projects (may be empty)
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
getProjectByName
public Project getProjectByName(java.lang.String name) throws java.lang.IllegalArgumentException, java.io.IOException
Loads in the full list of projects from the API, then selects one project by name. Only selects the project if the name is an exact match (including case)- Parameters:
name
- name of the project to select- Returns:
- the named project or null if no such project exists
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
getProjectByName
public Project getProjectByName(java.lang.String name, boolean ignoreCase) throws java.lang.IllegalArgumentException, java.io.IOException
Loads in the full list of projects from the API, then selects one project by name.- Parameters:
name
- name of the project to selectignoreCase
- when true uses equalsIgnoreCase in the name check- Returns:
- the named project or null if no such project exists
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
-