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 | |
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')
-rw-r--r-- | examples/accesssettings/accesssettings.cs | 7 | ||||
-rw-r--r-- | examples/apikeys/apikeys.cs | 7 | ||||
-rw-r--r-- | examples/asm/asm.cs | 12 | ||||
-rw-r--r-- | examples/browsers/browsers.cs | 2 | ||||
-rw-r--r-- | examples/campaigns/campaigns.cs | 12 | ||||
-rw-r--r-- | examples/categories/categories.cs | 4 | ||||
-rw-r--r-- | examples/clients/clients.cs | 3 | ||||
-rw-r--r-- | examples/contactdb/contactdb.cs | 32 | ||||
-rw-r--r-- | examples/devices/devices.cs | 2 | ||||
-rw-r--r-- | examples/geo/geo.cs | 2 | ||||
-rw-r--r-- | examples/ips/ips.cs | 15 | ||||
-rw-r--r-- | examples/mail/mail.cs | 4 | ||||
-rw-r--r-- | examples/mailboxproviders/mailboxproviders.cs | 2 | ||||
-rw-r--r-- | examples/mailsettings/mailsettings.cs | 20 | ||||
-rw-r--r-- | examples/partnersettings/partnersettings.cs | 4 | ||||
-rw-r--r-- | examples/scopes/scopes.cs | 2 | ||||
-rw-r--r-- | examples/stats/stats.cs | 2 | ||||
-rw-r--r-- | examples/subusers/subusers.cs | 15 | ||||
-rw-r--r-- | examples/suppression/suppression.cs | 18 | ||||
-rw-r--r-- | examples/templates/templates.cs | 11 | ||||
-rw-r--r-- | examples/trackingsettings/trackingsettings.cs | 10 | ||||
-rw-r--r-- | examples/user/user.cs | 22 | ||||
-rw-r--r-- | examples/whitelabel/whitelabel.cs | 28 |
23 files changed, 213 insertions, 23 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(); diff --git a/examples/apikeys/apikeys.cs b/examples/apikeys/apikeys.cs index 763dc0f..7ba9b28 100644 --- a/examples/apikeys/apikeys.cs +++ b/examples/apikeys/apikeys.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); @@ -22,6 +21,7 @@ dynamic response = sg.client.api_keys.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all API Keys belonging to the authenticated user # @@ -31,6 +31,7 @@ dynamic response = sg.client.api_keys.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update the name & scopes of an API Key # @@ -48,6 +49,7 @@ dynamic response = sg.client.api_keys._(api_key_id).put(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update API keys # @@ -61,6 +63,7 @@ dynamic response = sg.client.api_keys._(api_key_id).patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve an existing API Key # @@ -71,6 +74,7 @@ dynamic response = sg.client.api_keys._(api_key_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete API keys # @@ -81,4 +85,5 @@ dynamic response = sg.client.api_keys._(api_key_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); 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(); diff --git a/examples/browsers/browsers.cs b/examples/browsers/browsers.cs index a0cc53b..26aedf9 100644 --- a/examples/browsers/browsers.cs +++ b/examples/browsers/browsers.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); @@ -22,4 +21,5 @@ dynamic response = sg.client.browsers.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/campaigns/campaigns.cs b/examples/campaigns/campaigns.cs index 0d40cb1..9afc7aa 100644 --- a/examples/campaigns/campaigns.cs +++ b/examples/campaigns/campaigns.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); @@ -34,6 +33,7 @@ dynamic response = sg.client.campaigns.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all Campaigns # @@ -47,6 +47,7 @@ dynamic response = sg.client.campaigns.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a Campaign # @@ -66,6 +67,7 @@ dynamic response = sg.client.campaigns._(campaign_id).patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a single campaign # @@ -76,6 +78,7 @@ dynamic response = sg.client.campaigns._(campaign_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a Campaign # @@ -86,6 +89,7 @@ dynamic response = sg.client.campaigns._(campaign_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a Scheduled Campaign # @@ -99,6 +103,7 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.patch(requestBod Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Schedule a Campaign # @@ -112,6 +117,7 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.post(requestBody Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # View Scheduled Time of a Campaign # @@ -122,6 +128,7 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Unschedule a Scheduled Campaign # @@ -132,6 +139,7 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Send a Campaign # @@ -142,6 +150,7 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.now.post(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Send a Test Campaign # @@ -155,4 +164,5 @@ dynamic response = sg.client.campaigns._(campaign_id).schedules.test.post(reques Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/categories/categories.cs b/examples/categories/categories.cs index 2cea83c..8296cf8 100644 --- a/examples/categories/categories.cs +++ b/examples/categories/categories.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.categories.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Email Statistics for Categories # @@ -36,6 +36,7 @@ dynamic response = sg.client.categories.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] # @@ -54,4 +55,5 @@ dynamic response = sg.client.categories.stats.sums.get(queryParams: queryParams) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/clients/clients.cs b/examples/clients/clients.cs index 5ff7d56..01a9752 100644 --- a/examples/clients/clients.cs +++ b/examples/clients/clients.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.clients.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve stats by a specific client type. # @@ -34,4 +34,5 @@ dynamic response = sg.client.clients._(client_type).stats.get(queryParams: query Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/contactdb/contactdb.cs b/examples/contactdb/contactdb.cs index 3bb384d..0a824fb 100644 --- a/examples/contactdb/contactdb.cs +++ b/examples/contactdb/contactdb.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); @@ -18,6 +17,7 @@ dynamic response = sg.client.contactdb.custom_fields.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all custom fields # @@ -27,6 +27,7 @@ dynamic response = sg.client.contactdb.custom_fields.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a Custom Field # @@ -37,6 +38,7 @@ dynamic response = sg.client.contactdb.custom_fields._(custom_field_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a Custom Field # @@ -47,6 +49,7 @@ dynamic response = sg.client.contactdb.custom_fields._(custom_field_id).delete() Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create a List # @@ -59,6 +62,7 @@ dynamic response = sg.client.contactdb.lists.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all lists # @@ -68,6 +72,7 @@ dynamic response = sg.client.contactdb.lists.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete Multiple lists # @@ -83,6 +88,7 @@ dynamic response = sg.client.contactdb.lists.delete(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a List # @@ -99,6 +105,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).patch(requestBody: data, Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a single list # @@ -112,6 +119,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).get(queryParams: queryPa Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a List # @@ -125,6 +133,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).delete(queryParams: quer Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add Multiple Recipients to a List # @@ -139,6 +148,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).recipients.post(requestB Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all recipients on a List # @@ -154,6 +164,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).recipients.get(queryPara Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add a Single Recipient to a List # @@ -165,6 +176,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).recipients._(recipient_i Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a Single Recipient from a Single List # @@ -180,6 +192,7 @@ dynamic response = sg.client.contactdb.lists._(list_id).recipients._(recipient_i Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Recipient # @@ -196,6 +209,7 @@ dynamic response = sg.client.contactdb.recipients.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add recipients # @@ -219,6 +233,7 @@ dynamic response = sg.client.contactdb.recipients.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve recipients # @@ -232,6 +247,7 @@ dynamic response = sg.client.contactdb.recipients.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete Recipient # @@ -245,6 +261,7 @@ dynamic response = sg.client.contactdb.recipients.delete(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve the count of billable recipients # @@ -254,6 +271,7 @@ dynamic response = sg.client.contactdb.recipients.billable_count.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a Count of Recipients # @@ -263,6 +281,7 @@ dynamic response = sg.client.contactdb.recipients.count.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve recipients matching search criteria # @@ -275,6 +294,7 @@ dynamic response = sg.client.contactdb.recipients.search.get(queryParams: queryP Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a single recipient # @@ -285,6 +305,7 @@ dynamic response = sg.client.contactdb.recipients._(recipient_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a Recipient # @@ -295,6 +316,7 @@ dynamic response = sg.client.contactdb.recipients._(recipient_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve the lists that a recipient is on # @@ -305,6 +327,7 @@ dynamic response = sg.client.contactdb.recipients._(recipient_id).lists.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve reserved fields # @@ -314,6 +337,7 @@ dynamic response = sg.client.contactdb.reserved_fields.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create a Segment # @@ -347,6 +371,7 @@ dynamic response = sg.client.contactdb.segments.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all segments # @@ -356,6 +381,7 @@ dynamic response = sg.client.contactdb.segments.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a segment # @@ -381,6 +407,7 @@ dynamic response = sg.client.contactdb.segments._(segment_id).patch(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a segment # @@ -394,6 +421,7 @@ dynamic response = sg.client.contactdb.segments._(segment_id).get(queryParams: q Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a segment # @@ -407,6 +435,7 @@ dynamic response = sg.client.contactdb.segments._(segment_id).delete(queryParams Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve recipients on a segment # @@ -421,4 +450,5 @@ dynamic response = sg.client.contactdb.segments._(segment_id).recipients.get(que Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/devices/devices.cs b/examples/devices/devices.cs index e480f3d..b7164db 100644 --- a/examples/devices/devices.cs +++ b/examples/devices/devices.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); @@ -21,4 +20,5 @@ dynamic response = sg.client.devices.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/geo/geo.cs b/examples/geo/geo.cs index 7003650..49983ee 100644 --- a/examples/geo/geo.cs +++ b/examples/geo/geo.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); @@ -22,4 +21,5 @@ dynamic response = sg.client.geo.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/ips/ips.cs b/examples/ips/ips.cs index 9b9bfe0..319d35e 100644 --- a/examples/ips/ips.cs +++ b/examples/ips/ips.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); @@ -21,6 +20,7 @@ dynamic response = sg.client.ips.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all assigned IPs # @@ -30,6 +30,7 @@ dynamic response = sg.client.ips.assigned.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create an IP pool. # @@ -42,6 +43,7 @@ dynamic response = sg.client.ips.pools.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all IP pools. # @@ -51,6 +53,7 @@ dynamic response = sg.client.ips.pools.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update an IP pools name. # @@ -64,6 +67,7 @@ dynamic response = sg.client.ips.pools._(pool_name).put(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all IPs in a specified pool. # @@ -74,6 +78,7 @@ dynamic response = sg.client.ips.pools._(pool_name).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete an IP pool. # @@ -84,6 +89,7 @@ dynamic response = sg.client.ips.pools._(pool_name).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add an IP address to a pool # @@ -97,6 +103,7 @@ dynamic response = sg.client.ips.pools._(pool_name).ips.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Remove an IP address from a pool. # @@ -108,6 +115,7 @@ dynamic response = sg.client.ips.pools._(pool_name).ips._(ip).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add an IP to warmup # @@ -120,6 +128,7 @@ dynamic response = sg.client.ips.warmup.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all IPs currently in warmup # @@ -129,6 +138,7 @@ dynamic response = sg.client.ips.warmup.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve warmup status for a specific IP address # @@ -139,6 +149,7 @@ dynamic response = sg.client.ips.warmup._(ip_address).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Remove an IP from warmup # @@ -149,6 +160,7 @@ dynamic response = sg.client.ips.warmup._(ip_address).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all IP pools an IP address belongs to # @@ -159,4 +171,5 @@ dynamic response = sg.client.ips._(ip_address).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/mail/mail.cs b/examples/mail/mail.cs index 7e329d0..827abc8 100644 --- a/examples/mail/mail.cs +++ b/examples/mail/mail.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); @@ -14,6 +13,7 @@ dynamic response = sg.client.mail.batch.post(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Validate batch ID # @@ -24,6 +24,7 @@ dynamic response = sg.client.mail.batch._(batch_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # v3 Mail Send Beta # @@ -176,4 +177,5 @@ dynamic response = sg.client.mail.send.beta.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/mailboxproviders/mailboxproviders.cs b/examples/mailboxproviders/mailboxproviders.cs index c58c79a..3cbc08c 100644 --- a/examples/mailboxproviders/mailboxproviders.cs +++ b/examples/mailboxproviders/mailboxproviders.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); @@ -22,4 +21,5 @@ dynamic response = sg.client.mailbox_providers.stats.get(queryParams: queryParam Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/mailsettings/mailsettings.cs b/examples/mailsettings/mailsettings.cs index 5005d69..0700333 100644 --- a/examples/mailsettings/mailsettings.cs +++ b/examples/mailsettings/mailsettings.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); @@ -18,6 +17,7 @@ dynamic response = sg.client.mail_settings.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update address whitelist mail settings # @@ -34,6 +34,7 @@ dynamic response = sg.client.mail_settings.address_whitelist.patch(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve address whitelist mail settings # @@ -43,6 +44,7 @@ dynamic response = sg.client.mail_settings.address_whitelist.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update BCC mail settings # @@ -56,6 +58,7 @@ dynamic response = sg.client.mail_settings.bcc.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all BCC mail settings # @@ -65,6 +68,7 @@ dynamic response = sg.client.mail_settings.bcc.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update bounce purge mail settings # @@ -79,6 +83,7 @@ dynamic response = sg.client.mail_settings.bounce_purge.patch(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve bounce purge mail settings # @@ -88,6 +93,7 @@ dynamic response = sg.client.mail_settings.bounce_purge.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update footer mail settings # @@ -102,6 +108,7 @@ dynamic response = sg.client.mail_settings.footer.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve footer mail settings # @@ -111,6 +118,7 @@ dynamic response = sg.client.mail_settings.footer.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update forward bounce mail settings # @@ -124,6 +132,7 @@ dynamic response = sg.client.mail_settings.forward_bounce.patch(requestBody: dat Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve forward bounce mail settings # @@ -133,6 +142,7 @@ dynamic response = sg.client.mail_settings.forward_bounce.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update forward spam mail settings # @@ -146,6 +156,7 @@ dynamic response = sg.client.mail_settings.forward_spam.patch(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve forward spam mail settings # @@ -155,6 +166,7 @@ dynamic response = sg.client.mail_settings.forward_spam.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update plain content mail settings # @@ -167,6 +179,7 @@ dynamic response = sg.client.mail_settings.plain_content.patch(requestBody: data Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve plain content mail settings # @@ -176,6 +189,7 @@ dynamic response = sg.client.mail_settings.plain_content.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update spam check mail settings # @@ -190,6 +204,7 @@ dynamic response = sg.client.mail_settings.spam_check.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve spam check mail settings # @@ -199,6 +214,7 @@ dynamic response = sg.client.mail_settings.spam_check.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update template mail settings # @@ -212,6 +228,7 @@ dynamic response = sg.client.mail_settings.template.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve legacy template mail settings # @@ -221,4 +238,5 @@ dynamic response = sg.client.mail_settings.template.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/partnersettings/partnersettings.cs b/examples/partnersettings/partnersettings.cs index d3ca871..1fb6884 100644 --- a/examples/partnersettings/partnersettings.cs +++ b/examples/partnersettings/partnersettings.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); @@ -18,6 +17,7 @@ dynamic response = sg.client.partner_settings.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Updates New Relic partner settings. # @@ -32,6 +32,7 @@ dynamic response = sg.client.partner_settings.new_relic.patch(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Returns all New Relic partner settings. # @@ -41,4 +42,5 @@ dynamic response = sg.client.partner_settings.new_relic.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/scopes/scopes.cs b/examples/scopes/scopes.cs index 5dcf278..e4bab6d 100644 --- a/examples/scopes/scopes.cs +++ b/examples/scopes/scopes.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); @@ -14,4 +13,5 @@ dynamic response = sg.client.scopes.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/stats/stats.cs b/examples/stats/stats.cs index 7506b9b..0a817b6 100644 --- a/examples/stats/stats.cs +++ b/examples/stats/stats.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); @@ -21,4 +20,5 @@ dynamic response = sg.client.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/subusers/subusers.cs b/examples/subusers/subusers.cs index f680426..1d4b8ad 100644 --- a/examples/subusers/subusers.cs +++ b/examples/subusers/subusers.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); @@ -23,6 +22,7 @@ dynamic response = sg.client.subusers.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # List all Subusers # @@ -37,6 +37,7 @@ dynamic response = sg.client.subusers.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Subuser Reputations # @@ -49,6 +50,7 @@ dynamic response = sg.client.subusers.reputations.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve email statistics for your subusers. # @@ -66,6 +68,7 @@ dynamic response = sg.client.subusers.stats.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve monthly stats for all subusers # @@ -83,6 +86,7 @@ dynamic response = sg.client.subusers.stats.monthly.get(queryParams: queryParams Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve the totals for each email statistic metric for all subusers. # @@ -101,6 +105,7 @@ dynamic response = sg.client.subusers.stats.sums.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Enable/disable a subuser # @@ -114,6 +119,7 @@ dynamic response = sg.client.subusers._(subuser_name).patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a subuser # @@ -124,6 +130,7 @@ dynamic response = sg.client.subusers._(subuser_name).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update IPs assigned to a subuser # @@ -137,6 +144,7 @@ dynamic response = sg.client.subusers._(subuser_name).ips.put(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Monitor Settings for a subuser # @@ -151,6 +159,7 @@ dynamic response = sg.client.subusers._(subuser_name).monitor.put(requestBody: d Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create monitor settings # @@ -165,6 +174,7 @@ dynamic response = sg.client.subusers._(subuser_name).monitor.post(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve monitor settings for a subuser # @@ -175,6 +185,7 @@ dynamic response = sg.client.subusers._(subuser_name).monitor.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete monitor settings # @@ -185,6 +196,7 @@ dynamic response = sg.client.subusers._(subuser_name).monitor.delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve the monthly email statistics for a single subuser # @@ -202,4 +214,5 @@ dynamic response = sg.client.subusers._(subuser_name).stats.monthly.get(queryPar Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/suppression/suppression.cs b/examples/suppression/suppression.cs index 9eb4f69..a1b255e 100644 --- a/examples/suppression/suppression.cs +++ b/examples/suppression/suppression.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); @@ -20,6 +19,7 @@ dynamic response = sg.client.suppression.blocks.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete blocks # @@ -36,6 +36,7 @@ dynamic response = sg.client.suppression.blocks.delete(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a specific block # @@ -46,6 +47,7 @@ dynamic response = sg.client.suppression.blocks._(email).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a specific block # @@ -56,6 +58,7 @@ dynamic response = sg.client.suppression.blocks._(email).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all bounces # @@ -69,6 +72,7 @@ dynamic response = sg.client.suppression.bounces.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete bounces # @@ -85,6 +89,7 @@ dynamic response = sg.client.suppression.bounces.delete(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a Bounce # @@ -95,6 +100,7 @@ dynamic response = sg.client.suppression.bounces._(email).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a bounce # @@ -108,6 +114,7 @@ dynamic response = sg.client.suppression.bounces._(email).delete(queryParams: qu Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all invalid emails # @@ -123,6 +130,7 @@ dynamic response = sg.client.suppression.invalid_emails.get(queryParams: queryPa Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete invalid emails # @@ -139,6 +147,7 @@ dynamic response = sg.client.suppression.invalid_emails.delete(requestBody: data Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a specific invalid email # @@ -149,6 +158,7 @@ dynamic response = sg.client.suppression.invalid_emails._(email).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a specific invalid email # @@ -159,6 +169,7 @@ dynamic response = sg.client.suppression.invalid_emails._(email).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a specific spam report # @@ -169,6 +180,7 @@ dynamic response = sg.client.suppression.spam_report._(email).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a specific spam report # @@ -179,6 +191,7 @@ dynamic response = sg.client.suppression.spam_report._(email).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all spam reports # @@ -194,6 +207,7 @@ dynamic response = sg.client.suppression.spam_reports.get(queryParams: queryPara Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete spam reports # @@ -210,6 +224,7 @@ dynamic response = sg.client.suppression.spam_reports.delete(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all global suppressions # @@ -225,4 +240,5 @@ dynamic response = sg.client.suppression.unsubscribes.get(queryParams: queryPara Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/templates/templates.cs b/examples/templates/templates.cs index a897f8d..a0df412 100644 --- a/examples/templates/templates.cs +++ b/examples/templates/templates.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.templates.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all transactional templates. # @@ -26,6 +26,7 @@ dynamic response = sg.client.templates.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Edit a transactional template. # @@ -39,6 +40,7 @@ dynamic response = sg.client.templates._(template_id).patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a single transactional template. # @@ -49,6 +51,7 @@ dynamic response = sg.client.templates._(template_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a template. # @@ -59,6 +62,7 @@ dynamic response = sg.client.templates._(template_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create a new transactional template version. # @@ -77,6 +81,7 @@ dynamic response = sg.client.templates._(template_id).versions.post(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Edit a transactional template version. # @@ -95,6 +100,7 @@ dynamic response = sg.client.templates._(template_id).versions._(version_id).pat Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a specific transactional template version. # @@ -106,6 +112,7 @@ dynamic response = sg.client.templates._(template_id).versions._(version_id).get Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a transactional template version. # @@ -117,6 +124,7 @@ dynamic response = sg.client.templates._(template_id).versions._(version_id).del Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Activate a transactional template version. # @@ -128,4 +136,5 @@ dynamic response = sg.client.templates._(template_id).versions._(version_id).act Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/trackingsettings/trackingsettings.cs b/examples/trackingsettings/trackingsettings.cs index 1c8da6c..d44c5b1 100644 --- a/examples/trackingsettings/trackingsettings.cs +++ b/examples/trackingsettings/trackingsettings.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); @@ -18,6 +17,7 @@ dynamic response = sg.client.tracking_settings.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Click Tracking Settings # @@ -30,6 +30,7 @@ dynamic response = sg.client.tracking_settings.click.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Click Track Settings # @@ -39,6 +40,7 @@ dynamic response = sg.client.tracking_settings.click.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Google Analytics Settings # @@ -56,6 +58,7 @@ dynamic response = sg.client.tracking_settings.google_analytics.patch(requestBod Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Google Analytics Settings # @@ -65,6 +68,7 @@ dynamic response = sg.client.tracking_settings.google_analytics.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Open Tracking Settings # @@ -77,6 +81,7 @@ dynamic response = sg.client.tracking_settings.open.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Get Open Tracking Settings # @@ -86,6 +91,7 @@ dynamic response = sg.client.tracking_settings.open.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Subscription Tracking Settings # @@ -103,6 +109,7 @@ dynamic response = sg.client.tracking_settings.subscription.patch(requestBody: d Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Subscription Tracking Settings # @@ -112,4 +119,5 @@ dynamic response = sg.client.tracking_settings.subscription.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/user/user.cs b/examples/user/user.cs index d54706f..277c0d2 100644 --- a/examples/user/user.cs +++ b/examples/user/user.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); @@ -14,6 +13,7 @@ dynamic response = sg.client.user.account.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve your credit balance # @@ -23,6 +23,7 @@ dynamic response = sg.client.user.credits.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update your account email address # @@ -35,6 +36,7 @@ dynamic response = sg.client.user.email.put(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve your account email address # @@ -44,6 +46,7 @@ dynamic response = sg.client.user.email.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update your password # @@ -57,6 +60,7 @@ dynamic response = sg.client.user.password.put(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a user's profile # @@ -71,6 +75,7 @@ dynamic response = sg.client.user.profile.patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Get a user's profile # @@ -80,6 +85,7 @@ dynamic response = sg.client.user.profile.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Cancel or pause a scheduled send # @@ -93,6 +99,7 @@ dynamic response = sg.client.user.scheduled_sends.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all scheduled sends # @@ -102,6 +109,7 @@ dynamic response = sg.client.user.scheduled_sends.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update user scheduled send information # @@ -115,6 +123,7 @@ dynamic response = sg.client.user.scheduled_sends._(batch_id).patch(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve scheduled send # @@ -125,6 +134,7 @@ dynamic response = sg.client.user.scheduled_sends._(batch_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a cancellation or pause of a scheduled send # @@ -135,6 +145,7 @@ dynamic response = sg.client.user.scheduled_sends._(batch_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Enforced TLS settings # @@ -148,6 +159,7 @@ dynamic response = sg.client.user.settings.enforced_tls.patch(requestBody: data) Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve current Enforced TLS settings. # @@ -157,6 +169,7 @@ dynamic response = sg.client.user.settings.enforced_tls.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update your username # @@ -169,6 +182,7 @@ dynamic response = sg.client.user.username.put(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve your username # @@ -178,6 +192,7 @@ dynamic response = sg.client.user.username.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update Event Notification Settings # @@ -202,6 +217,7 @@ dynamic response = sg.client.user.webhooks._("event").settings.patch(requestBody Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Event Webhook settings # @@ -211,6 +227,7 @@ dynamic response = sg.client.user.webhooks._("event").settings.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Test Event Notification Settings # @@ -223,6 +240,7 @@ dynamic response = sg.client.user.webhooks._("event").test.post(requestBody: dat Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Parse Webhook settings # @@ -232,6 +250,7 @@ dynamic response = sg.client.user.webhooks.parse.settings.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieves Inbound Parse Webhook statistics. # @@ -248,4 +267,5 @@ dynamic response = sg.client.user.webhooks.parse.stats.get(queryParams: queryPar Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); diff --git a/examples/whitelabel/whitelabel.cs b/examples/whitelabel/whitelabel.cs index 409204e..6d238a0 100644 --- a/examples/whitelabel/whitelabel.cs +++ b/examples/whitelabel/whitelabel.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); @@ -26,6 +25,7 @@ dynamic response = sg.client.whitelabel.domains.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # List all domain whitelabels. # @@ -42,6 +42,7 @@ dynamic response = sg.client.whitelabel.domains.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Get the default domain whitelabel. # @@ -51,6 +52,7 @@ dynamic response = sg.client.whitelabel.domains._("default").get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # List the domain whitelabel associated with the given user. # @@ -60,6 +62,7 @@ dynamic response = sg.client.whitelabel.domains.subuser.get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Disassociate a domain whitelabel from a given user. # @@ -69,6 +72,7 @@ dynamic response = sg.client.whitelabel.domains.subuser.delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a domain whitelabel. # @@ -83,6 +87,7 @@ dynamic response = sg.client.whitelabel.domains._(domain_id).patch(requestBody: Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a domain whitelabel. # @@ -93,6 +98,7 @@ dynamic response = sg.client.whitelabel.domains._(domain_id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a domain whitelabel. # @@ -103,6 +109,7 @@ dynamic response = sg.client.whitelabel.domains._(domain_id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Associate a domain whitelabel with a given user. # @@ -116,6 +123,7 @@ dynamic response = sg.client.whitelabel.domains._(domain_id).subuser.post(reques Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Add an IP to a domain whitelabel. # @@ -129,6 +137,7 @@ dynamic response = sg.client.whitelabel.domains._(id).ips.post(requestBody: data Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Remove an IP from a domain whitelabel. # @@ -140,6 +149,7 @@ dynamic response = sg.client.whitelabel.domains._(id).ips._(ip).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Validate a domain whitelabel. # @@ -150,6 +160,7 @@ dynamic response = sg.client.whitelabel.domains._(id).validate.post(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create an IP whitelabel # @@ -164,6 +175,7 @@ dynamic response = sg.client.whitelabel.ips.post(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all IP whitelabels # @@ -178,6 +190,7 @@ dynamic response = sg.client.whitelabel.ips.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve an IP whitelabel # @@ -188,6 +201,7 @@ dynamic response = sg.client.whitelabel.ips._(id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete an IP whitelabel # @@ -198,6 +212,7 @@ dynamic response = sg.client.whitelabel.ips._(id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Validate an IP whitelabel # @@ -208,6 +223,7 @@ dynamic response = sg.client.whitelabel.ips._(id).validate.post(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Create a Link Whitelabel # @@ -226,6 +242,7 @@ dynamic response = sg.client.whitelabel.links.post(requestBody: data, queryParam Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve all link whitelabels # @@ -238,6 +255,7 @@ dynamic response = sg.client.whitelabel.links.get(queryParams: queryParams); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a Default Link Whitelabel # @@ -250,6 +268,7 @@ dynamic response = sg.client.whitelabel.links._("default").get(queryParams: quer Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve Associated Link Whitelabel # @@ -262,6 +281,7 @@ dynamic response = sg.client.whitelabel.links.subuser.get(queryParams: queryPara Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Disassociate a Link Whitelabel # @@ -274,6 +294,7 @@ dynamic response = sg.client.whitelabel.links.subuser.delete(queryParams: queryP Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Update a Link Whitelabel # @@ -287,6 +308,7 @@ dynamic response = sg.client.whitelabel.links._(id).patch(requestBody: data); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Retrieve a Link Whitelabel # @@ -297,6 +319,7 @@ dynamic response = sg.client.whitelabel.links._(id).get(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Delete a Link Whitelabel # @@ -307,6 +330,7 @@ dynamic response = sg.client.whitelabel.links._(id).delete(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Validate a Link Whitelabel # @@ -317,6 +341,7 @@ dynamic response = sg.client.whitelabel.links._(id).validate.post(); Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); ################################################## # Associate a Link Whitelabel # @@ -330,4 +355,5 @@ dynamic response = sg.client.whitelabel.links._(link_id).subuser.post(requestBod Console.WriteLine(response.StatusCode); Console.WriteLine(response.ResponseBody.ReadAsStringAsync().Result); Console.WriteLine(response.ResponseHeaders.ToString()); +Console.ReadLine(); |