easypost-csharp
easypost-csharp copied to clipboard
[chore] Support new UPS carrier account create/update endpoint
Description
- Update carrier account creation/update functions to account for new UPS endpoint without introducing new functions
- Add/rework parameter sets for UPS carrier account creation to accommodate new schema
- Under-the-hood changes to carrier account parameter sets for determining endpoints based on type
- Modeled after: https://github.com/nwithan8/easypost-extensions-dotnet/tree/master/EasyPost.Extensions/Parameters/CarrierAccount
- Add parameter sets for UPS carrier account update
- Mark existing legacy carrier account creation/update functions (using dictionaries) as obsolete, as they do not support the new UPS endpoints
- Introduce guard clauses that will cause the legacy functions to error out if attempting to use them for a UPS account - guide users to the parameter set-based alternatives
- Under-the-hood consolidation of dictionary mutations for parameter JSON serialization
Outside of obsolete warnings (and guard clauses if users decide to ignore the obsolete warnings), there are no breaking changes to existing workflows. Only those creating/editing UPS accounts will need to account for the changes made in this PR.
Testing
- New unit tests to confirm UPS endpoint switching, guard clauses, parameter set inheritance and serialization
- Added/re-recorded cassettes as needed
Pull Request Type
Please select the option(s) that are relevant to this PR.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)