Exemple #1
0
        /// <summary>
        /// Gets some stats of the currently authenticated user.
        /// </summary>
        /// <returns>Strava statistics of the currently authenticated user.</returns>
        public async Task<Stats> GetStatsAsync()
        {
            // Get the athlete
            AthleteClient client = new AthleteClient(base.Authentication);
            Athlete a = await client.GetAthleteAsync();

            return await GetStatsAsync(a.Id.ToString());
        }
Exemple #2
0
        /// <summary>
        /// Gets some stats of the currently authenticated user.
        /// </summary>
        /// <returns>Strava statistics of the currently authenticated user.</returns>
        public async Task <Stats> GetStatsAsync()
        {
            // Get the athlete
            AthleteClient client = new AthleteClient(base.Authentication);
            Athlete       a      = await client.GetAthleteAsync();

            return(await GetStatsAsync(a.Id.ToString()));
        }
Exemple #3
0
 public StravaClient(IAuthentication authenticator)
 {
     if (authenticator == null)
     {
         throw new ArgumentException("The IAuthentication object must not be null.");
     }
     _authenticator = authenticator;
     Activities     = new ActivityClient(authenticator);
     Athletes       = new AthleteClient(authenticator);
     Clubs          = new ClubClient(authenticator);
     Gear           = new GearClient(authenticator);
     Segments       = new SegmentClient(authenticator);
     Streams        = new StreamClient(authenticator);
     Uploads        = new UploadClient(authenticator);
     Efforts        = new EffortClient(authenticator);
     Stats          = new StatsClient(authenticator);
     Routes         = new RouteClient(authenticator);
 }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the StravaClient class.
        /// </summary>
        /// <param name="authenticator">The IAuthentication object that holds a valid Access Token.</param>
        /// <seealso cref="WebAuthentication"/>
        /// <seealso cref="StaticAuthentication"/>
        public StravaClient(IAuthentication authenticator)
        {
            if (authenticator != null)
            {
                _authenticator = authenticator;

                Activities = new ActivityClient(authenticator);
                Athletes = new AthleteClient(authenticator);
                Clubs = new ClubClient(authenticator);
                Gear = new GearClient(authenticator);
                Segments = new SegmentClient(authenticator);
                Streams = new StreamClient(authenticator);
                Uploads = new UploadClient(authenticator);
                Efforts = new EffortClient(authenticator);
                Stats = new StatsClient(authenticator);
            }
            else
            {
                throw new ArgumentException("The IAuthentication object must not be null.");
            }
        }
Exemple #5
0
        public async Task <Stats> GetStatsAsync()
        {
            AthleteClient client = new AthleteClient(Authentication);

            return(await GetStatsAsync((await client.GetAthleteAsync()).Id.ToString()));
        }