generated from finbourne/__template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigurationOptions.cs
58 lines (52 loc) · 1.4 KB
/
ConfigurationOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Threading;
namespace Finbourne.Workflow.Sdk.Extensions;
/// <summary>
/// Overriding configuration
/// </summary>
public class ConfigurationOptions
{
private int? _rateLimitRetries;
private int? _timeoutMs;
/// <summary/>
public ConfigurationOptions()
{
}
/// <summary/>
/// <param name="timeoutMs"></param>
public ConfigurationOptions(int? timeoutMs, int? rateLimitRetries)
{
RateLimitRetries = rateLimitRetries;
TimeoutMs = timeoutMs;
}
/// <summary>
/// The client timeout in milliseconds. Set to a non null value to override
/// </summary>
public int? TimeoutMs
{
get => _timeoutMs;
set
{
if (value < 1)
{
throw new ArgumentException($"{nameof(TimeoutMs)} must be a positive integer between 1 and {int.MaxValue}");
}
_timeoutMs = value;
}
}
/// <summary>
/// The number of retries when being rate limited. Set to a non null value to override
/// </summary>
public int? RateLimitRetries
{
get => _rateLimitRetries;
set
{
if (value < 0)
{
throw new ArgumentException($"{nameof(RateLimitRetries)} must be a positive integer between 0 and {int.MaxValue}");
}
_rateLimitRetries = value;
}
}
}