diff options
author | Elmer Thomas <elmer@thinkingserious.com> | 2016-06-01 11:33:11 -0700 |
---|---|---|
committer | Elmer Thomas <elmer@thinkingserious.com> | 2016-06-01 11:33:11 -0700 |
commit | cc9e4e317d998a703f8d25e27f57c37be2132b33 (patch) | |
tree | 56da84a74280bfe5494bf2a9ec6a0eebb05d1d65 /examples/accesssettings | |
parent | 4cde4e7ee0329c179fa8745655a602521f1c2dd8 (diff) | |
download | sendgrid-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/accesssettings')
-rw-r--r-- | examples/accesssettings/accesssettings.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/accesssettings/accesssettings.cs b/examples/accesssettings/accesssettings.cs index ea3b19c..2a1c3d5 100644 --- a/examples/accesssettings/accesssettings.cs +++ b/examples/accesssettings/accesssettings.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); @@ -17,6 +16,7 @@ dynamic response = sg.client.access_settings.activity.get(queryParams: queryPara Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add one or more IPs to the whitelist # @@ -39,6 +39,7 @@ dynamic response = sg.client.access_settings.whitelist.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a list of currently whitelisted IPs # @@ -48,6 +49,7 @@ dynamic response = sg.client.access_settings.whitelist.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Remove one or more IPs from the whitelist # @@ -64,6 +66,7 @@ dynamic response = sg.client.access_settings.whitelist.delete(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a specific whitelisted IP # @@ -74,6 +77,7 @@ dynamic response = sg.client.access_settings.whitelist._(rule_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Remove a specific IP from the whitelist # @@ -84,4 +88,5 @@ dynamic response = sg.client.access_settings.whitelist._(rule_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); |