Skip to content

Commit

Permalink
make properties nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
jpill committed Jun 20, 2024
1 parent e80610f commit ca75fcd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/Customs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class Customs
/// <summary>
/// Customs declarations for each item in the shipment.
/// </summary>
public List<CustomsItem> CustomsItems { get; set; }
public List<CustomsItem>? CustomsItems { get; set; }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/CreateLabelFromRate/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public class Result
/// <summary>
/// The label's package(s).
/// </summary>
public List<Package> Packages { get; set; }
public List<Package>? Packages { get; set; }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public class Result
/// <summary>
/// The label's package(s).
/// </summary>
public List<LabelPackage> Packages { get; set; }
public List<LabelPackage>? Packages { get; set; }
}

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions ShipEngine/Models/Dto/GetRatesFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public class Shipment
/// </summary>
public Weight Weight { get; set; }

/// <summary>
/// The type of comparison rate
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public ComparisonRateType? ComparisonRateType { get; set; }

Expand Down
59 changes: 33 additions & 26 deletions ShipEngine/Models/Dto/GetRatesFromShipmentDetails/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace ShipEngineSDK.GetRatesWithShipmentDetails
{
/// <summary>
/// The result of the GetRatesWithShipmentDetails operation
/// </summary>
public class Result
{
/// <summary>
Expand All @@ -29,12 +32,12 @@ public class Result
/// <summary>
/// Describe the packages included in this shipment as related to potential metadata that was imported from external order sources
/// </summary>
public List<ShipmentItem> Items { get; set; }
public List<ShipmentItem>? Items { get; set; }

/// <summary>
/// Tax identifiers
/// </summary>
public List<TaxIdentifier> TaxIdentifiers { get; set; }
public List<TaxIdentifier>? TaxIdentifiers { get; set; }

/// <summary>
/// You can optionally use this field to store your own identifier for this shipment.
Expand Down Expand Up @@ -64,13 +67,13 @@ public class Result
/// <summary>
/// The recipient's mailing address
/// </summary>
public Address ShipTo { get; set; }
public Address? ShipTo { get; set; }

/// <summary>
/// The shipment's origin address. If you frequently ship from the same location, consider creating a warehouse.
/// Then you can simply specify the warehouse_id rather than the complete address each time.
/// </summary>
public Address ShipFrom { get; set; }
public Address? ShipFrom { get; set; }

/// <summary>
/// The warehouse that the shipment is being shipped from. Either warehouse_id or ship_from must be specified.
Expand All @@ -80,7 +83,7 @@ public class Result
/// <summary>
/// The return address for this shipment. Defaults to the ship_from address.
/// </summary>
public Address ReturnTo { get; set; }
public Address? ReturnTo { get; set; }

/// <summary>
/// The type of delivery confirmation that is required for this shipment.
Expand All @@ -90,12 +93,12 @@ public class Result
/// <summary>
/// Customs information. This is usually only needed for international shipments.
/// </summary>
public Customs Customs { get; set; }
public Customs? Customs { get; set; }

/// <summary>
/// Advanced shipment options. These are entirely optional.
/// </summary>
public AdvancedShipmentOptions AdvancedOptions { get; set; }
public AdvancedShipmentOptions? AdvancedOptions { get; set; }

/// <summary>
/// Indicates if the package will be picked up or dropped off by the carrier
Expand All @@ -110,13 +113,13 @@ public class Result
/// <summary>
/// Arbitrary tags associated with this shipment. Tags can be used to categorize shipments, and shipments can be queried by their tags.
/// </summary>
public List<string> Tags { get; set; }
public List<string>? Tags { get; set; }


/// <summary>
/// Total Weight of the Shipment
/// </summary>
public Weight TotalWeight { get; set; }
public Weight? TotalWeight { get; set; }

/// <summary>
/// The order sources that are supported by ShipEngine
Expand All @@ -126,30 +129,33 @@ public class Result
/// <summary>
/// The packages in the shipment.
/// </summary>
public List<ShipmentPackage> Packages { get; set; }
public List<ShipmentPackage>? Packages { get; set; }

/// <summary>
/// The combined weight of all packages in the shipment
/// </summary>
public Weight Weight { get; set; }
public Weight? Weight { get; set; }

/// <summary>
/// The rate responses
/// </summary>
public RateResponse RateResponse { get; set; }
public RateResponse? RateResponse { get; set; }
}

/// <summary>
/// The rate response object
/// </summary>
public class RateResponse
{
/// <summary>
/// A list of shipment rates
/// </summary>
public List<Rate> Rates { get; set; }
public List<Rate>? Rates { get; set; }

/// <summary>
/// A list of invalid shipment rates
/// </summary>
public List<Rate> InvalidRates { get; set; }
public List<Rate>? InvalidRates { get; set; }

/// <summary>
/// A string that uniquely identifies the rate request
Expand All @@ -174,9 +180,12 @@ public class RateResponse
/// <summary>
/// Any errors associated with the rate request
/// </summary>
public List<ShipEngineException> Errors { get; set; }
public List<ShipEngineException>? Errors { get; set; }
}

/// <summary>
/// The rate object
/// </summary>
public class Rate
{
/// <summary>
Expand All @@ -197,33 +206,31 @@ public class Rate
/// <summary>
/// The shipping amount
/// </summary>
public MonetaryValue ShippingAmount { get; set; }
public MonetaryValue? ShippingAmount { get; set; }

/// <summary>
/// The insurance amount
/// </summary>
public MonetaryValue InsuranceAmount { get; set; }
public MonetaryValue? InsuranceAmount { get; set; }

/// <summary>
/// The sum of the carrier costs for the shipment
/// </summary>
public MonetaryValue RequestedComparisonAmount { get; set; }



public MonetaryValue? RequestedComparisonAmount { get; set; }

/// <summary>
/// The confirmation amount
/// </summary>
public MonetaryValue ConfirmationAmount { get; set; }
public MonetaryValue? ConfirmationAmount { get; set; }

/// <summary>
/// Any other charges associated with this rate
/// </summary>
public MonetaryValue OtherAmount { get; set; }
public MonetaryValue? OtherAmount { get; set; }
/// <summary>
/// Tariff and additional taxes associated with an international shipment.
/// </summary>
public MonetaryValue TaxAmount { get; set; }
public MonetaryValue? TaxAmount { get; set; }

/// <summary>
/// Certain carriers base their rates off of custom zones that vary depending upon
Expand Down Expand Up @@ -306,11 +313,11 @@ public class Rate
/// <summary>
/// The warning messages
/// </summary>
public List<string> WarningMessages { get; set; }
public List<string>? WarningMessages { get; set; }

/// <summary>
/// The error messages
/// </summary>
public List<string> ErrorMessages { get; set; }
public List<string>? ErrorMessages { get; set; }
}
}
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/VoidLabelWithLabelId/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ public class Result
/// <summary>
/// Message associated with the result of the void label attempt
/// </summary>
public string Message { get; set; }
public string? Message { get; set; }
}
}

0 comments on commit ca75fcd

Please sign in to comment.