Class EnedisApiClient
java.lang.Object
energy.eddie.regionconnector.fr.enedis.client.EnedisApiClient
- All Implemented Interfaces:
EnedisAccountingPointDataApi,EnedisHealth,EnedisMeterReadingApi,EnedisSubscribedServicesApi
@Component
public class EnedisApiClient
extends Object
implements EnedisMeterReadingApi, EnedisAccountingPointDataApi, EnedisHealth, EnedisSubscribedServicesApi
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnedisApiClient(EnedisTokenProvider tokenProvider, org.springframework.web.reactive.function.client.WebClient webClient) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<UsagePointGeneralData> getAddress(String usagePointId) Retrieves the general data (installation address) of a usage point.reactor.core.publisher.Mono<MeterReading> getConsumptionMeterReading(String usagePointId, LocalDate start, LocalDate end, Granularity granularity) Retrieves meter reading data for a specified usage point over a given period.reactor.core.publisher.Mono<List<ContractualSituation>> getContract(String usagePointId) Retrieves the contractual situations of a usage point, including the contracts, the customer identity and the customer contact data.reactor.core.publisher.Mono<MeterReading> getProductionMeterReading(String usagePointId, LocalDate start, LocalDate end, Granularity granularity) Retrieves meter reading data for a specified usage point over a given period.reactor.core.publisher.Mono<ServiceSubscriptionsResponse> getSubscribedServices(long authorizationId) Retrieves the subscribed services for a given authorization ID.health()
-
Field Details
-
USAGE_POINT_ID_PARAM
- See Also:
-
METERING_DATA_CLC_V_5_CONSUMPTION_LOAD_CURVE
- See Also:
-
METERING_DATA_DC_V_5_DAILY_CONSUMPTION
- See Also:
-
METERING_DATA_PLC_V_5_PRODUCTION_LOAD_CURVE
- See Also:
-
METERING_DATA_DP_V_5_DAILY_PRODUCTION
- See Also:
-
AUTHENTICATION_API
- See Also:
-
METERING_POINT_API
- See Also:
-
CONTRACT_API
- See Also:
-
ADDRESS_API
- See Also:
-
SUBSCRIBED_SERVICES_API
- See Also:
-
SITUATION_CONTRACTUELLE_ENDPOINT
- See Also:
-
GENERAL_DATA_ENDPOINT
- See Also:
-
SUBSCRIBED_SERVICES_V_1
- See Also:
-
-
Constructor Details
-
EnedisApiClient
public EnedisApiClient(EnedisTokenProvider tokenProvider, org.springframework.web.reactive.function.client.WebClient webClient)
-
-
Method Details
-
getSubscribedServices
public reactor.core.publisher.Mono<ServiceSubscriptionsResponse> getSubscribedServices(long authorizationId) Description copied from interface:EnedisSubscribedServicesApiRetrieves the subscribed services for a given authorization ID. This includes the usage points associated with an authorization.- Specified by:
getSubscribedServicesin interfaceEnedisSubscribedServicesApi- Parameters:
authorizationId- the ID of the authorization- Returns:
- a
Monothat emits the subscribed services or an error
-
getConsumptionMeterReading
public reactor.core.publisher.Mono<MeterReading> getConsumptionMeterReading(String usagePointId, LocalDate start, LocalDate end, Granularity granularity) Description copied from interface:EnedisMeterReadingApiRetrieves meter reading data for a specified usage point over a given period. This method supports different granularities for the consumption data:Granularity.PT30MandGranularity.P1D.Important Constraints:
- When using
Granularity.PT30M, the duration between the start and end dates must not exceed 7 days. Batch the requests - The end date is treated as exclusive, meaning consumption on this date is not included in the returned data.
If the specified period or granularity does not meet these constraints, the method may throw an
IllegalArgumentException.- Specified by:
getConsumptionMeterReadingin interfaceEnedisMeterReadingApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.start- The start date of the period for which to retrieve consumption data. Must be before the end date.end- The end date of the period, exclusive. Consumption data up to but not including this date is retrieved.granularity- The granularity of the consumption data. Must be one of the supportedGranularityvalues.- Returns:
- A
Monothat emits theMeterReadingdata for the specified usage point and period or an error signal if the request fails.
- When using
-
getProductionMeterReading
public reactor.core.publisher.Mono<MeterReading> getProductionMeterReading(String usagePointId, LocalDate start, LocalDate end, Granularity granularity) Description copied from interface:EnedisMeterReadingApiRetrieves meter reading data for a specified usage point over a given period. This method supports different granularities for the consumption data:Granularity.PT30MandGranularity.P1D.Important Constraints:
- When using
Granularity.PT30M, the duration between the start and end dates must not exceed 7 days. Batch the requests - The end date is treated as exclusive, meaning consumption on this date is not included in the returned data.
If the specified period or granularity does not meet these constraints, the method may throw an
IllegalArgumentException.- Specified by:
getProductionMeterReadingin interfaceEnedisMeterReadingApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.start- The start date of the period for which to retrieve consumption data. Must be before the end date.end- The end date of the period, exclusive. Consumption data up to but not including this date is retrieved.granularity- The granularity of the consumption data. Must be one of the supportedGranularityvalues.- Returns:
- A
Monothat emits theMeterReadingdata for the specified usage point and period or an error signal if the request fails.
- When using
-
getContract
Description copied from interface:EnedisAccountingPointDataApiRetrieves the contractual situations of a usage point, including the contracts, the customer identity and the customer contact data. The API returns an array, so a usage point can carry more than one situation (for instance consumption and production).- Specified by:
getContractin interfaceEnedisAccountingPointDataApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.- Returns:
- A
Monothat emits theContractualSituationlist for the specified usage point or an error
-
getAddress
Description copied from interface:EnedisAccountingPointDataApiRetrieves the general data (installation address) of a usage point.- Specified by:
getAddressin interfaceEnedisAccountingPointDataApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.- Returns:
- A
Monothat emits theUsagePointGeneralDatafor the specified usage point or an error
-
health
- Specified by:
healthin interfaceEnedisHealth
-