Skip to content

Commit 7d1868e

Browse files
committed
fix: Create constructor overload for compatibility
1 parent 196c841 commit 7d1868e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/SendGrid/SendGridClient.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class SendGridClient : BaseClient
2020
/// <param name="requestHeaders">A dictionary of request headers.</param>
2121
/// <param name="version">API version, override AddVersion to customize.</param>
2222
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
23+
/// <param name="httpErrorAsException">Indicates whether HTTP error responses should be raised as exceptions. Default is false.</param>
2324
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
2425
public SendGridClient(IWebProxy webProxy, string apiKey, string host = null, Dictionary<string, string> requestHeaders = null, string version = null, string urlPath = null, bool httpErrorAsException = false)
2526
: base(webProxy, buildOptions(apiKey, host, requestHeaders, version, urlPath, httpErrorAsException))
@@ -35,6 +36,7 @@ public SendGridClient(IWebProxy webProxy, string apiKey, string host = null, Dic
3536
/// <param name="requestHeaders">A dictionary of request headers.</param>
3637
/// <param name="version">API version, override AddVersion to customize.</param>
3738
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
39+
/// <param name="httpErrorAsException">Indicates whether HTTP error responses should be raised as exceptions. Default is false.</param>
3840
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
3941
public SendGridClient(HttpClient httpClient, string apiKey, string host = null, Dictionary<string, string> requestHeaders = null, string version = null, string urlPath = null, bool httpErrorAsException = false)
4042
: base(httpClient, buildOptions(apiKey, host, requestHeaders, version, urlPath, httpErrorAsException))
@@ -50,6 +52,21 @@ public SendGridClient(HttpClient httpClient, string apiKey, string host = null,
5052
/// <param name="version">API version, override AddVersion to customize.</param>
5153
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
5254
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
55+
public SendGridClient(string apiKey, string host = null, Dictionary<string, string> requestHeaders = null, string version = null, string urlPath = null)
56+
: base(buildOptions(apiKey, host, requestHeaders, version, urlPath, false))
57+
{
58+
}
59+
60+
/// <summary>
61+
/// Initializes a new instance of the <see cref="SendGridClient"/> class.
62+
/// </summary>
63+
/// <param name="apiKey">Your Twilio SendGrid API key.</param>
64+
/// <param name="host">Base url (e.g. https://api.sendgrid.com).</param>
65+
/// <param name="requestHeaders">A dictionary of request headers.</param>
66+
/// <param name="version">API version, override AddVersion to customize.</param>
67+
/// <param name="urlPath">Path to endpoint (e.g. /path/to/endpoint).</param>
68+
/// <param name="httpErrorAsException">Indicates whether HTTP error responses should be raised as exceptions. Default is false.</param>
69+
/// <returns>Interface to the Twilio SendGrid REST API.</returns>
5370
public SendGridClient(string apiKey, string host = null, Dictionary<string, string> requestHeaders = null, string version = null, string urlPath = null, bool httpErrorAsException = false)
5471
: base(buildOptions(apiKey, host, requestHeaders, version, urlPath, httpErrorAsException))
5572
{

0 commit comments

Comments
 (0)