File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
kafka-connect-fitbit-source/src/main/java/org/radarbase/connect/rest/fitbit/route Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 3131
3232public class FitbitBreathingRateRoute extends FitbitPollingRoute {
3333 private final FitbitBreathingRateAvroConverter converter ;
34- protected static final Duration REQUEST_INTERVAL = Duration .ofDays (30 );
3534
3635 public FitbitBreathingRateRoute (FitbitRequestGenerator generator ,
3736 UserRepository userRepository , AvroData avroData ) {
@@ -50,9 +49,10 @@ protected Stream<FitbitRestRequest> createRequests(User user) {
5049 user .getExternalUserId (), DATE_FORMAT .format (dateRange .start ())));
5150 }
5251
52+ /** Limit range to 30 days as documented here: https://dev.fitbit.com/build/reference/web-api/intraday/get-br-intraday-by-interval/ */
5353 @ Override
5454 Duration getDateRangeInterval () {
55- return REQUEST_INTERVAL ;
55+ return THIRTY_DAYS ;
5656 }
5757
5858 @ Override
Original file line number Diff line number Diff line change 3232
3333public class FitbitIntradayHeartRateVariabilityRoute extends FitbitPollingRoute {
3434 private final FitbitIntradayHeartRateVariabilityAvroConverter converter ;
35- protected static final Duration REQUEST_INTERVAL = Duration .ofDays (30 );
3635
3736 public FitbitIntradayHeartRateVariabilityRoute (FitbitRequestGenerator generator ,
3837 UserRepository userRepository , AvroData avroData ) {
@@ -51,9 +50,10 @@ protected Stream<FitbitRestRequest> createRequests(User user) {
5150 user .getExternalUserId (), DATE_FORMAT .format (dateRange .start ())));
5251 }
5352
53+ /** Limit range to 30 days as documented here: https://dev.fitbit.com/build/reference/web-api/intraday/get-hrv-intraday-by-interval/ */
5454 @ Override
5555 Duration getDateRangeInterval () {
56- return REQUEST_INTERVAL ;
56+ return THIRTY_DAYS ;
5757 }
5858
5959 @ Override
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ public abstract class FitbitPollingRoute implements PollingRequestRoute {
9595 protected static final Duration LOOKBACK_TIME = Duration .ofDays (1 ); // 1 day
9696 protected static final long HISTORICAL_TIME_DAYS = 14L ;
9797 protected static final Duration ONE_DAY = DAYS .getDuration ();
98+ protected static final Duration THIRTY_DAYS = Duration .ofDays (30 );
9899 protected static final Duration ONE_NANO = NANOS .getDuration ();
99100 protected static final TemporalAmount ONE_SECOND = SECONDS .getDuration ();
100101 protected static final TemporalAmount ONE_MINUTE = MINUTES .getDuration ();
Original file line number Diff line number Diff line change 3131
3232public class FitbitSkinTemperatureRoute extends FitbitPollingRoute {
3333 private final FitbitSkinTemperatureAvroConverter converter ;
34- protected static final Duration REQUEST_INTERVAL = Duration .ofDays (30 );
3534
3635 public FitbitSkinTemperatureRoute (FitbitRequestGenerator generator ,
3736 UserRepository userRepository , AvroData avroData ) {
@@ -50,9 +49,10 @@ protected Stream<FitbitRestRequest> createRequests(User user) {
5049 user .getExternalUserId (), DATE_FORMAT .format (dateRange .start ())));
5150 }
5251
52+ /** Limit range to 30 days as documented here: https://dev.fitbit.com/build/reference/web-api/temperature/get-temperature-skin-summary-by-interval */
5353 @ Override
5454 Duration getDateRangeInterval () {
55- return REQUEST_INTERVAL ;
55+ return THIRTY_DAYS ;
5656 }
5757
5858 @ Override
You can’t perform that action at this time.
0 commit comments