//------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. // // Changes to this file may cause incorrect behavior and will be lost when // the code is regenerated. // //------------------------------------------------------------------------------ #nullable enable namespace LukeHagar.PlexAPI.SDK.Utils.Retries { public class RetryConfig { public enum RetryStrategy { BACKOFF, NONE } public readonly RetryStrategy Strategy; public readonly BackoffStrategy? Backoff; public readonly bool RetryConnectionErrors; /// /// Selects the retry strategy. /// /// The retry strategy. /// The backoff strategy configuration (if applicable) /// Whether to retry on connection errors. /// /// The backoff strategy is only required if the retry strategy is set to BACKOFF. /// To disable retries, set the strategy to NONE. /// public RetryConfig(RetryStrategy strategy, BackoffStrategy? backoff = null, bool retryConnectionErrors = false) { if (strategy == RetryStrategy.BACKOFF && backoff == null) { throw new System.ArgumentNullException("Backoff strategy configuration was not provided"); } Strategy = strategy; Backoff = backoff; RetryConnectionErrors = retryConnectionErrors; } } }