[RB-326] v31 client updates #73
Merged
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.
Intent (What)
XPM updates their API version to v3.1 and unfortunately it affects the v3.0 as well.
They're changing the relation between Contact and Client from 1:1 to 1:many. Yes, multiple Clients can share the same contact. We need to do a couple of small changes in order to support that.
Motivation (Why)
Implementation (How)
API will response with an error If a Contact belongs to multiple Clients so I allow Client ID param for Contact update action.
It's optional. The API will still perform update without Client ID if Contact belongs to 1 Client.
The same logic applies here. Optional Client ID. Error if Contact belongs to multiple Clients and Client ID is not provided.
Consequence
It shouldn't affect any existing users of the gem as Client ID is optional. XPM really should've updated API to v4.0 as it's a non-reversible breaking change