PyPardot4 icon indicating copy to clipboard operation
PyPardot4 copied to clipboard

separate the implementations between ver. 3 and 4

Open daigotanaka opened this issue 4 years ago • 0 comments

(redo pr: the previous #42 was opened with my master branch.)

As some people reported in #38, Pardot API resources of ver 3 and 4 have different interfaces while the authentications and the URL format are the same. So, I suggest separating the implementations in the design just as in this pr.

With this design, we will be able to:

  1. Instantiate PyPardot client by specifying version
p = PardotAPI(email='[email protected]', password='xxxx', user_key='yyyy', version=3)
# defaults to 4
  1. Load different methods:
p.prospects.update_by_email('[email protected]', params)   # Only supported with ver. 3
  1. Update the implementation of one version without a fear of breaking another.

I hope you can take a look and consider it.

Most files added in this PR are straight import from Josh Geller's original implementation under object_v3 folder. The modifications are for allowing a run-time switch.

daigotanaka avatar Aug 25 '20 16:08 daigotanaka