示例#1
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);
 }
示例#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);
                Stats = new StatsClient(authenticator);
                Routes = new RouteClient(authenticator);
            }
            else
            {
                throw new ArgumentException("The IAuthentication object must not be null.");
            }
        }