RetrySettings.cs 973 B

1234567891011121314151617181920212223242526
  1. namespace Best.HTTP.Request.Settings
  2. {
  3. /// <summary>
  4. /// Represents settings related to request retry behavior.
  5. /// </summary>
  6. public class RetrySettings
  7. {
  8. /// <summary>
  9. /// Gets the number of times that the plugin has retried the request.
  10. /// </summary>
  11. public int Retries { get; set; }
  12. /// <summary>
  13. /// Gets or sets the maximum number of retry attempts allowed. To disable retries, set this value to <c>0</c>.
  14. /// The default value is <c>1</c> for GET requests, otherwise <c>0</c>.
  15. /// </summary>
  16. public int MaxRetries { get; set; }
  17. /// <summary>
  18. /// Initializes a new instance of the RetrySettings class with the specified maximum retry attempts.
  19. /// </summary>
  20. /// <param name="maxRetries">The maximum number of retry attempts allowed.</param>
  21. public RetrySettings(int maxRetries)
  22. => this.MaxRetries = maxRetries;
  23. }
  24. }