public StreamClient(String apiKey, String apiSecret, StreamClientOptions options = null) { if (String.IsNullOrWhiteSpace(apiKey)) throw new ArgumentNullException("apiKey", "Must have an apiKey"); if (String.IsNullOrWhiteSpace(apiSecret)) throw new ArgumentNullException("apiSecret", "Must have an apiSecret"); _apiKey = apiKey; _apiSecret = apiSecret; _options = options ?? StreamClientOptions.Default; _client = new RestClient(GetBaseUrl()); }
private StreamClient(string apiKey, IToken streamClientToken, RestClient client, StreamClientOptions options = null) { if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentNullException("apiKey", "Must have an apiKey"); } if (streamClientToken is null) { throw new ArgumentNullException("streamClientToken", "Must have a streamClientToken"); } _apiKey = apiKey; _streamClientToken = streamClientToken; _options = options ?? StreamClientOptions.Default; _client = client; }
public StreamClient(string apiKey, string apiSecretOrToken, StreamClientOptions options = null) { if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentNullException("apiKey", "Must have an apiKey"); } if (string.IsNullOrWhiteSpace(apiSecretOrToken)) { throw new ArgumentNullException("apiSecret", "Must have an apiSecret or user session token"); } _apiKey = apiKey; _streamClientToken = TokenFactory.For(apiSecretOrToken); _options = options ?? StreamClientOptions.Default; _client = new RestClient(GetBaseUrl(_options.Location), TimeSpan.FromMilliseconds(_options.Timeout)); }
public StreamClient(string apiKey, string apiSecret, StreamClientOptions options = null) { if (string.IsNullOrWhiteSpace(apiKey)) { throw new ArgumentNullException("apiKey", "Must have an apiKey"); } if (string.IsNullOrWhiteSpace(apiSecret)) { throw new ArgumentNullException("apiSecret", "Must have an apiSecret"); } _apiKey = apiKey; _apiSecret = apiSecret; _options = options ?? StreamClientOptions.Default; _client = new RestClient(GetBaseUrl(), TimeSpan.FromMilliseconds(_options.Timeout)); }