Skip to content

Commit 7d31c3b

Browse files
Version Bump v9.3.0: PR #456: Fixed #403 Implements an interface for mocking and DI
1 parent 8f9c5ac commit 7d31c3b

File tree

6 files changed

+71
-68
lines changed

6 files changed

+71
-68
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [9.3.0] - 2017-5-16
5+
## Update
6+
- PR #456: Fixed #403 Implements an interface for mocking and DI
7+
- Thanks to [Nate](https://github.com/nate-fr) for the PR!
8+
49
## [9.2.1] - 2017-5-16
510
## Fix
611
- PR #457: Tos, Bccs and CCs fields could be null

nuspec/Sendgrid.9.2.1.nuspec renamed to nuspec/Sendgrid.9.3.0.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
33
<metadata>
44
<id>Sendgrid</id>
5-
<version>9.2.1</version>
5+
<version>9.3.0</version>
66
<title>SendGrid</title>
77
<authors>Elmer Thomas,SendGrid DX Team</authors>
88
<licenseUrl>https://github.com/sendgrid/sendgrid-csharp/blob/master/MIT.LICENSE</licenseUrl>
@@ -11,9 +11,9 @@
1111
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1212
<description>C# client library and examples for using SendGrid API's to send mail and access Web API v3 endpoints with .NET Standard 1.3 and .NET Core support. Github repo located at : https://github.com/sendgrid/sendgrid-csharp</description>
1313
<summary>C# client library and examples for using SendGrid API's to send mail and access Web API v3 endpoints with .NET Standard 1.3 and .NET Core support.</summary>
14-
<releaseNotes>## Fix
15-
- PR #457: Tos, Bccs and CCs fields could be null
16-
- Thanks to [Jef Statham](https://github.com/JefStat) for the PR!</releaseNotes>
14+
<releaseNotes>## Update
15+
- PR #456: Fixed #403 Implements an interface for mocking and DI
16+
- Thanks to [Nate](https://github.com/nate-fr) for the PR!</releaseNotes>
1717
<copyright>SendGrid, Inc. 2017</copyright>
1818
<tags>SendGrid Email Mail Microsoft Azure Transactional .NET Core</tags>
1919
<dependencies>

src/SendGrid/ISendGridClient.cs

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,71 @@
33
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
// </copyright>
55

6-
using System;
7-
86
namespace SendGrid
97
{
10-
using System.Collections.Generic;
11-
using System.Net.Http;
12-
using System.Net.Http.Headers;
13-
using System.Threading;
14-
using System.Threading.Tasks;
15-
using Helpers.Mail;
8+
using Helpers.Mail;
9+
using System.Collections.Generic;
10+
using System.Net.Http;
11+
using System.Net.Http.Headers;
12+
using System.Threading;
13+
using System.Threading.Tasks;
1614

17-
/// <summary>
18-
/// A HTTP client wrapper for interacting with SendGrid's API
19-
/// </summary>
20-
public interface ISendGridClient
21-
{
22-
/// <summary>
23-
/// Gets or sets the path to the API resource.
24-
/// </summary>
25-
string UrlPath { get; set; }
15+
/// <summary>
16+
/// A HTTP client wrapper for interacting with SendGrid's API
17+
/// </summary>
18+
public interface ISendGridClient
19+
{
20+
/// <summary>
21+
/// Gets or sets the path to the API resource.
22+
/// </summary>
23+
string UrlPath { get; set; }
2624

27-
/// <summary>
28-
/// Gets or sets the API version.
29-
/// </summary>
30-
string Version { get; set; }
25+
/// <summary>
26+
/// Gets or sets the API version.
27+
/// </summary>
28+
string Version { get; set; }
3129

32-
/// <summary>
33-
/// Gets or sets the request media type.
34-
/// </summary>
35-
string MediaType { get; set; }
30+
/// <summary>
31+
/// Gets or sets the request media type.
32+
/// </summary>
33+
string MediaType { get; set; }
3634

37-
/// <summary>
38-
/// Add the authorization header, override to customize
39-
/// </summary>
40-
/// <param name="header">Authorization header</param>
41-
/// <returns>Authorization value to add to the header</returns>
42-
AuthenticationHeaderValue AddAuthorization( KeyValuePair<string, string> header );
35+
/// <summary>
36+
/// Add the authorization header, override to customize
37+
/// </summary>
38+
/// <param name="header">Authorization header</param>
39+
/// <returns>Authorization value to add to the header</returns>
40+
AuthenticationHeaderValue AddAuthorization(KeyValuePair<string, string> header);
4341

44-
/// <summary>
45-
/// Make the call to the API server, override for testing or customization
46-
/// </summary>
47-
/// <param name="request">The parameters for the API call</param>
48-
/// <param name="cancellationToken">Cancel the asynchronous call</param>
49-
/// <returns>Response object</returns>
50-
Task<Response> MakeRequest( HttpRequestMessage request, CancellationToken cancellationToken = default( CancellationToken ) );
42+
/// <summary>
43+
/// Make the call to the API server, override for testing or customization
44+
/// </summary>
45+
/// <param name="request">The parameters for the API call</param>
46+
/// <param name="cancellationToken">Cancel the asynchronous call</param>
47+
/// <returns>Response object</returns>
48+
Task<Response> MakeRequest(HttpRequestMessage request, CancellationToken cancellationToken = default(CancellationToken));
5149

52-
/// <summary>
53-
/// Prepare for async call to the API server
54-
/// </summary>
55-
/// <param name="method">HTTP verb</param>
56-
/// <param name="requestBody">JSON formatted string</param>
57-
/// <param name="queryParams">JSON formatted query paramaters</param>
58-
/// <param name="urlPath">The path to the API endpoint.</param>
59-
/// <param name="cancellationToken">Cancel the asynchronous call.</param>
60-
/// <returns>Response object</returns>
61-
/// <exception cref="Exception">The method will NOT catch and swallow exceptions generated by sending a request
62-
/// through the internal http client. Any underlying exception will pass right through.
63-
/// In particular, this means that you may expect
64-
/// a TimeoutException if you are not connected to the internet.</exception>
65-
Task<Response> RequestAsync( SendGridClient.Method method, string requestBody = null, string queryParams = null, string urlPath = null, CancellationToken cancellationToken = default( CancellationToken ) );
50+
/// <summary>
51+
/// Prepare for async call to the API server
52+
/// </summary>
53+
/// <param name="method">HTTP verb</param>
54+
/// <param name="requestBody">JSON formatted string</param>
55+
/// <param name="queryParams">JSON formatted query paramaters</param>
56+
/// <param name="urlPath">The path to the API endpoint.</param>
57+
/// <param name="cancellationToken">Cancel the asynchronous call.</param>
58+
/// <returns>Response object</returns>
59+
/// <exception>The method will NOT catch and swallow exceptions generated by sending a request
60+
/// through the internal http client. Any underlying exception will pass right through.
61+
/// In particular, this means that you may expect
62+
/// a TimeoutException if you are not connected to the internet.</exception>
63+
Task<Response> RequestAsync(SendGridClient.Method method, string requestBody = null, string queryParams = null, string urlPath = null, CancellationToken cancellationToken = default(CancellationToken));
6664

67-
/// <summary>
68-
/// Make a request to send an email through SendGrid asychronously.
69-
/// </summary>
70-
/// <param name="msg">A SendGridMessage object with the details for the request.</param>
71-
/// <param name="cancellationToken">Cancel the asychronous call.</param>
72-
/// <returns>A Response object.</returns>
73-
Task<Response> SendEmailAsync( SendGridMessage msg, CancellationToken cancellationToken = default( CancellationToken ) );
74-
}
75-
}
65+
/// <summary>
66+
/// Make a request to send an email through SendGrid asychronously.
67+
/// </summary>
68+
/// <param name="msg">A SendGridMessage object with the details for the request.</param>
69+
/// <param name="cancellationToken">Cancel the asychronous call.</param>
70+
/// <returns>A Response object.</returns>
71+
Task<Response> SendEmailAsync(SendGridMessage msg, CancellationToken cancellationToken = default(CancellationToken));
72+
}
73+
}

src/SendGrid/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
2323
[assembly: Guid("377c20e4-2297-488f-933b-fb635c56d8fc")]
2424

25-
[assembly: AssemblyInformationalVersion("9.2.1")]
25+
[assembly: AssemblyInformationalVersion("9.3.0")]

src/SendGrid/SendGridClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace SendGrid
2121
/// A HTTP client wrapper for interacting with SendGrid's API
2222
/// </summary>
2323
public class SendGridClient : ISendGridClient
24-
{
24+
{
2525
/// <summary>
2626
/// Gets or sets the path to the API resource.
2727
/// </summary>

src/SendGrid/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@
4848
}
4949
}
5050
},
51-
"version": "9.2.1"
51+
"version": "9.3.0"
5252
}

0 commit comments

Comments
 (0)