Issue228 cleanup activity changes#229
Conversation
….NET-1 into redmorello-async-portable Init Merge
… shout be a "-" and not null
…of the null values
…wanted change. Reverted back
…the heart acvtivity models for ease of use. Also decided to kill the new heart rate methods (one's that allowed for a date string or a timespan)
…aarondcoleman/Fitbit.NET into issue228-CleanupActivityChanges Took all local changes in merge
WestDiscGolf
left a comment
There was a problem hiding this comment.
Looks good. I think there may have been a couple of items missed from the original pull request which need tweaking.
| public Fixture fixture { get; set; } | ||
|
|
||
| [TestFixtureSetUp] | ||
| [OneTimeSetUp] |
There was a problem hiding this comment.
Our CI build agents didn't like TestFixtureSetUp used with V3 of the test framework ;-|
| <None Include="SampleData\ApiSubscriptionNotification.json" /> | ||
| <None Include="SampleData\GetActivities.json" /> | ||
| <None Include="SampleData\GetHeartRateTimeSeries.json"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
There was a problem hiding this comment.
Does this need to be different from the others?
| </None> | ||
| <None Include="SampleData\GetHeartRateIntradayTimeSeries.json" /> | ||
| <None Include="SampleData\GetActivityLogsList.json"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
There was a problem hiding this comment.
Same as above? need to be different?
| Task<ApiSubscription> AddSubscriptionAsync(APICollectionType apiCollectionType, string uniqueSubscriptionId, string subscriberId = default(string)); | ||
| Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null); | ||
| Task<ActivityLog> LogActivityAsync(ActivityLog model); | ||
| Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-"); |
There was a problem hiding this comment.
GetHeartRateTimeSeriesAsync to keep with the pattern
There was a problem hiding this comment.
GetHeartRateTimeSeries is the name used in current versions. RedMorello updated it, but this is a braking change so we're gonna keep it the same for now.
Fitbit.NET/Fitbit.Portable/FitbitClient.cs
Line 396 in 079c870
| Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null); | ||
| Task<ActivityLog> LogActivityAsync(ActivityLog model); | ||
| Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-"); | ||
| Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution, string userId = "-"); |
There was a problem hiding this comment.
GetHeartRateIntradayAsync to keep with the pattern
There was a problem hiding this comment.
Fitbit.NET/Fitbit.Portable/FitbitClient.cs
Line 422 in 079c870
| public int Value { get; set; } | ||
| } | ||
|
|
||
| public class IntradayActivitiesHeart |
There was a problem hiding this comment.
All classes should be in their own files :)
| [JsonProperty(PropertyName = "activities-heart-intraday")] | ||
| public ActivitesHeartIntraday ActivitiesHeartIntraday { get; set; } | ||
| } | ||
| public class ActivitesHeart |
There was a problem hiding this comment.
All classes should be in their own files
| public async Task<List<ActivityLogsList>> GetActivityLogsList(DateTime? beforeDate, DateTime? afterDate, int limit = 20, string encodedUserId = default(string)) | ||
| { | ||
| var apiCall = string.Empty; | ||
| limit = limit > 20 ? 20 : limit; |
There was a problem hiding this comment.
Missing the check for negative values as per the original code review / pull request
| return (new JsonDotNetSerializer() { RootProperty = "activities" }).Deserialize<List<ActivityLogsList>>(responseBody); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Extra whitespace not needed between methods
| /// <returns></returns> | ||
| public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-") | ||
| { | ||
|
|
There was a problem hiding this comment.
Extra whitespace not needed in methods
FIxes #228
An extension of the changes from Redmorello