Package com.octopusdeploy.api
Class TenantsApi
- java.lang.Object
-
- com.octopusdeploy.api.TenantsApi
-
public class TenantsApi extends java.lang.Object
Methods for the Tenants aspects of the Octopus API
-
-
Constructor Summary
Constructors Constructor Description TenantsApi(AuthenticatedWebClient webClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Tenant>
getAllTenants()
Uses the authenticated web client to pull all tenants from the api and convert them to POJOsTenant
getTenantByName(java.lang.String name)
Get the Tenant with the given name if it exists, return null otherwise.Tenant
getTenantByName(java.lang.String name, boolean ignoreCase)
Get the Tenant with the given name if it exists, return null otherwise.
-
-
-
Constructor Detail
-
TenantsApi
public TenantsApi(AuthenticatedWebClient webClient)
-
-
Method Detail
-
getAllTenants
public java.util.Set<Tenant> getAllTenants() throws java.lang.IllegalArgumentException, java.io.IOException
Uses the authenticated web client to pull all tenants from the api and convert them to POJOs- Returns:
- a Set of Tenants (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
-
getTenantByName
public Tenant getTenantByName(java.lang.String name) throws java.lang.IllegalArgumentException, java.io.IOException
Get the Tenant with the given name if it exists, return null otherwise. Only selects the tenant if the name is an exact match (including case)- Parameters:
name
- The name of the Tenant to find.- Returns:
- The Tenant with that name.
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
getTenantByName
public Tenant getTenantByName(java.lang.String name, boolean ignoreCase) throws java.lang.IllegalArgumentException, java.io.IOException
Get the Tenant with the given name if it exists, return null otherwise.- Parameters:
name
- The name of the Tenant to find.ignoreCase
- when true uses equalsIgnoreCase in the name check- Returns:
- The Environment with that name.
- Throws:
java.lang.IllegalArgumentException
- when the web client receives a bad parameterjava.io.IOException
- When the AuthenticatedWebClient receives and error response code
-
-