Closed jfthuong closed 3 years ago
There's a bigger issue with this PR - the generated _endpoints.py
contains duplicate class definitions:
...
class Tags(Endpoint):
def update(self, **kwargs):
return self.client.request('/tags/{id}', 'PUT', argument_type=argument_types.TagsUpdateArgument, return_type=return_types.Tag, **kwargs)
...
class Tags(Endpoint):
def __init__(self, client):
super().__init__(client)
self.sums = TagsSums(client)
def merge(self, **kwargs):
return self.client.request('/tags/merge', 'POST', argument_type=argument_types.TagsMergeArgument, **kwargs)
def list(self, **kwargs):
return self.client.request('/tags', 'GET', argument_type=argument_types.TagsListArgument, return_type=return_types.Tag, **kwargs)
def get(self, **kwargs):
return self.client.request('/tags/{id}', 'GET', argument_type=argument_types.TagsGetArgument, return_type=return_types.Tag, **kwargs)
def delete(self, **kwargs):
return self.client.request('/tags/{id}', 'DELETE', argument_type=argument_types.TagsDeleteArgument, **kwargs)
def create(self, **kwargs):
return self.client.request('/tags', 'POST', argument_type=argument_types.TagsCreateArgument, **kwargs)
class Me(Endpoint):
def update(self, **kwargs):
return self.client.request('/me', 'PUT', argument_type=argument_types.MeUpdateArgument, return_type=return_types.User, **kwargs)
def settings(self, **kwargs):
return self.client.request('/me/settings', 'GET', **kwargs)
def revert(self, **kwargs):
return self.client.request('/me/revert', 'POST', argument_type=argument_types.MeRevertArgument, **kwargs)
def push(self, **kwargs):
return self.client.request('/me/push', 'POST', argument_type=argument_types.MePushArgument, **kwargs)
...
class Me(Endpoint):
def __init__(self, client):
super().__init__(client)
self.notifications = MeNotifications(client)
def get(self, **kwargs):
return self.client.request('/me', 'GET', return_type=return_types.User, **kwargs)
def devices(self, **kwargs):
return self.client.request('/me/devices', 'GET', **kwargs)
...
I haven't looked into why, exactly, but perhaps you could take a look? Alternatively, I'm happy to cherry pick contributions from this PR to merge?
There's a bigger issue with this PR - the generated
_endpoints.py
contains duplicate class definitions:
I know, I have noticed it in my later commits. I have later totally re-written that part to make it simpler.
It is, in our case, related to the sorted(..., reverse=True)
line. I have corrected and pushed. (commit 0777da9)
This could be improved even further with a
while
loop that adds dummy required, like described in #4