summaryrefslogtreecommitdiffstats
path: root/examples/asm/asm.cs
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-06-01 11:33:11 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-06-01 11:33:11 -0700
commitcc9e4e317d998a703f8d25e27f57c37be2132b33 (patch)
tree56da84a74280bfe5494bf2a9ec6a0eebb05d1d65 /examples/asm/asm.cs
parent4cde4e7ee0329c179fa8745655a602521f1c2dd8 (diff)
downloadsendgrid-csharp-cc9e4e317d998a703f8d25e27f57c37be2132b33.zip
sendgrid-csharp-cc9e4e317d998a703f8d25e27f57c37be2132b33.tar.gz
sendgrid-csharp-cc9e4e317d998a703f8d25e27f57c37be2132b33.tar.bz2
Updated examples to include pause, removed uncessary dependency and updates usage instructions
Diffstat (limited to 'examples/asm/asm.cs')
-rw-r--r--examples/asm/asm.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/asm/asm.cs b/examples/asm/asm.cs
index b63ee7b..89f9b6e 100644
--- a/examples/asm/asm.cs
+++ b/examples/asm/asm.cs
@@ -1,7 +1,6 @@
using System;
using SendGrid.Helpers.Mail;
using System.Collections.Generic;
-using System.Net;
string _apiKey = Environment.GetEnvironmentVariable("SENDGRID_APIKEY", EnvironmentVariableTarget.User);
dynamic sg = new SendGrid.SendGridAPIClient(_apiKey);
@@ -19,6 +18,7 @@ dynamic response = sg.client.asm.groups.post(requestBody: data);
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Retrieve all suppression groups associated with the user. #
@@ -28,6 +28,7 @@ dynamic response = sg.client.asm.groups.get();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Update a suppression group. #
@@ -43,6 +44,7 @@ dynamic response = sg.client.asm.groups._(group_id).patch(requestBody: data);
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Get information on a single suppression group. #
@@ -53,6 +55,7 @@ dynamic response = sg.client.asm.groups._(group_id).get();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Delete a suppression group. #
@@ -63,6 +66,7 @@ dynamic response = sg.client.asm.groups._(group_id).delete();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Add suppressions to a suppression group #
@@ -79,6 +83,7 @@ dynamic response = sg.client.asm.groups._(group_id).suppressions.post(requestBod
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Retrieve all suppressions for a suppression group #
@@ -89,6 +94,7 @@ dynamic response = sg.client.asm.groups._(group_id).suppressions.get();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Delete a suppression from a suppression group #
@@ -100,6 +106,7 @@ dynamic response = sg.client.asm.groups._(group_id).suppressions._(email).delete
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Add recipient addresses to the global suppression group. #
@@ -115,6 +122,7 @@ dynamic response = sg.client.asm.suppressions.global.post(requestBody: data);
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Retrieve a Global Suppression #
@@ -125,6 +133,7 @@ dynamic response = sg.client.asm.suppressions.global._(email).get();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();
##################################################
# Delete a Global Suppression #
@@ -135,4 +144,5 @@ dynamic response = sg.client.asm.suppressions.global._(email).delete();
Console.WriteLine(response.StatusCode);
Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result);
Console.WriteLine(response.ResponseHeaders.ToString());
+Console.ReadLine();