Interface EnedisMeterReadingApi

All Known Implementing Classes:
EnedisApiClient

public interface EnedisMeterReadingApi
  • Method Details

    • getConsumptionMeterReading

      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. 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.

      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.
      Throws:
      IllegalArgumentException - if any parameter is invalid or if the date range and granularity combination is not supported.
      org.springframework.web.reactive.function.client.WebClientResponseException - if the request to the ENEDIS API fails e.g. due to an invalid token or a bad request.
    • getProductionMeterReading

      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. 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.

      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.
      Throws:
      IllegalArgumentException - if any parameter is invalid or if the date range and granularity combination is not supported.
      org.springframework.web.reactive.function.client.WebClientResponseException - if the request to the ENEDIS API fails e.g. due to an invalid token or a bad request.