Skip to content

Commit

Permalink
Merge pull request #44 from easykeys/bug/fedex/api/addressvalidation
Browse files Browse the repository at this point in the history
Updated versioning and enhanced JSON serialization
  • Loading branch information
ucrengineer authored May 9, 2024
2 parents f88f5bf + 86a06d6 commit 73f7bf9
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 22 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mode: Mainline
next-version: 4.0.0
next-version: 4.0.1
branches:
feature:
tag: preview
Expand Down
2 changes: 1 addition & 1 deletion build/settings.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup Label="Basic Settings">
<VersionPrefix>4.0.0-preview1</VersionPrefix>
<VersionPrefix>4.0.1-preview1</VersionPrefix>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<NoWarn>$(NoWarn);CS1591;NU1605;DS126858;DS137138;SA1010;SA1011</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class Alert
{
[JsonPropertyName("code")]
public string Code { get; set; } = string.Empty;

[JsonPropertyName("message")]
public string Message { get; set; } = string.Empty;

[JsonPropertyName("alertType")]
public string AlertType { get; set; } = string.Empty;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class Attributes
{
[JsonPropertyName("POBox")]
public bool? POBox { get; set; }

[JsonPropertyName("POBoxOnlyZIP")]
public bool? POBoxOnlyZIP { get; set; }

[JsonPropertyName("SplitZip")]
public bool? SplitZip { get; set; }

[JsonPropertyName("SuiteRequiredButMissing")]
public bool? SuiteRequiredButMissing { get; set; }

[JsonPropertyName("InvalidSuiteNumber")]
public bool? InvalidSuiteNumber { get; set; }

[JsonPropertyName("ResolutionInput")]
public string? ResolutionInput { get; set; }

[JsonPropertyName("DPV")]
public bool? DPV { get; set; }

[JsonPropertyName("ResolutionMethod")]
public string? ResolutionMethod { get; set; }

[JsonPropertyName("DataVintage")]
public string? DataVintage { get; set; }

[JsonPropertyName("MatchSource")]
public string? MatchSource { get; set; }

[JsonPropertyName("CountrySupported")]
public bool? CountrySupported { get; set; }

[JsonPropertyName("ValidlyFormed")]
public bool? ValidlyFormed { get; set; }

[JsonPropertyName("Matched")]
public bool? Matched { get; set; }

[JsonPropertyName("Resolved")]
public bool? Resolved { get; set; }

[JsonPropertyName("Inserted")]
public bool? Inserted { get; set; }

[JsonPropertyName("MultiUnitBase")]
public bool? MultiUnitBase { get; set; }

[JsonPropertyName("ZIP11Match")]
public bool? ZIP11Match { get; set; }

[JsonPropertyName("ZIP4Match")]
public bool? ZIP4Match { get; set; }

[JsonPropertyName("UniqueZIP")]
public bool? UniqueZIP { get; set; }

[JsonPropertyName("StreetAddress")]
public bool? StreetAddress { get; set; }

[JsonPropertyName("RRConversion")]
public bool? RRConversion { get; set; }

[JsonPropertyName("ValidMultiUnit")]
public bool? ValidMultiUnit { get; set; }

[JsonPropertyName("AddressType")]
public string? AddressType { get; set; }

[JsonPropertyName("AddressPrecision")]
public string? AddressPrecision { get; set; }

[JsonPropertyName("MultipleMatches")]
public bool? MultipleMatches { get; set; }
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class Output
{
[JsonPropertyName("resolvedAddresses")]
public List<ResolvedAddress>? ResolvedAddresses { get; set; }

public List<Alert>? Alerts { get; set; }
[JsonPropertyName("alerts")]
public List<Alert> Alerts { get; set; } = new ();
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class ParsedPostalCode
{
[JsonPropertyName("base")]
public string? Base { get; set; }

[JsonPropertyName("addOn")]
public string? AddOn { get; set; }

[JsonPropertyName("deliveryPoint")]
public string? DeliveryPoint { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class ResolutionToken
{
public bool Changed { get; set; }
[JsonPropertyName("changed")]
public bool? Changed { get; set; }

[JsonPropertyName("value")]
public string? Value { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;
using System.Text.Json.Serialization;

namespace EasyKeys.Shipping.FedEx.AddressValidation.Client.V1.Models.Response;

public class ResolvedAddress
{
[JsonPropertyName("streetLinesToken")]
public string[]? StreetLinesToken { get; set; }

[JsonPropertyName("city")]
public string? City { get; set; }

[JsonPropertyName("stateOrProvinceCode")]
public string? StateOrProvinceCode { get; set; }

[JsonPropertyName("countryCode")]
public string? CountryCode { get; set; }

public List<CustomerMessage>? CustomerMessage { get; set; }
[JsonPropertyName("customerMessage")]
public List<ResolutionToken>? CustomerMessage { get; set; }

[JsonPropertyName("cityToken")]
public List<ResolutionToken>? CityToken { get; set; }

[JsonPropertyName("postalCodeToken")]
public ResolutionToken? PostalCodeToken { get; set; }

[JsonPropertyName("parsedPostalCode")]
public ParsedPostalCode? ParsedPostalCode { get; set; }

[JsonPropertyName("classification")]
public string? Classification { get; set; }

public bool PostOfficeBox { get; set; }
[JsonPropertyName("postOfficeBox")]
public bool? PostOfficeBox { get; set; }

public bool NormalizedStatusNameDPV { get; set; }
[JsonPropertyName("normalizedStatusNameDPV")]
public bool? NormalizedStatusNameDPV { get; set; }

[JsonPropertyName("standardizedStatusNameMatchSource")]
public string? StandardizedStatusNameMatchSource { get; set; }

[JsonPropertyName("resolutionMethodName")]
public string? ResolutionMethodName { get; set; }

public bool RuralRouteHighwayContract { get; set; }
[JsonPropertyName("ruralRouteHighwayContract")]
public bool? RuralRouteHighwayContract { get; set; }

public bool GeneralDelivery { get; set; }
[JsonPropertyName("generalDelivery")]
public bool? GeneralDelivery { get; set; }

[JsonPropertyName("attributes")]
public Dictionary<string, object> Attributes { get; set; } = new ();
}

0 comments on commit 73f7bf9

Please sign in to comment.