Class LoginClient
java.lang.Object
com.developer.nefarious.zjoule.plugin.login.api.LoginClient
- All Implemented Interfaces:
ILoginClient
Implements the
ILoginClient
interface for managing API interactions related to login operations.
The LoginClient
class communicates with SAP AI Core APIs to retrieve deployments
and resource groups, leveraging an IAuthClient
for authentication and an ILoginClientHelper
for building requests and parsing responses.
-
Constructor Summary
ConstructorDescriptionLoginClient
(ILoginClientHelper loginClientHelper, IAuthClient authClient) Constructs a newLoginClient
instance. -
Method Summary
Modifier and TypeMethodDescriptiongetDeployments
(ServiceKey serviceKey, String resourceGroup) Retrieves a list of deployments from the SAP AI Core API.getResourceGroups
(ServiceKey serviceKey) Retrieves a list of resource groups from the SAP AI Core API.
-
Constructor Details
-
LoginClient
Constructs a newLoginClient
instance.- Parameters:
loginClientHelper
- the helper for constructing requests and parsing responses.authClient
- the authentication client for retrieving access tokens.
-
-
Method Details
-
getDeployments
public GetDeploymentsResponse getDeployments(ServiceKey serviceKey, String resourceGroup) throws IOException, InterruptedException Retrieves a list of deployments from the SAP AI Core API.- Specified by:
getDeployments
in interfaceILoginClient
- Parameters:
serviceKey
- theServiceKey
containing credentials and service information.resourceGroup
- the resource group for which deployments are to be retrieved.- Returns:
- a
GetDeploymentsResponse
containing the deployments data. - Throws:
IOException
- if an I/O error occurs during the request.InterruptedException
- if the request is interrupted.
-
getResourceGroups
public GetResourceGroupsResponse getResourceGroups(ServiceKey serviceKey) throws IOException, InterruptedException Retrieves a list of resource groups from the SAP AI Core API.- Specified by:
getResourceGroups
in interfaceILoginClient
- Parameters:
serviceKey
- theServiceKey
containing credentials and service information.- Returns:
- a
GetResourceGroupsResponse
containing the resource groups data. - Throws:
IOException
- if an I/O error occurs during the request.InterruptedException
- if the request is interrupted.
-