Skip to content

Conversation

@nwithan8
Copy link
Contributor

Description

Re: #377

Users can now define (and down the road we can add defaults) a Match function that evaluates if a parameter set object matches an EasyPost object. Some of our users have implemented their own version of this utility, to see if a prepared parameter set matches an existing object (e.g. if the address in a shipment parameter set matches the address of a given EasyPost object, they know they don't need to make a new object).

This PR:

  • Add "Matches" function at base level of all parameter sets to test if a given set matches a provided EasyPostObject-based object
    • This can be implemented by library maintainers with "default" functions, or end-users can implement their own.

Testing

  • Add unit tests to confirm function can be implemented and works as expected

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • Bug fix (non-breaking change which fixes an issue)
  • 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)

@nwithan8 nwithan8 requested a review from a team August 30, 2023 20:34
@nwithan8 nwithan8 linked an issue Aug 30, 2023 that may be closed by this pull request
…if a given set matches a provided EasyPostObject-based object

- Add unit tests to confirm function can be implemented and works as expected
@nwithan8 nwithan8 force-pushed the 377-add-equality-overload-for-comparison-of-easypostobject-and-dictionary branch from dce11fa to 963e87e Compare August 30, 2023 20:35
Co-authored-by: Justin Hammond <39606064+Justintime50@users.noreply.github.com>
@Justintime50
Copy link
Member

We'll want to remember to call out in the CHANGELOG that we fixed the Shipment -> Batch reference in addition to the new feature

@nwithan8 nwithan8 merged commit 0b93bc1 into master Aug 30, 2023
@nwithan8 nwithan8 deleted the 377-add-equality-overload-for-comparison-of-easypostobject-and-dictionary branch August 30, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add equality overload for comparison of EasyPostObject and dictionary

4 participants