Skip to content

Commit

Permalink
- Fix client initialization syntax for .NET examples (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 authored Jun 4, 2024
1 parent f095e08 commit fa39d0c
Show file tree
Hide file tree
Showing 104 changed files with 104 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.All parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Address address = await client.Address.Retrieve("adr_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/verify-failure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/verify-param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/addresses/verify.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Address.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/api-keys/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

// Retrieve all API keys including children
List<ApiKey> apiKeys = await client.ApiKey.All();
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/add-shipments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Shipment shipment = await client.Shipment.Retrieve("shp_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/buy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Batch batch = await client.Batch.Retrieve("batch_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Shipment shipment = await client.Shipment.Retrieve("shp_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/label.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Batch batch = await client.Batch.Retrieve("batch_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Batch.All parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/remove-shipments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Shipment shipment = await client.Shipment.Retrieve("shp_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Batch batch = await client.Batch.Retrieve("batch_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/batches/scan-forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Batch batch = await client.Batch.Retrieve("batch_...");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

PaymentMethod paymentMethod = await client.ReferralCustomer.AddCreditCardToUser("REFERRAL_USER_API_KEY", "0123456789101234", "01", "2025", "111", PaymentMethod.Priority.Primary);

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/billing/delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

await client.Billing.DeletePaymentMethod(PaymentMethod.Priority.Primary);
}
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/billing/fund.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

await client.Billing.FundWallet("2000", PaymentMethod.Priority.Primary);
}
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/billing/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

PaymentMethodsSummary paymentMethodsSummary = await client.Billing.RetrievePaymentMethodsSummary();

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/brand/update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

User user = await client.User.RetrieveMe();

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-accounts/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.CarrierAccount.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-accounts/delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

CarrierAccount carrierAccount = await client.CarrierAccount.Retrieve("ca_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-accounts/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

List<CarrierAccount> carrierAccounts = await client.CarrierAccount.All();

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-accounts/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

CarrierAccount carrierAccount = await client.CarrierAccount.Retrieve("ca_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-accounts/update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

CarrierAccount carrierAccount = await client.CarrierAccount.Retrieve("ca_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-metadata/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

// Request all metadata for all carriers
List<Carrier> carrierMetadata = await client.CarrierMetadata.Retrieve();
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/carrier-types/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

List<CarrierType> carrierTypes = await client.CarrierType.All();

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/child-users/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.User.CreateChild parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/child-users/delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

User user = await client.User.Retrieve("user_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/child-users/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Users.AllChildren parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/customs-infos/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.CustomsInfo.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/customs-infos/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

CustomsInfo customsInfo = await client.CustomsInfo.Retrieve("cstinfo_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/customs-items/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.CustomsItems.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/customs-items/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

CustomsItem customsItem = await client.CustomsItem.Retrieve("cstitem_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/endshipper/buy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Shipment shipment = await client.Shipment.Retrieve("shp_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/endshipper/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.EndShipper.Create parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/endshipper/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.EndShipper.All parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/endshipper/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

EndShipper endShipper = await client.EndShipper.Retrieve("es_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/endshipper/update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

EndShipper endShipper = await client.EndShipper.Retrieve("es_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/events/list.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Parameters.Event.All parameters = new()
{
Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/events/retrieve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

Event @event = await client.Event.Retrieve("evt_...");

Expand Down
2 changes: 1 addition & 1 deletion official/docs/csharp/current/forms/create.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client("EASYPOST_API_KEY");
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

// Shipment has to be purchased before forms can be generated
Shipment shipment = await client.Shipment.Retrieve("shp_...");
Expand Down
Loading

0 comments on commit fa39d0c

Please sign in to comment.