Skip to content

Commit

Permalink
Merge pull request #69 from RadoslawLyson/spartans/GOLD-2347-model-fix
Browse files Browse the repository at this point in the history
 fix(model):GOLD-2347 model nullable parameters
  • Loading branch information
BartoszMusielak authored Oct 4, 2023
2 parents 2c9f163 + fb1b160 commit bd68b76
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ ShipmentItem.Quantity is now an int? instead of a double?.

### Fixed

Set casing of letter label layout enum
Set casing of letter label layout enum

## 1.1.4

### Fixed

CreateLabelFromShipmentDetails parameters causing problems when unused has been made optional.
16 changes: 9 additions & 7 deletions ShipEngine/Models/Dto/CreateLabelFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,38 @@ public class Params
/// The label charge event.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public ChargeEvent ChargeEvent { get; set; }
public ChargeEvent? ChargeEvent { get; set; }

/// <summary>
/// The labelId of the original (outgoing) label that the return label is for. This associates the two labels together, which is required by some carriers.
/// </summary>
public string OutboundLabelId { get; set; }
#nullable enable
public string? OutboundLabelId { get; set; }
#nullable disable

/// <summary>
/// The possible validate address values
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public ValidateAddress ValidateAddress { get; set; }
public ValidateAddress? ValidateAddress { get; set; }

/// <summary>
/// There are two different ways to download a label:
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public LabelDownloadType LabelDownloadType { get; set; }
public LabelDownloadType? LabelDownloadType { get; set; }

/// <summary>
/// The file format that you want the label to be in. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public LabelFormat LabelFormat { get; set; }
public LabelFormat? LabelFormat { get; set; }

/// <summary>
/// The display format that the label should be shown in.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public DisplayScheme DisplayScheme { get; set; }
public DisplayScheme? DisplayScheme { get; set; }

/// <summary>
/// The layout (size) that you want the label to be in. The labelFormat determines which sizes are allowed. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
Expand Down Expand Up @@ -167,7 +169,7 @@ public class Shipment
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public OrderSourceCode OrderSourceCode { get; set; }
public OrderSourceCode? OrderSourceCode { get; set; }

/// <summary>
/// The packages in the shipment.
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>1.1.3</Version>
<Version>1.1.4</Version>
<Authors>ShipEngine</Authors>
<Company>ShipEngine</Company>
<Summary>The official ShipEngine C# SDK for .NET</Summary>
Expand Down

0 comments on commit bd68b76

Please sign in to comment.