Class LoginClientHelper
java.lang.Object
com.developer.nefarious.zjoule.plugin.login.api.LoginClientHelper
- All Implemented Interfaces:
ILoginClientHelper
A helper class for handling login-related API operations.
The LoginClientHelper
provides utility methods for creating URIs
and parsing API responses into their corresponding Java objects.
Implements the ILoginClientHelper
interface.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAuthUri
(String tokenEndpoint) Creates a URI for the given API endpoint.parseDeploymentsResponseToObject
(String responseBody) Parses a JSON response body into aGetDeploymentsResponse
object.parseResourceGroupsResponseToObject
(String responseBody) Parses a JSON response body into aGetResourceGroupsResponse
object.
-
Constructor Details
-
LoginClientHelper
public LoginClientHelper()Constructs a newLoginClientHelper
instance.Initializes a
Gson
instance for JSON parsing.
-
-
Method Details
-
createAuthUri
Creates a URI for the given API endpoint.- Specified by:
createAuthUri
in interfaceILoginClientHelper
- Parameters:
tokenEndpoint
- the API endpoint as aString
.- Returns:
- the corresponding
URI
.
-
parseDeploymentsResponseToObject
Parses a JSON response body into aGetDeploymentsResponse
object.- Specified by:
parseDeploymentsResponseToObject
in interfaceILoginClientHelper
- Parameters:
responseBody
- the JSON response body as aString
.- Returns:
- the parsed
GetDeploymentsResponse
.
-
parseResourceGroupsResponseToObject
Parses a JSON response body into aGetResourceGroupsResponse
object.- Specified by:
parseResourceGroupsResponseToObject
in interfaceILoginClientHelper
- Parameters:
responseBody
- the JSON response body as aString
.- Returns:
- the parsed
GetResourceGroupsResponse
.
-