summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTyler Bischel <tyler.bischel@sendgrid.com>2012-01-24 14:57:47 -0800
committerTyler Bischel <tyler.bischel@sendgrid.com>2012-01-24 14:57:47 -0800
commit1be4549531d73cf89b4bebd2dac003937a1661df (patch)
tree0e2f7611e7df1fd92cdb3cd573ece56c6a846e06
parentcc9ec168b75ef7ac492996c7d24eeb1177b02476 (diff)
downloadsendgrid-csharp-1be4549531d73cf89b4bebd2dac003937a1661df.zip
sendgrid-csharp-1be4549531d73cf89b4bebd2dac003937a1661df.tar.gz
sendgrid-csharp-1be4549531d73cf89b4bebd2dac003937a1661df.tar.bz2
renamed REST transport to Web
-rwxr-xr-xSendGrid/Example/Example.csproj2
-rwxr-xr-xSendGrid/Example/Program.cs6
-rwxr-xr-xSendGrid/Example/WEBAPI.cs (renamed from SendGrid/Example/RESTAPI.cs)48
-rwxr-xr-xSendGrid/SendGridMail/ISendGrid.cs2
-rwxr-xr-xSendGrid/SendGridMail/Mail.csproj2
-rwxr-xr-xSendGrid/SendGridMail/SendGrid.cs4
-rwxr-xr-xSendGrid/SendGridMail/Transport/Web.cs (renamed from SendGrid/SendGridMail/Transport/REST.cs)18
-rwxr-xr-xSendGrid/Tests/Tests.csproj2
-rwxr-xr-xSendGrid/Tests/Transport/TestWeb.cs (renamed from SendGrid/Tests/Transport/TestREST.cs)6
9 files changed, 45 insertions, 45 deletions
diff --git a/SendGrid/Example/Example.csproj b/SendGrid/Example/Example.csproj
index cb778d1..1f85cc2 100755
--- a/SendGrid/Example/Example.csproj
+++ b/SendGrid/Example/Example.csproj
@@ -47,7 +47,7 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RESTAPI.cs" />
+ <Compile Include="WEBAPI.cs" />
<Compile Include="SMTPAPI.cs" />
</ItemGroup>
<ItemGroup>
diff --git a/SendGrid/Example/Program.cs b/SendGrid/Example/Program.cs
index c1815b7..a429510 100755
--- a/SendGrid/Example/Program.cs
+++ b/SendGrid/Example/Program.cs
@@ -19,14 +19,14 @@ namespace Example
var from = "cj.buchmann@sendgrid.com";
var to = new List<String>
{
- "cj.buchmann@sendgrid.com"
+ "foo@bar.com"
};
//initialize the SMTPAPI example class
var smtpapi = new SMTPAPI(username, password, from, to);
- var restapi = new RESTAPI(username, password, from, to);
+ var restapi = new WEBAPI(username, password, from, to);
- //use this section to test out our REST and SMTP examples!
+ //use this section to test out our Web and SMTP examples!
restapi.EnableTemplateEmail();
Console.WriteLine("Done!");
diff --git a/SendGrid/Example/RESTAPI.cs b/SendGrid/Example/WEBAPI.cs
index 8c15800..adfd756 100755
--- a/SendGrid/Example/RESTAPI.cs
+++ b/SendGrid/Example/WEBAPI.cs
@@ -8,14 +8,14 @@ using SendGridMail.Transport;
namespace Example
{
- class RESTAPI
+ class WEBAPI
{
private String _username;
private String _password;
private String _from;
private IEnumerable<String> _to;
- public RESTAPI(String username, String password, String from, IEnumerable<String> recipients)
+ public WEBAPI(String username, String password, String from, IEnumerable<String> recipients)
{
_username = username;
_password = password;
@@ -46,8 +46,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World HTML Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//send the mail
transportInstance.Deliver(message);
@@ -76,8 +76,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Plain Text Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//send the mail
transportInstance.Deliver(message);
@@ -108,8 +108,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Gravatar Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable gravatar
message.EnableGravatar();
@@ -142,8 +142,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Open Tracking Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable gravatar
message.EnableOpenTracking();
@@ -181,8 +181,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Click Tracking Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable clicktracking
message.EnableClickTracking(false);
@@ -218,8 +218,8 @@ namespace Example
//set the message subject
message.Subject = "WIN A MILLION DOLLARS TODAY! WORK FROM HOME! A NIGERIAN PRINCE WANTS YOU!";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable spamcheck
message.EnableSpamCheck();
@@ -255,8 +255,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Unsubscribe Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable spamcheck
//or optionally, you can specify 'replace' instead of the text and html in order to
@@ -295,8 +295,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Footer Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//Enable Footer
message.EnableFooter("PLAIN TEXT FOOTER", "<p color='blue'>HTML FOOTER TEXT</p>");
@@ -334,8 +334,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Footer Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable Google Analytics
message.EnableGoogleAnalytics("SendGridTest", "EMAIL", "Sendgrid", "ad-one", "My SG Campaign");
@@ -373,8 +373,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Template Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable template
message.EnableTemplate("<p>My Email Template <% body %> is awesome!</p>");
@@ -412,8 +412,8 @@ namespace Example
//set the message subject
message.Subject = "Hello World Bypass List Management Test";
- //create an instance of the REST transport mechanism
- var transportInstance = REST.GetInstance(new NetworkCredential(_username, _password));
+ //create an instance of the Web transport mechanism
+ var transportInstance = Web.GetInstance(new NetworkCredential(_username, _password));
//enable bypass list management
message.EnableBypassListManagement();
diff --git a/SendGrid/SendGridMail/ISendGrid.cs b/SendGrid/SendGridMail/ISendGrid.cs
index 08d109c..f868e2d 100755
--- a/SendGrid/SendGridMail/ISendGrid.cs
+++ b/SendGrid/SendGridMail/ISendGrid.cs
@@ -7,7 +7,7 @@ namespace SendGridMail
{
/// <summary>
/// Internal object to represent the way in which email may be sent.
- /// The library supports sending through either SMTP or REST interfaces.
+ /// The library supports sending through either SMTP or Web interfaces.
/// </summary>
public enum TransportType
{
diff --git a/SendGrid/SendGridMail/Mail.csproj b/SendGrid/SendGridMail/Mail.csproj
index bd1dc7a..f1bf7f6 100755
--- a/SendGrid/SendGridMail/Mail.csproj
+++ b/SendGrid/SendGridMail/Mail.csproj
@@ -54,7 +54,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SendGrid.cs" />
<Compile Include="Transport\ITransport.cs" />
- <Compile Include="Transport\REST.cs" />
+ <Compile Include="Transport\Web.cs" />
<Compile Include="Transport\SMTP.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
diff --git a/SendGrid/SendGridMail/SendGrid.cs b/SendGrid/SendGridMail/SendGrid.cs
index 59d7976..108c930 100755
--- a/SendGrid/SendGridMail/SendGrid.cs
+++ b/SendGrid/SendGridMail/SendGrid.cs
@@ -41,7 +41,7 @@ namespace SendGridMail
/// </summary>
/// <param name="from">The email address of the sender</param>
/// <param name="to">An array of the recipients</param>
- /// <param name="cc">Supported over SMTP, with future plans for support in the REST transport</param>
+ /// <param name="cc">Supported over SMTP, with future plans for support in the Web transport</param>
/// <param name="bcc">Blind recipients</param>
/// <param name="subject">The subject of the message</param>
/// <param name="html">the html content for the message</param>
@@ -531,7 +531,7 @@ namespace SendGridMail
transport = SMTP.GetInstance(credentials);
break;
case TransportType.REST:
- transport = REST.GetInstance(credentials);
+ transport = Web.GetInstance(credentials);
break;
default:
throw new ArgumentException("Transport method not specified");
diff --git a/SendGrid/SendGridMail/Transport/REST.cs b/SendGrid/SendGridMail/Transport/Web.cs
index 614e024..8e0c512 100755
--- a/SendGrid/SendGridMail/Transport/REST.cs
+++ b/SendGrid/SendGridMail/Transport/Web.cs
@@ -12,7 +12,7 @@ using CodeScales.Http.Methods;
namespace SendGridMail.Transport
{
- public class REST : ITransport
+ public class Web : ITransport
{
#region Properties
public const String Endpoint = "http://sendgrid.com/api/mail.send";
@@ -25,22 +25,22 @@ namespace SendGridMail.Transport
#endregion
/// <summary>
- /// Factory method for REST transport of sendgrid messages
+ /// Factory method for Web transport of sendgrid messages
/// </summary>
/// <param name="credentials">SendGrid credentials for sending mail messages</param>
- /// <param name="url">The uri of the REST endpoint</param>
+ /// <param name="url">The uri of the Web endpoint</param>
/// <returns>New instance of the transport mechanism</returns>
- public static REST GetInstance(NetworkCredential credentials, String url = Endpoint)
+ public static Web GetInstance(NetworkCredential credentials, String url = Endpoint)
{
- return new REST(credentials, url);
+ return new Web(credentials, url);
}
/// <summary>
- /// Creates a new REST interface for sending mail. Preference is using the Factory method.
+ /// Creates a new Web interface for sending mail. Preference is using the Factory method.
/// </summary>
/// <param name="credentials">SendGrid user parameters</param>
- /// <param name="url">The uri of the REST endpoint</param>
- internal REST(NetworkCredential credentials, String url = Endpoint)
+ /// <param name="url">The uri of the Web endpoint</param>
+ internal Web(NetworkCredential credentials, String url = Endpoint)
{
_credentials = credentials;
@@ -49,7 +49,7 @@ namespace SendGridMail.Transport
}
/// <summary>
- /// Delivers a message over SendGrid's REST interface
+ /// Delivers a message over SendGrid's Web interface
/// </summary>
/// <param name="message"></param>
public void Deliver(ISendGrid message)
diff --git a/SendGrid/Tests/Tests.csproj b/SendGrid/Tests/Tests.csproj
index cd43bd1..c75563a 100755
--- a/SendGrid/Tests/Tests.csproj
+++ b/SendGrid/Tests/Tests.csproj
@@ -59,7 +59,7 @@
<Compile Include="TestSendgridMessageSetup.cs" />
<Compile Include="TestTreeNode.cs" />
<Compile Include="TestUtils.cs" />
- <Compile Include="Transport\TestREST.cs" />
+ <Compile Include="Transport\TestWeb.cs" />
<Compile Include="Transport\TestSMTP.cs" />
</ItemGroup>
<ItemGroup>
diff --git a/SendGrid/Tests/Transport/TestREST.cs b/SendGrid/Tests/Transport/TestWeb.cs
index e9cc909..ac69dd2 100755
--- a/SendGrid/Tests/Transport/TestREST.cs
+++ b/SendGrid/Tests/Transport/TestWeb.cs
@@ -12,12 +12,12 @@ using SendGridMail.Transport;
namespace Tests.Transport
{
[TestFixture]
- class TestREST
+ class TestWeb
{
[Test]
public void TestFetchFileBodies()
{
- var test = REST.GetInstance(new NetworkCredential("foo", "bar"));
+ var test = Web.GetInstance(new NetworkCredential("foo", "bar"));
var message = new Mock<ISendGrid>();
message.SetupProperty(foo => foo.Attachments, null);
var result = test.FetchFileBodies(message.Object);
@@ -37,7 +37,7 @@ namespace Tests.Transport
[Test]
public void TestFetchFormParams()
{
- var bar = REST.GetInstance(new NetworkCredential("usr", "psswd"));
+ var bar = Web.GetInstance(new NetworkCredential("usr", "psswd"));
var message = SendGrid.GetInstance();
message.AddTo("foo@bar.com");
message.AddCc("cc@bar.com");