[feat] Add custom parameter sets for FedEx and UPS account creation #509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Re: #365
This PR introduces custom parameter sets for creating FedEx and UPS carrier accounts, as these two require different payload schemas than other carrier account types. These parameter sets (
CreateFedEx
,CreateUps
) helps end-users know what parameters are required for these two specific carrier accounts compared to other carrier accounts, and handles elements such as parameter placement during serialization (standard for all parameter set objects) and auto-populating the carrier account type parameter.These custom parameter sets can be used in the normal
Create
function. One step further, an exception will be raised if the user attempts to use the genericCreate
parameter set with, e.g. "FedExAccount" as its type (will force users to only use theCreateFedEx
parameter set if they are attempting to make a FedEx carrier account (same for UPS)).The parameter sets for FedEx and UPS have a number of required parameters that, if not completed, will raise a local exception during pre-request serialization (standard feature for parameter sets). This will additionally insure that users are not only using the proper parameter set for, eg., creating a FedEx account, but that all required data is being provided, all before the request is actually attempted.
Testing
Pull Request Type
Please select the option(s) that are relevant to this PR.