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 Details

  • 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: EnedisMeterReadingApi
      Retrieves meter reading data for a specified usage point over a given period. This method supports different granularities for the consumption data: Granularity.PT30M and Granularity.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:
      getConsumptionMeterReading in interface EnedisMeterReadingApi
      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 supported Granularity values.
      Returns:
      A Mono that emits the MeterReading data for the specified usage point and period or an error signal if the request fails.
    • getProductionMeterReading

      public reactor.core.publisher.Mono<MeterReading> getProductionMeterReading(String usagePointId, LocalDate start, LocalDate end, Granularity granularity)
      Description copied from interface: EnedisMeterReadingApi
      Retrieves meter reading data for a specified usage point over a given period. This method supports different granularities for the consumption data: Granularity.PT30M and Granularity.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:
      getProductionMeterReading in interface EnedisMeterReadingApi
      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 supported Granularity values.
      Returns:
      A Mono that emits the MeterReading data for the specified usage point and period or an error signal if the request fails.
    • getContract

      public reactor.core.publisher.Mono<CustomerContract> getContract(String usagePointId)
      Description copied from interface: EnedisAccountingPointDataApi
      Retrieves the contract data for a specified usage point.
      Specified by:
      getContract in interface EnedisAccountingPointDataApi
      Parameters:
      usagePointId - The unique identifier for the usage point. Must not be null or empty.
      Returns:
      A Mono that emits the CustomerContract data for the specified usage point or an error
    • getAddress

      public reactor.core.publisher.Mono<CustomerAddress> getAddress(String usagePointId)
      Description copied from interface: EnedisAccountingPointDataApi
      Retrieves the address data for a specified usage point.
      Specified by:
      getAddress in interface EnedisAccountingPointDataApi
      Parameters:
      usagePointId - The unique identifier for the usage point. Must not be null or empty.
      Returns:
      A Mono that emits the CustomerAddress data for the specified usage point or an error
    • getIdentity

      public reactor.core.publisher.Mono<CustomerIdentity> getIdentity(String usagePointId)
      Description copied from interface: EnedisAccountingPointDataApi
      Retrieves the identity data for a specified usage point.
      Specified by:
      getIdentity in interface EnedisAccountingPointDataApi
      Parameters:
      usagePointId - The unique identifier for the usage point. Must not be null or empty.
      Returns:
      A Mono that emits the CustomerIdentity data for the specified usage point or an error
    • getContact

      public reactor.core.publisher.Mono<CustomerContact> getContact(String usagePointId)
      Description copied from interface: EnedisAccountingPointDataApi
      Retrieves the contact data for a specified usage point.
      Specified by:
      getContact in interface EnedisAccountingPointDataApi
      Parameters:
      usagePointId - The unique identifier for the usage point. Must not be null or empty.
      Returns:
      A Mono that emits the CustomerContact data for the specified usage point or an error
    • health

      public Map<String,org.springframework.boot.actuate.health.Health> health()
      Specified by:
      health in interface EnedisHealth