-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
107 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Changelog | ||
|
||
## 0.1.2 | ||
|
||
- Improve code quality | ||
|
||
## 0.1.1 | ||
|
||
- Fix HACS manifest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Endpoints for Polar Access Link.""" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 3 additions & 11 deletions
14
...ents/polar/lib/endpoints/training_data.py → ...olaraccesslink/endpoints/training_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
...onents/polar/lib/endpoints/transaction.py → .../polaraccesslink/endpoints/transaction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
"""Generic transaction.""" | ||
from .resource import Resource | ||
|
||
|
||
class Transaction(Resource): | ||
"""Generic transaction.""" | ||
|
||
def __init__(self, oauth, transaction_url, user_id, access_token): | ||
"""Init the transaction object.""" | ||
super().__init__(oauth) | ||
self.transaction_url = transaction_url | ||
self.user_id = user_id | ||
self.access_token = access_token | ||
|
||
def commit(self): | ||
"""Commit the transaction | ||
This should be done after retrieving data from the transaction. | ||
""" | ||
"""Commit the transaction.""" | ||
return self._put( | ||
endpoint=None, url=self.transaction_url, access_token=self.access_token | ||
) |
28 changes: 28 additions & 0 deletions
28
custom_components/polar/polaraccesslink/endpoints/users.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Users.""" | ||
import uuid | ||
|
||
from .resource import Resource | ||
|
||
|
||
class Users(Resource): | ||
"""This resource provides all the necessary functions to manage users.""" | ||
|
||
def register(self, access_token, member_id=uuid.uuid4().hex): | ||
"""Registration.""" | ||
return self._post( | ||
endpoint="/users", access_token=access_token, json={"member-id": member_id} | ||
) | ||
|
||
def delete(self, user_id, access_token): | ||
"""De-registration.""" | ||
return self._delete( | ||
endpoint=f"/users/{user_id}", | ||
access_token=access_token, | ||
) | ||
|
||
def get_information(self, user_id, access_token): | ||
"""List user's basic information.""" | ||
return self._get( | ||
endpoint=f"/users/{user_id}", | ||
access_token=access_token, | ||
) |
Oops, something went wrong.