Beispiel #1
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.");
            }
        }
Beispiel #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.");
            }
        }