Skip to content

Commit 5cff528

Browse files
authored
Code cleanup (#363)
- Move Security to http folder where it belongs - Make sure all models extend EasyPostObject - TODO to remove default value from batch generate label
1 parent 99b9ce7 commit 5cff528

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

EasyPost/Models/API/Security.cs renamed to EasyPost/Http/Security.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Net;
22

3-
namespace EasyPost.Models.API
3+
namespace EasyPost.Http
44
{
55
internal static class Security
66
{

EasyPost/Models/API/Batch.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public async Task<Batch> Buy()
8989
/// </summary>
9090
/// <param name="fileFormat">Format to generate the label in. Valid formats: "pdf", "zpl" and "epl2".</param>
9191
[CrudOperations.Update]
92-
public async Task<Batch> GenerateLabel(string fileFormat = "pdf")
92+
public async Task<Batch> GenerateLabel(string fileFormat = "pdf") // TODO: Remove default value (breaking change)
9393
{
9494
Dictionary<string, object> parameters = new Dictionary<string, object> { { "file_format", fileFormat } };
9595
await Update<Batch>(Method.Post, $"batches/{Id}/label", parameters);
@@ -101,7 +101,7 @@ public async Task<Batch> GenerateLabel(string fileFormat = "pdf")
101101
/// </summary>
102102
/// <param name="fileFormat">Format to generate the label in. Valid formats: "pdf", "zpl" and "epl2".</param>
103103
[CrudOperations.Update]
104-
public async Task<Batch> GenerateScanForm(string fileFormat = "pdf")
104+
public async Task<Batch> GenerateScanForm(string fileFormat = "pdf") // TODO: Remove default value (breaking change)
105105
{
106106
Dictionary<string, object> parameters = new Dictionary<string, object> { { "file_format", fileFormat } };
107107
await Update<Batch>(Method.Post, $"batches/{Id}/scan_form", parameters);

EasyPost/Models/API/CarbonOffset.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1+
using EasyPost._base;
12
using Newtonsoft.Json;
23

34
namespace EasyPost.Models.API
45
{
5-
public class CarbonOffset
6+
public class CarbonOffset : EasyPostObject
67
{
78
#region JSON Properties
89

910
[JsonProperty("currency")]
1011
public string? Currency { get; set; }
1112
[JsonProperty("grams")]
1213
public int? Grams { get; set; }
13-
[JsonProperty("object")]
14-
public string? Object { get; set; }
1514
[JsonProperty("price")]
1615
public string? Price { get; set; }
1716

EasyPost/Models/API/CarrierDetail.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
2+
using EasyPost._base;
23
using Newtonsoft.Json;
34

45
namespace EasyPost.Models.API
56
{
6-
public class CarrierDetail
7+
public class CarrierDetail : EasyPostObject
78
{
89
#region JSON Properties
910

EasyPost/Models/API/TaxIdentifier.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using Newtonsoft.Json;
1+
using EasyPost._base;
2+
using Newtonsoft.Json;
23

34
namespace EasyPost.Models.API
45
{
5-
public class TaxIdentifier
6+
public class TaxIdentifier : EasyPostObject
67
{
78
#region JSON Properties
89

EasyPost/Models/API/TimeInTransit.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using Newtonsoft.Json;
1+
using EasyPost._base;
2+
using Newtonsoft.Json;
23

34
namespace EasyPost.Models.API
45
{
5-
public class TimeInTransit
6+
public class TimeInTransit : EasyPostObject
67
{
78
#region JSON Properties
89

EasyPost/Models/API/TrackingLocation.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using Newtonsoft.Json;
1+
using EasyPost._base;
2+
using Newtonsoft.Json;
23

34
namespace EasyPost.Models.API
45
{
5-
public class TrackingLocation
6+
public class TrackingLocation : EasyPostObject
67
{
78
#region JSON Properties
89

0 commit comments

Comments
 (0)