-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLAT-480: Update Python Library to APIv2 #28
Conversation
This PR does a first pass at APIv2 compatibility for the python client library. All resource files and resource spec files are now auto-generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one blocker, one potential issue. super excited to get v2 clients out the door!
patreon/api.py
Outdated
if not includes: | ||
includes = campaign.default_relationships \ | ||
+ [campaign.Relationships.pledges] | ||
def fetch_campaigns(self, includes=None, fields=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a second definition of fetch_campaigns
with the same signature, no?
) | ||
|
||
def fetch_members(self, campaign_id, page_size, cursor=None, includes=None, fields=None): | ||
url = url = 'campaigns/{0}/members'.format(campaign_id) | ||
params = {'page[count]': page_size} | ||
if cursor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code assumes cursor
will be a datetime object -- is that still the case for paginating through members? https://docs.patreon.com/#get-api-oauth2-v2-campaigns-campaign_id-members implies it is not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we changed the cursor logic at all for APIv2, so we should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! just had one question.
] | ||
|
||
|
||
def test_schema_attributes_are_properly_formatted(attributes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(question for my own edification) what calls these? what is attributes
as passed in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reminding me I need to update the README! But it's described in the README.
We could do much more with this in the future.
This PR does a first pass at APIv2 compatibility for the python client library.
All resource files, resource spec files, api files, and api spec files are now auto-generated.
Ran tests locally from python client repo; all passed.