Пример #1
0
 public ClientBase(string apiHost, string apiVersion, string apiKey = null, IHTTPLogger logger = null)
 {
     ApiHost    = apiHost;
     ApiVersion = apiVersion;
     ApiKey     = apiKey;
     _logger    = logger;
 }
Пример #2
0
 /// <summary>
 /// Constructor for the Client class.
 /// </summary>
 /// <param name="apiKey">App secret from yelp's developer registration page.</param>
 /// <param name="logger">Optional class instance which applies the ILogger interface to support custom logging within the client.</param>
 public BusinessClient(IHTTPLogger logger = null)
     : base(API_HOST, API_VERSION, Credentials.API_KEY_YELP, logger)
 {
     if (string.IsNullOrWhiteSpace(API_HOST))
     {
         throw new ArgumentNullException(nameof(API_HOST));
     }
 }
Пример #3
0
 public GeocodingClient(IHTTPLogger logger = null)
     : base(API_HOST, string.Empty, null, logger)
 {
     if (string.IsNullOrWhiteSpace(API_HOST))
     {
         throw new ArgumentNullException(nameof(API_HOST));
     }
 }
Пример #4
0
 public SpotifyClientConfig WithHTTPLogger(IHTTPLogger httpLogger)
 {
     return(new SpotifyClientConfig(
                BaseAddress,
                Authenticator,
                JSONSerializer,
                HTTPClient,
                RetryHandler,
                httpLogger,
                DefaultPaginator
                ));
 }
Пример #5
0
 public APIQueryGeocode()
 {
     _logger = new DebugLogger();
     _client = new GeocodingClient(new DebugLogger());
 }
Пример #6
0
 public ApiQueryBusiness()
 {
     _logger = new DebugLogger();
     _client = new BusinessClient(_logger);
 }