예제 #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()));
        }
예제 #2
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);
            }
            else
            {
                throw new ArgumentException("The IAuthentication object must not be null.");
            }
        }