Example #1
0
 /// <summary>
 /// Delete a goal instance
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The identifier of the goal to delete.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> DeleteAsync(this IGoals operations, string goalId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.DeleteWithHttpMessagesAsync(goalId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> AddMealAsync(this IGoals operations, AddMealRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddMealWithHttpMessagesAsync(request, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update collection of goal instances with merge
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalsWrapper'>
 /// The collection of goal instances to update. Only the fields present in the
 /// passed in model will be updated. All other fields and colelctions
 /// will be left, as is, unless invalid.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <GoalsResponse> UpdateAsync(this IGoals operations, GoalsWrapper goalsWrapper, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(goalsWrapper, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update/Replace a complete goal instance with no merge
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goal'>
 /// The instance of the goal to update. The entire goal will be replaced with
 /// this version.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Goal> ReplaceAsync(this IGoals operations, Goal goal, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ReplaceWithHttpMessagesAsync(goal, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get a collection of all goals
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='types'>
 /// The goal types(e.g Steps, CaloriesBurned) filter.
 /// </param>
 /// <param name='windowTypes'>
 /// The goal window types(e.g Daily, Weekly) filter.
 /// </param>
 /// <param name='startDate'>
 /// The start date for date range filter.
 /// </param>
 /// <param name='endDate'>
 /// The end date for date range filter.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <GoalsResponse> GetAsync(this IGoals operations, string types = default(string), string windowTypes = default(string), System.DateTime?startDate = default(System.DateTime?), System.DateTime?endDate = default(System.DateTime?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(types, windowTypes, startDate, endDate, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get an instance of a specific goal
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The goal identifier.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Goal> GetByIdAsync(this IGoals operations, System.Guid goalId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetByIdWithHttpMessagesAsync(goalId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <GoalModel> > GetGoalsAsync(this IGoals operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGoalsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='date'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> GetMealsForDateAsync(this IGoals operations, DateTime?date = default(DateTime?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetMealsForDateWithHttpMessagesAsync(date, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='progressId'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> RemoveProgressAsync(this IGoals operations, int progressId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RemoveProgressWithHttpMessagesAsync(progressId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #10
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> DeleteGoalAsync(this IGoals operations, int goalId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteGoalWithHttpMessagesAsync(goalId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update collection of goal instances with merge
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalsWrapper'>
 /// The collection of goal instances to update. Only the fields present in the
 /// passed in model will be updated. All other fields and colelctions
 /// will be left, as is, unless invalid.
 /// </param>
 public static GoalsResponse Update(this IGoals operations, GoalsWrapper goalsWrapper)
 {
     return(operations.UpdateAsync(goalsWrapper).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Update/Replace a complete goal instance with no merge
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goal'>
 /// The instance of the goal to update. The entire goal will be replaced with
 /// this version.
 /// </param>
 public static Goal Replace(this IGoals operations, Goal goal)
 {
     return(operations.ReplaceAsync(goal).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get a collection of all goals
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='types'>
 /// The goal types(e.g Steps, CaloriesBurned) filter.
 /// </param>
 /// <param name='windowTypes'>
 /// The goal window types(e.g Daily, Weekly) filter.
 /// </param>
 /// <param name='startDate'>
 /// The start date for date range filter.
 /// </param>
 /// <param name='endDate'>
 /// The end date for date range filter.
 /// </param>
 public static GoalsResponse Get(this IGoals operations, string types = default(string), string windowTypes = default(string), System.DateTime?startDate = default(System.DateTime?), System.DateTime?endDate = default(System.DateTime?))
 {
     return(operations.GetAsync(types, windowTypes, startDate, endDate).GetAwaiter().GetResult());
 }
Example #14
0
 /// <summary>
 /// Delete a goal instance
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The identifier of the goal to delete.
 /// </param>
 public static object Delete(this IGoals operations, string goalId)
 {
     return(operations.DeleteAsync(goalId).GetAwaiter().GetResult());
 }
Example #15
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='request'>
 /// </param>
 public static object AddMeal(this IGoals operations, AddMealRequest request)
 {
     return(Task.Factory.StartNew(s => ((IGoals)s).AddMealAsync(request), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #16
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='date'>
 /// </param>
 public static object GetMealsForDate(this IGoals operations, DateTime?date = default(DateTime?))
 {
     return(Task.Factory.StartNew(s => ((IGoals)s).GetMealsForDateAsync(date), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Example #17
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='progressId'>
 /// </param>
 public static object RemoveProgress(this IGoals operations, int progressId)
 {
     return(Task.Factory.StartNew(s => ((IGoals)s).RemoveProgressAsync(progressId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get an instance of a specific goal
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The goal identifier.
 /// </param>
 public static Goal GetById(this IGoals operations, System.Guid goalId)
 {
     return(operations.GetByIdAsync(goalId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete a goal instance
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The identifier of the goal to delete.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IGoals operations, System.Guid goalId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(goalId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #20
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <GoalModel> GetGoals(this IGoals operations)
 {
     return(Task.Factory.StartNew(s => ((IGoals)s).GetGoalsAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete a goal instance
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// The identifier of the goal to delete.
 /// </param>
 public static void Delete(this IGoals operations, System.Guid goalId)
 {
     operations.DeleteAsync(goalId).GetAwaiter().GetResult();
 }
Example #22
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalId'>
 /// </param>
 public static object DeleteGoal(this IGoals operations, int goalId)
 {
     return(Task.Factory.StartNew(s => ((IGoals)s).DeleteGoalAsync(goalId), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get a collection of the active goals
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='types'>
 /// The goal types(e.g Steps, CaloriesBurned) filter.
 /// </param>
 /// <param name='windowTypes'>
 /// The goal window types(e.g Daily, Weekly) filter.
 /// </param>
 public static GoalsResponse GetActive(this IGoals operations, string types = default(string), string windowTypes = default(string))
 {
     return(operations.GetActiveAsync(types, windowTypes).GetAwaiter().GetResult());
 }
Example #24
0
 /// <summary>
 /// Post a collection of goal instances
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='goalsWrapper'>
 /// The collection of goal instances to create.
 /// </param>
 public static object Create(this IGoals operations, GoalsWrapper goalsWrapper)
 {
     return(operations.CreateAsync(goalsWrapper).GetAwaiter().GetResult());
 }