Class SolarEdgeApiClientImpl
- java.lang.Object
-
- ninja.codingsolutions.solaredgeapiclient.SolarEdgeApiClientImpl
-
- All Implemented Interfaces:
SolarEdgeApiClient
public class SolarEdgeApiClientImpl extends java.lang.Object implements SolarEdgeApiClient
Implementation of the solar edge api client interface. Requires a provided HttpClient, endPoint URI and api key value
-
-
Constructor Summary
Constructors Constructor Description SolarEdgeApiClientImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<DetailedEnergyResponse>getDetailedEnergyReport(int siteId, java.util.List<MeterType> meters, TimeUnitType timeUnitType, java.time.ZonedDateTime startTime, java.time.ZonedDateTime endTime)Fetches a detailed energy report as recorded by the specified meter types, at the targeted site, within the time window, and in the specified time resolution.java.util.concurrent.CompletionStage<EnvironmentalBenefitsResponse>getEnvironmentalBenefits(int siteId)Fetches the estimated environmental benefits impact information associated with the targeted site idjava.util.concurrent.CompletableFuture<OverviewResponse>getOverviewResponse(int siteId)Fetch a high level summary/overview of the sitejava.util.concurrent.CompletableFuture<SiteDetailsResponse>getSiteDetails(int siteId)Fetch the site details from the APIjava.util.concurrent.CompletableFuture<SupportedVersionsResponse>getSupportedVersions()Get the list of supported versions by the API serverjava.util.concurrent.CompletableFuture<VersionResponse>getVersion()Get the current version of the API
-
-
-
Method Detail
-
getSiteDetails
public java.util.concurrent.CompletableFuture<SiteDetailsResponse> getSiteDetails(int siteId)
Description copied from interface:SolarEdgeApiClientFetch the site details from the API- Specified by:
getSiteDetailsin interfaceSolarEdgeApiClient- Parameters:
siteId- integer id of the site- Returns:
- future that resolve with the site details associated with the provided site id
-
getOverviewResponse
public java.util.concurrent.CompletableFuture<OverviewResponse> getOverviewResponse(int siteId)
Fetch a high level summary/overview of the site- Specified by:
getOverviewResponsein interfaceSolarEdgeApiClient- Parameters:
siteId- integer id of the site- Returns:
- future that resolves with the overview response
-
getVersion
public java.util.concurrent.CompletableFuture<VersionResponse> getVersion()
Get the current version of the API- Specified by:
getVersionin interfaceSolarEdgeApiClient- Returns:
- response object detailing the current version of the API server
-
getSupportedVersions
public java.util.concurrent.CompletableFuture<SupportedVersionsResponse> getSupportedVersions()
Get the list of supported versions by the API server- Specified by:
getSupportedVersionsin interfaceSolarEdgeApiClient- Returns:
- response object detailing the list of versions that the API server supports
-
getEnvironmentalBenefits
public java.util.concurrent.CompletionStage<EnvironmentalBenefitsResponse> getEnvironmentalBenefits(int siteId)
Fetches the estimated environmental benefits impact information associated with the targeted site id- Specified by:
getEnvironmentalBenefitsin interfaceSolarEdgeApiClient- Parameters:
siteId- targeted site id- Returns:
- response object containing the estimated environmental impacts
-
getDetailedEnergyReport
public java.util.concurrent.CompletableFuture<DetailedEnergyResponse> getDetailedEnergyReport(int siteId, java.util.List<MeterType> meters, TimeUnitType timeUnitType, java.time.ZonedDateTime startTime, java.time.ZonedDateTime endTime)
Fetches a detailed energy report as recorded by the specified meter types, at the targeted site, within the time window, and in the specified time resolution. The times should be in the the same zone as the site.- Specified by:
getDetailedEnergyReportin interfaceSolarEdgeApiClient- Parameters:
siteId- integer id of the site idmeters- which meters to include the responsetimeUnitType- what time resolution is desired in the responsestartTime- the start time of the data windowendTime- the end time of the data window- Returns:
- a response containing the energy details as specified by the query parameters
-
-