-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from EasyPost/remove_carbon_offset
chore: new major release examples, remove carbon offset
- Loading branch information
Showing
741 changed files
with
12,963 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "417 Montgomery Street", | ||
Street2 = "FL 5", | ||
City = "San Francisco", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
}; | ||
|
||
Address address = await client.Address.CreateAndVerify(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "417 MONTGOMERY ST", | ||
Street2 = "FLOOR 5", | ||
City = "SAN FRANCISCO", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
}; | ||
|
||
Address address = await client.Address.Create(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.All parameters = new() | ||
{ | ||
PageSize = 5 | ||
}; | ||
|
||
AddressCollection addressCollection = await client.Address.All(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(addressCollection, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Address address = await client.Address.Retrieve("adr_..."); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "UNDELIVERABLE ST", | ||
Street2 = "FLOOR 5", | ||
City = "SAN FRANCISCO", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
}; | ||
|
||
Address address = await client.Address.Create(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "417 MONTGOMERY ST", | ||
Street2 = "FLOOR 5", | ||
City = "SAN FRANCISCO", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
Verify = true | ||
}; | ||
|
||
Address address = await client.Address.Create(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "417 MONTGOMERY ST", | ||
Street2 = "FLOOR 5", | ||
City = "SAN FRANCISCO", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
VerifyStrict = true | ||
}; | ||
|
||
Address address = await client.Address.Create(parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Parameters.Address.Create parameters = new() | ||
{ | ||
Street1 = "417 MONTGOMERY ST", | ||
Street2 = "FLOOR 5", | ||
City = "SAN FRANCISCO", | ||
State = "CA", | ||
Zip = "94104", | ||
Country = "US", | ||
Company = "EasyPost", | ||
Phone = "415-123-4567", | ||
}; | ||
|
||
Address address = await client.Address.Create(parameters); | ||
|
||
address = await client.Address.Verify(address.Id) | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(address, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
// Retrieve all API keys including children | ||
List<ApiKey> apiKeys = await client.ApiKey.All(); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(apiKeys, Formatting.Indented)); | ||
|
||
// Retrieve API keys for a specific child user | ||
List<ApiKey> childApiKeys = await client.ApiKey.RetrieveApiKeysForUser("user_..."); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(childApiKeys, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
using EasyPost.Parameters; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Shipment shipment = await client.Shipment.Retrieve("shp_..."); | ||
|
||
Batch batch = await client.Batch.Retrieve("batch_..."); | ||
|
||
Parameters.Batch.AddShipments parameters = new() | ||
{ | ||
Shipments = new List<Shipment> { shipment }, | ||
}; | ||
|
||
batch = await client.Batch.AddShipments(batch.Id, parameters); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(batch, Formatting.Indented)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Newtonsoft.Json; | ||
using EasyPost; | ||
using EasyPost.Models.API; | ||
|
||
namespace EasyPostExamples | ||
{ | ||
public class Examples | ||
{ | ||
public static async Task Main() | ||
{ | ||
string apiKey = Environment.GetEnvironmentVariable("EASYPOST_API_KEY")!; | ||
|
||
var client = new EasyPost.Client(apiKey); | ||
|
||
Batch batch = await client.Batch.Retrieve("batch_..."); | ||
|
||
batch = await client.Batch.Buy(batch.Id); | ||
|
||
Console.WriteLine(JsonConvert.SerializeObject(batch, Formatting.Indented)); | ||
} | ||
} | ||
} |
Oops, something went wrong.