-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[POC] Denote the interdependency between parameters in a parameter set (
#571) - Add new InvalidParameterPairError exception type - Add new top-level and nested parameter attributes to denote interdependency between multiple parameters - Check interdependency of parameters during serialization - Test parameter interdependency enforcement - Test invalid parameter pair exception - Shipment and Batch parameter for a Pickup.Create parameter set are interdependent (mutually exclusive)
- Loading branch information
Showing
9 changed files
with
428 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Globalization; | ||
|
||
namespace EasyPost.Exceptions.General | ||
{ | ||
/// <summary> | ||
/// Represents an error that occurs due to an invalid parameter pair. | ||
/// </summary> | ||
public class InvalidParameterPairError : ValidationError | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="InvalidParameterPairError" /> class. | ||
/// </summary> | ||
/// <param name="firstParameterName">The name of the first parameter in the pair.</param> | ||
/// <param name="secondParameterName">The name of the second parameter in the pair.</param> | ||
/// <param name="followUpMessage">Additional message to include in error message.</param> | ||
internal InvalidParameterPairError(string firstParameterName, string secondParameterName, string? followUpMessage = "") | ||
: base($"{string.Format(CultureInfo.InvariantCulture, Constants.ErrorMessages.InvalidParameterPair, firstParameterName, secondParameterName)}. {followUpMessage}") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.