/// <summary> /// Create a copy of the options /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Copy <T>() where T : RestClientOptions, new() { var copy = new T { BaseAddress = BaseAddress, LogVerbosity = LogVerbosity, Proxy = Proxy, LogWriters = LogWriters, RateLimiters = RateLimiters, RateLimitingBehaviour = RateLimitingBehaviour, RequestTimeout = RequestTimeout }; if (ApiCredentials != null) { copy.ApiCredentials = ApiCredentials.Copy(); } return(copy); }
/// <summary> /// Create a copy of the options /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public T Copy <T>() where T : SocketClientOptions, new() { var copy = new T { BaseAddress = BaseAddress, LogVerbosity = LogVerbosity, Proxy = Proxy, LogWriters = LogWriters, AutoReconnect = AutoReconnect, ReconnectInterval = ReconnectInterval, SocketResponseTimeout = SocketResponseTimeout, SocketSubscriptionsCombineTarget = SocketSubscriptionsCombineTarget }; if (ApiCredentials != null) { copy.ApiCredentials = ApiCredentials.Copy(); } return(copy); }
/// <inheritdoc /> public void SetApiCredentials(ApiCredentials credentials) { _apiCredentials = credentials?.Copy(); _created = false; _authenticationProvider = null; }