-
Notifications
You must be signed in to change notification settings - Fork 575
Expand file tree
/
Copy pathBaseClientOptions.cs
More file actions
54 lines (46 loc) · 1.67 KB
/
BaseClientOptions.cs
File metadata and controls
54 lines (46 loc) · 1.67 KB
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
using SendGrid.Helpers.Reliability;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
namespace SendGrid
{
/// <summary>
/// Defines the options to use with the client.
/// </summary>
public class BaseClientOptions
{
private ReliabilitySettings reliabilitySettings = new ReliabilitySettings();
/// <summary>
/// The reliability settings to use on HTTP Requests.
/// </summary>
public ReliabilitySettings ReliabilitySettings
{
get => reliabilitySettings;
set => reliabilitySettings = value ?? throw new ArgumentNullException(nameof(reliabilitySettings));
}
/// <summary>
/// The request headers to use on HTTP Requests.
/// </summary>
public Dictionary<string, string> RequestHeaders { get; set; } = new Dictionary<string, string>();
/// <summary>
/// The base URL.
/// </summary>
public string Host { get; set; } = string.Empty;
/// <summary>
/// The API version (defaults to "v3").
/// </summary>
public string? Version { get; set; } = "v3";
/// <summary>
/// The path to the API endpoint.
/// </summary>
public string UrlPath { get; set; } = string.Empty;
/// <summary>
/// The Auth header value.
/// </summary>
public AuthenticationHeaderValue? Auth { get; set; }
/// <summary>
/// Gets or sets a value indicating whether HTTP error responses should be raised as exceptions. Default is false.
/// </summary>
public bool HttpErrorAsException { get; set; } = false;
}
}