Ejemplo n.º 1
0
 /// <summary>
 /// Creates an Instance of the TwitchAPI Class.
 /// </summary>
 /// <param name="logger">Instance Of Logger, otherwise no logging is used,  </param>
 /// <param name="rateLimiter">Instance Of RateLimiter, otherwise no ratelimiter is used. </param>
 public TwitchAPI(ILoggerFactory loggerFactory = null, IRateLimiter rateLimiter = null, IHttpCallHandler http = null)
 {
     _logger         = loggerFactory?.CreateLogger <TwitchAPI>();
     _http           = http ?? new TwitchHttpClient(loggerFactory?.CreateLogger <TwitchHttpClient>());
     _rateLimiter    = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance();
     Analytics       = new Analytics(this);
     Auth            = new Auth(this);
     Badges          = new Badges(this);
     Bits            = new Bits(this);
     ChannelFeeds    = new ChannelFeeds(this);
     Channels        = new Channels(this);
     Chat            = new Chat(this);
     Clips           = new Clips(this);
     Collections     = new Collections(this);
     Communities     = new Communities(this);
     Entitlements    = new Entitlements(this);
     Games           = new Games(this);
     Ingests         = new Ingests(this);
     Root            = new Root(this);
     Search          = new Search(this);
     Streams         = new Streams(this);
     Teams           = new Teams(this);
     ThirdParty      = new ThirdParty(this);
     Undocumented    = new Undocumented(this);
     Users           = new Users(this);
     Videos          = new Videos(this);
     Webhooks        = new Webhooks(this);
     Debugging       = new Debugging();
     Settings        = new ApiSettings(this);
     _jsonSerializer = new TwitchLibJsonSerializer();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates an Instance of the TwitchAPI Class.
 /// </summary>
 /// <param name="logger">Instance Of Logger, otherwise no logging is used,  </param>
 /// <param name="rateLimiter">Instance Of RateLimiter, otherwise no ratelimiter is used. </param>
 public TwitchAPI(ILogger <TwitchAPI> logger = null, IRateLimiter rateLimiter = null)
 {
     _logger         = logger;
     _http           = new HttpClient(new TwitchLibCustomHttpMessageHandler(new HttpClientHandler(), _logger));
     _rateLimiter    = rateLimiter ?? BypassLimiter.CreateLimiterBypassInstance();
     Auth            = new Auth(this);
     Blocks          = new Blocks(this);
     Badges          = new Badges(this);
     Bits            = new Bits(this);
     ChannelFeeds    = new ChannelFeeds(this);
     Channels        = new Channels(this);
     Chat            = new Chat(this);
     Clips           = new Clips(this);
     Collections     = new Collections(this);
     Communities     = new Communities(this);
     Follows         = new Follows(this);
     Games           = new Games(this);
     Ingests         = new Ingests(this);
     Root            = new Root(this);
     Search          = new Search(this);
     Streams         = new Streams(this);
     Subscriptions   = new Subscriptions(this);
     Teams           = new Teams(this);
     ThirdParty      = new ThirdParty(this);
     Undocumented    = new Undocumented(this);
     Users           = new Users(this);
     Videos          = new Videos(this);
     Webhooks        = new Webhooks(this);
     Debugging       = new Debugging();
     Settings        = new ApiSettings(this);
     _jsonSerializer = new TwitchLibJsonSerializer();
 }