/// <summary> /// Sets the IFlagCacheManager instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="flagCacheManager">FlagCacheManager.</param> /// <returns>the same <c>Configuration</c> instance</returns> internal static Configuration WithFlagCacheManager(this Configuration configuration, IFlagCacheManager flagCacheManager) { configuration.FlagCacheManager = flagCacheManager; return(configuration); }
/// <summary> /// Sets the IConnectionManager instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="connectionManager">Connection manager.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithConnectionManager(this Configuration configuration, IConnectionManager connectionManager) { configuration.ConnectionManager = connectionManager; return(configuration); }
/// <summary> /// Sets the time between flushes of the event buffer. Decreasing the flush interval means /// that the event buffer is less likely to reach capacity. The default value is 5 seconds. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="frequency">the flush interval</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithEventQueueFrequency(this Configuration configuration, TimeSpan frequency) { configuration.EventQueueFrequency = frequency; return(configuration); }
/// <summary> /// Sets whether to include full user details in every analytics event. The default is false (events will /// only include the user key, except for one "index" event that provides the full details for the user). /// </summary> /// <param name="configuration">the configuration</param> /// <param name="inlineUsers">true or false</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithInlineUsersInEvents(this Configuration configuration, bool inlineUsers) { configuration.InlineUsersInEvents = inlineUsers; return(configuration); }
/// <summary> /// Sets the IDeviceInfo instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="deviceInfo">Device info.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithDeviceInfo(this Configuration configuration, IDeviceInfo deviceInfo) { configuration.DeviceInfo = deviceInfo; return(configuration); }
/// <summary> /// Sets whether to enable background polling. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="enableBackgroundUpdating">If set to <c>true</c> enable background updating.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithEnableBackgroundUpdating(this Configuration configuration, bool enableBackgroundUpdating) { configuration.EnableBackgroundUpdating = enableBackgroundUpdating; return(configuration); }
/// <summary> /// Sets the object to be used for sending HTTP requests. This is exposed for testing purposes. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="httpClientHandler">the <c>HttpClientHandler</c> to use</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithHttpClientHandler(this Configuration configuration, HttpClientHandler httpClientHandler) { configuration.HttpClientHandler = httpClientHandler; return(configuration); }
/// <summary> /// Sets the Events URI. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="eventsUri">Events URI.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithEventsURI(this Configuration configuration, Uri eventsUri) { configuration.EventsUri = eventsUri; return(configuration); }
/// <summary> /// Sets the timeout when reading data from the EventSource API. The default value is 5 minutes. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="timeSpan">the read timeout</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithReadTimeout(this Configuration configuration, TimeSpan timeSpan) { configuration.ReadTimeout = timeSpan; return(configuration); }
/// <summary> /// Sets the reconnect base time for the streaming connection. The streaming connection /// uses an exponential backoff algorithm (with jitter) for reconnects, but will start the /// backoff with a value near the value specified here. The default value is 1 second. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="timeSpan">the reconnect time base value</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithReconnectTime(this Configuration configuration, TimeSpan timeSpan) { configuration.ReconnectTime = timeSpan; return(configuration); }
/// <summary> /// Sets the connection timeout. The default value is 10 seconds. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="timeSpan">the connection timeout</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithHttpClientTimeout(this Configuration configuration, TimeSpan timeSpan) { configuration.HttpClientTimeout = timeSpan; return(configuration); }
/// <summary> /// Sets whether or not this client is offline. If true, no calls to Launchdarkly will be made. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="offline">true if the client should remain offline</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithOffline(this Configuration configuration, bool offline) { configuration.Offline = offline; return(configuration); }
/// <summary> /// Sets how long the client constructor will block awaiting a successful connection to /// LaunchDarkly. Setting this to 0 will not block and will cause the constructor to return /// immediately. The default value is 5 seconds. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="startWaitTime">the length of time to wait</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithStartWaitTime(this Configuration configuration, TimeSpan startWaitTime) { configuration.StartWaitTime = startWaitTime; return(configuration); }
/// <summary> /// Determines whether to use the Report method for networking requests /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="useReport">If set to <c>true</c> use report.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithUseReport(this Configuration configuration, bool useReport) { configuration.UseReport = useReport; return(configuration); }
/// <summary> /// Sets whether or not the streaming API should be used to receive flag updates. This /// is true by default. Streaming should only be disabled on the advice of LaunchDarkly /// support. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="enableStream">true if the streaming API should be used</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithIsStreamingEnabled(this Configuration configuration, bool enableStream) { configuration.IsStreamingEnabled = enableStream; return(configuration); }
/// <summary> /// Sets the IMobileUpdateProcessor instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="mobileUpdateProcessor">Mobile update processor.</param> /// <returns>the same <c>Configuration</c> instance</returns> internal static Configuration WithUpdateProcessor(this Configuration configuration, IMobileUpdateProcessor mobileUpdateProcessor) { configuration.MobileUpdateProcessor = mobileUpdateProcessor; return(configuration); }
/// <summary> /// Sets whether or not user attributes (other than the key) should be private (not sent to /// the LaunchDarkly server). If this is true, all of the user attributes will be private, /// not just the attributes specified with the <c>AndPrivate...</c> methods on the /// <see cref="Client.User"/> object. By default, this is false. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="allAttributesPrivate">true if all attributes should be private</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithAllAttributesPrivate(this Configuration configuration, bool allAttributesPrivate) { configuration.AllAttributesPrivate = allAttributesPrivate; return(configuration); }
/// <summary> /// Sets the ISimplePersistance instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="persister">Persister.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithPersister(this Configuration configuration, ISimplePersistance persister) { configuration.Persister = persister; return(configuration); }
/// <summary>Configuration /// Sets the number of user keys that the event processor can remember at any one time, so that /// duplicate user details will not be sent in analytics events. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="capacity">the user key cache capacity</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithUserKeysCapacity(this Configuration configuration, int capacity) { configuration.UserKeysCapacity = capacity; return(configuration); }
/// <summary> /// Sets the IFeatureFlagListenerManager instance, used internally for stubbing mock instances. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="featureFlagListenerManager">Feature flag listener manager.</param> /// <returns>the same <c>Configuration</c> instance</returns> internal static Configuration WithFeatureFlagListenerManager(this Configuration configuration, IFeatureFlagListenerManager featureFlagListenerManager) { configuration.FeatureFlagListenerManager = featureFlagListenerManager; return(configuration); }
/// <summary> /// Sets the interval at which the event processor will reset its set of known user keys. The /// default value is five minutes. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="flushInterval">the flush interval</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithUserKeysFlushInterval(this Configuration configuration, TimeSpan flushInterval) { configuration.UserKeysFlushInterval = flushInterval; return(configuration); }
/// <summary> /// Sets the interval for background polling. /// </summary> /// <param name="configuration">Configuration.</param> /// <param name="backgroundPollingInternal">Background polling internal.</param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithBackgroundPollingInterval(this Configuration configuration, TimeSpan backgroundPollingInternal) { configuration.BackgroundPollingInterval = backgroundPollingInternal; return(configuration); }
/// <summary> /// Sets the capacity of the events buffer. The client buffers up to this many events in /// memory before flushing. If the capacity is exceeded before the buffer is flushed, /// events will be discarded. Increasing the capacity means that events are less likely /// to be discarded, at the cost of consuming more memory. /// </summary> /// <param name="configuration">the configuration</param> /// <param name="eventQueueCapacity"></param> /// <returns>the same <c>Configuration</c> instance</returns> public static Configuration WithEventQueueCapacity(this Configuration configuration, int eventQueueCapacity) { configuration.EventQueueCapacity = eventQueueCapacity; return(configuration); }