Skip to content
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

Update api.py #9

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions adjust/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from .model import RawCallback, App, AppsResponse, Callback, Event, EventsResponse, Placeholder, User, UserToken


T = TypeVar("T")


Expand Down Expand Up @@ -102,7 +101,7 @@
# Crear un diccionario del user
user_data = {'id': '10', 'email': userEmail, 'name': 'Admin'}
user_token = UserToken(id=int(user_data['id']), email=user_data['email'], name=user_data['name'])
user = user_token_to_user(user_token)
user = self._user_token_to_user(user_token)

Check warning on line 104 in adjust/api/api.py

View check run for this annotation

Codecov / codecov/patch

adjust/api/api.py#L104

Added line #L104 was not covered by tests
return parse_obj_as(type, user)

return parse_obj_as(type, None if r.status_code == 204 else r.json())
Expand Down Expand Up @@ -198,7 +197,7 @@
path = f"dashboard/api/apps/{token}/event_types/{callback.id}/callback"
self._api(NoneType, path, method="PUT", callback_url=callback.url)

def user_token_to_user(user_token: UserToken) -> User:
def _user_token_to_user(user_token: UserToken) -> User:
"""Transforms a UserToken object into a User object.

Args:
Expand Down