Skip to content

Issue228 cleanup activity changes#229

Merged
aarondcoleman merged 50 commits into
masterfrom
issue228-CleanupActivityChanges
Sep 14, 2017
Merged

Issue228 cleanup activity changes#229
aarondcoleman merged 50 commits into
masterfrom
issue228-CleanupActivityChanges

Conversation

@dwaynefitabase

Copy link
Copy Markdown
Contributor

FIxes #228

An extension of the changes from Redmorello

redmorello and others added 30 commits March 10, 2017 12:35

@WestDiscGolf WestDiscGolf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New one on me :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be different from the others?

</None>
<None Include="SampleData\GetHeartRateIntradayTimeSeries.json" />
<None Include="SampleData\GetActivityLogsList.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = "-");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHeartRateTimeSeriesAsync to keep with the pattern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = null)

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 = "-");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetHeartRateIntradayAsync to keep with the pattern

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public async Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution)

public int Value { get; set; }
}

public class IntradayActivitiesHeart

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All classes should be in their own files :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

[JsonProperty(PropertyName = "activities-heart-intraday")]
public ActivitesHeartIntraday ActivitiesHeartIntraday { get; set; }
}
public class ActivitesHeart

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All classes should be in their own files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread Fitbit.Portable/FitbitClient.cs Outdated
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the check for negative values as per the original code review / pull request

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread Fitbit.Portable/FitbitClient.cs Outdated
return (new JsonDotNetSerializer() { RootProperty = "activities" }).Deserialize<List<ActivityLogsList>>(responseBody);
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace not needed between methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread Fitbit.Portable/FitbitClient.cs Outdated
/// <returns></returns>
public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-")
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace not needed in methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@aarondcoleman aarondcoleman left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@aarondcoleman
aarondcoleman merged commit 0fdb2a0 into master Sep 14, 2017
@aarondcoleman
aarondcoleman deleted the issue228-CleanupActivityChanges branch September 14, 2017 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants