Skip to content

Commit

Permalink
Version Bump v9.3.0: PR #456: Fixed #403 Implements an interface for …
Browse files Browse the repository at this point in the history
…mocking and DI
  • Loading branch information
thinkingserious committed May 16, 2017
1 parent 8f9c5ac commit 7d31c3b
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 68 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.

## [9.3.0] - 2017-5-16
## Update
- PR #456: Fixed #403 Implements an interface for mocking and DI
- Thanks to [Nate](https://github.com/nate-fr) for the PR!

## [9.2.1] - 2017-5-16
## Fix
- PR #457: Tos, Bccs and CCs fields could be null
Expand Down
8 changes: 4 additions & 4 deletions nuspec/Sendgrid.9.2.1.nuspec → nuspec/Sendgrid.9.3.0.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Sendgrid</id>
<version>9.2.1</version>
<version>9.3.0</version>
<title>SendGrid</title>
<authors>Elmer Thomas,SendGrid DX Team</authors>
<licenseUrl>https://github.com/sendgrid/sendgrid-csharp/blob/master/MIT.LICENSE</licenseUrl>
Expand All @@ -11,9 +11,9 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<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>
<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>
<releaseNotes>## Fix
- PR #457: Tos, Bccs and CCs fields could be null
- Thanks to [Jef Statham](https://github.com/JefStat) for the PR!</releaseNotes>
<releaseNotes>## Update
- PR #456: Fixed #403 Implements an interface for mocking and DI
- Thanks to [Nate](https://github.com/nate-fr) for the PR!</releaseNotes>
<copyright>SendGrid, Inc. 2017</copyright>
<tags>SendGrid Email Mail Microsoft Azure Transactional .NET Core</tags>
<dependencies>
Expand Down
120 changes: 59 additions & 61 deletions src/SendGrid/ISendGridClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,71 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// </copyright>

using System;

namespace SendGrid
{
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
using Helpers.Mail;
using Helpers.Mail;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// A HTTP client wrapper for interacting with SendGrid's API
/// </summary>
public interface ISendGridClient
{
/// <summary>
/// Gets or sets the path to the API resource.
/// </summary>
string UrlPath { get; set; }
/// <summary>
/// A HTTP client wrapper for interacting with SendGrid's API
/// </summary>
public interface ISendGridClient
{
/// <summary>
/// Gets or sets the path to the API resource.
/// </summary>
string UrlPath { get; set; }

/// <summary>
/// Gets or sets the API version.
/// </summary>
string Version { get; set; }
/// <summary>
/// Gets or sets the API version.
/// </summary>
string Version { get; set; }

/// <summary>
/// Gets or sets the request media type.
/// </summary>
string MediaType { get; set; }
/// <summary>
/// Gets or sets the request media type.
/// </summary>
string MediaType { get; set; }

/// <summary>
/// Add the authorization header, override to customize
/// </summary>
/// <param name="header">Authorization header</param>
/// <returns>Authorization value to add to the header</returns>
AuthenticationHeaderValue AddAuthorization( KeyValuePair<string, string> header );
/// <summary>
/// Add the authorization header, override to customize
/// </summary>
/// <param name="header">Authorization header</param>
/// <returns>Authorization value to add to the header</returns>
AuthenticationHeaderValue AddAuthorization(KeyValuePair<string, string> header);

/// <summary>
/// Make the call to the API server, override for testing or customization
/// </summary>
/// <param name="request">The parameters for the API call</param>
/// <param name="cancellationToken">Cancel the asynchronous call</param>
/// <returns>Response object</returns>
Task<Response> MakeRequest( HttpRequestMessage request, CancellationToken cancellationToken = default( CancellationToken ) );
/// <summary>
/// Make the call to the API server, override for testing or customization
/// </summary>
/// <param name="request">The parameters for the API call</param>
/// <param name="cancellationToken">Cancel the asynchronous call</param>
/// <returns>Response object</returns>
Task<Response> MakeRequest(HttpRequestMessage request, CancellationToken cancellationToken = default(CancellationToken));

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

/// <summary>
/// Make a request to send an email through SendGrid asychronously.
/// </summary>
/// <param name="msg">A SendGridMessage object with the details for the request.</param>
/// <param name="cancellationToken">Cancel the asychronous call.</param>
/// <returns>A Response object.</returns>
Task<Response> SendEmailAsync( SendGridMessage msg, CancellationToken cancellationToken = default( CancellationToken ) );
}
}
/// <summary>
/// Make a request to send an email through SendGrid asychronously.
/// </summary>
/// <param name="msg">A SendGridMessage object with the details for the request.</param>
/// <param name="cancellationToken">Cancel the asychronous call.</param>
/// <returns>A Response object.</returns>
Task<Response> SendEmailAsync(SendGridMessage msg, CancellationToken cancellationToken = default(CancellationToken));
}
}
2 changes: 1 addition & 1 deletion src/SendGrid/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("377c20e4-2297-488f-933b-fb635c56d8fc")]

[assembly: AssemblyInformationalVersion("9.2.1")]
[assembly: AssemblyInformationalVersion("9.3.0")]
2 changes: 1 addition & 1 deletion src/SendGrid/SendGridClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace SendGrid
/// A HTTP client wrapper for interacting with SendGrid's API
/// </summary>
public class SendGridClient : ISendGridClient
{
{
/// <summary>
/// Gets or sets the path to the API resource.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SendGrid/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@
}
}
},
"version": "9.2.1"
"version": "9.3.0"
}

0 comments on commit 7d31c3b

Please sign in to comment.