Class EnedisApiClient
java.lang.Object
energy.eddie.regionconnector.fr.enedis.client.EnedisApiClient
- All Implemented Interfaces:
EnedisAccountingPointDataApi,EnedisHealth,EnedisMeterReadingApi
@Component
public class EnedisApiClient
extends Object
implements EnedisMeterReadingApi, EnedisAccountingPointDataApi, EnedisHealth
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnedisApiClient(EnedisTokenProvider tokenProvider, org.springframework.web.reactive.function.client.WebClient webClient) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<CustomerAddress> getAddress(String usagePointId) Retrieves the address data for a specified 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<CustomerContact> getContact(String usagePointId) Retrieves the contact data for a specified usage point.reactor.core.publisher.Mono<CustomerContract> getContract(String usagePointId) Retrieves the contract data for a specified usage point.reactor.core.publisher.Mono<CustomerIdentity> getIdentity(String usagePointId) Retrieves the identity data for a specified usage point.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.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:
-
CONTACT_API
- See Also:
-
IDENTITY_API
- See Also:
-
ADDRESS_API
- See Also:
-
-
Constructor Details
-
EnedisApiClient
public EnedisApiClient(EnedisTokenProvider tokenProvider, org.springframework.web.reactive.function.client.WebClient webClient)
-
-
Method Details
-
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 contract data for a specified usage point.- Specified by:
getContractin interfaceEnedisAccountingPointDataApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.- Returns:
- A
Monothat emits theCustomerContractdata for the specified usage point or an error
-
getAddress
Description copied from interface:EnedisAccountingPointDataApiRetrieves the address data for a specified 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 theCustomerAddressdata for the specified usage point or an error
-
getIdentity
Description copied from interface:EnedisAccountingPointDataApiRetrieves the identity data for a specified usage point.- Specified by:
getIdentityin interfaceEnedisAccountingPointDataApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.- Returns:
- A
Monothat emits theCustomerIdentitydata for the specified usage point or an error
-
getContact
Description copied from interface:EnedisAccountingPointDataApiRetrieves the contact data for a specified usage point.- Specified by:
getContactin interfaceEnedisAccountingPointDataApi- Parameters:
usagePointId- The unique identifier for the usage point. Must not be null or empty.- Returns:
- A
Monothat emits theCustomerContactdata for the specified usage point or an error
-
health
- Specified by:
healthin interfaceEnedisHealth
-