summaryrefslogtreecommitdiffstats
path: root/examples/ips/ips.cs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/ips/ips.cs')
-rw-r--r--examples/ips/ips.cs15
1 files changed, 14 insertions, 1 deletions
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();