public void UpdateActivityAsync(Action<StrengthTrainingActivitiesPastModel> success, Action<HealthGraphException> failure, StrengthTrainingActivitiesPastModel activityToUpdate)
 {
     var request = PrepareActivitiesUpdateRequest(activityToUpdate);
     _tokenManager.ExecuteAsync<StrengthTrainingActivitiesPastModel>(request, success, failure);
 }
        /// <summary>
        /// Prepares the request object to update an existing model.
        /// </summary>
        /// <param name="activityToUpdate"></param>
        /// <returns></returns>
        private IRestRequest PrepareActivitiesUpdateRequest(StrengthTrainingActivitiesPastModel activityToUpdate)
        {
            var request = new RestRequest(Method.PUT);
            request.Resource = activityToUpdate.Uri;

            ValidateModel(activityToUpdate);

            //Add body to the request
            request.AddParameter(StrengthTrainingActivitiesPastModel.ContentType, _tokenManager.DefaultJsonSerializer.Serialize(new
            {
                start_time = activityToUpdate.StartTime,
                notes = activityToUpdate.Notes,
                total_calories = activityToUpdate.TotalCalories,
                exercises = activityToUpdate.Exercises
            }), ParameterType.RequestBody);
            return request;
        }
 public StrengthTrainingActivitiesPastModel UpdateActivity(StrengthTrainingActivitiesPastModel activityToUpdate)
 {
     var request = PrepareActivitiesUpdateRequest(activityToUpdate);
     return _tokenManager.Execute<StrengthTrainingActivitiesPastModel>(request);
 }