Skip to content

Commit

Permalink
Merge pull request #91 from ShipEngine/jpill/update-converters
Browse files Browse the repository at this point in the history
fix: update converter references to resolve enum values
  • Loading branch information
jpill authored Jun 12, 2024
2 parents 15dfaf5 + f3aaf9f commit e83729a
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,10 @@ Added custom converter to fallback to default unspecified error code if value ca

### Changed

Updated to .NET 8.0, removed Newtonsoft.Json dependency, and updated to System.Text.Json
Updated to .NET 8.0, removed Newtonsoft.Json dependency, and updated to System.Text.Json

## 2.0.1

### Changed

Updated references to use proper converter to resolve enum string values
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class Address
/// <summary>
/// Indicates whether the address is residential or commercial, if known.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public AddressResidentialIndicator? AddressResidentialIndicator { get; set; }
}
}
4 changes: 2 additions & 2 deletions ShipEngine/Models/Dto/Common/AdvancedShipmentOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AdvancedShipmentOptions
/// Indicates whether to bill shipping costs to the recipient or to a third-party.
/// When billing to a third-party, the bill_to_account, bill_to_country_code, and bill_to_postal_code fields must also be set.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public BillToParty? BillToParty { get; set; }

/// <summary>
Expand Down Expand Up @@ -96,7 +96,7 @@ public class AdvancedShipmentOptions
/// <summary>
/// Indicates if the package will be picked up or dropped off by the carrier
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OriginType? OriginType { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/CollectOnDelivery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CollectOnDelivery
/// <summary>
/// Types of payment that are supported
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PaymentType? PaymentType { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/Customs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Customs
/// <summary>
/// The type of contents in this shipment. This may impact import duties or customs treatment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PackageContents Contents { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/ShipmentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ShipmentItem
/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode? OrderSourceCode { get; set; }
}
}
6 changes: 3 additions & 3 deletions ShipEngine/Models/Dto/CreateLabelFromRate/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class Params
/// <summary>
/// The layout (size) that you want the label to be in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public LabelLayout LabelLayout { get; set; }

/// <summary>
/// The file format that you want the label to be in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public LabelFormat LabelFormat { get; set; }

/// <summary>
Expand All @@ -41,7 +41,7 @@ public class Params
/// <summary>
/// The display format that the label should be shown in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public DisplayScheme DisplayScheme { get; set; }
}
}
12 changes: 6 additions & 6 deletions ShipEngine/Models/Dto/CreateLabelFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Params
/// <summary>
/// The label charge event.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public ChargeEvent? ChargeEvent { get; set; }

/// <summary>
Expand Down Expand Up @@ -155,19 +155,19 @@ public class Shipment
/// <summary>
/// Indicates if the package will be picked up or dropped off by the carrier
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OriginType OriginType { get; set; }

/// <summary>
/// The insurance provider to use for any insured packages in the shipment
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public InsuranceProvider InsuranceProvider { get; set; }

/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode? OrderSourceCode { get; set; }

/// <summary>
Expand Down Expand Up @@ -222,13 +222,13 @@ public class InternationalShipmentOptions
/// <summary>
/// The type of contents in this shipment. This may impact import duties or customs treatment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PackageContents Contents { get; set; }

/// <summary>
/// Indicates what to do if a package is unable to be delivered.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public NonDelivery NonDelivery { get; set; }

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions ShipEngine/Models/Dto/GetRatesFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class Shipment
/// <summary>
/// The type of delivery confirmation that is required for this shipment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public DeliveryConfirmation Confirmation { get; set; }

/// <summary>
Expand All @@ -121,7 +121,7 @@ public class Shipment
/// <summary>
/// The insurance provider to use for any insured packages in the shipment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public InsuranceProvider InsuranceProvider { get; set; }

/// <summary>
Expand All @@ -132,7 +132,7 @@ public class Shipment
/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode OrderSourceCode { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/ShipEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>ShipEngine</PackageId>
<PackageTags>sdk;rest;api;shipping;rates;label;tracking;cost;address;validation;normalization;fedex;ups;usps;</PackageTags>

<Version>2.0.0</Version>
<Version>2.0.1</Version>
<Authors>ShipEngine</Authors>
<Company>ShipEngine</Company>
<Summary>The official ShipEngine C# SDK for .NET</Summary>
Expand Down

0 comments on commit e83729a

Please sign in to comment.