Skip to content

Commit

Permalink
fix get method for my_profile API
Browse files Browse the repository at this point in the history
  • Loading branch information
jayachandhar committed Jun 27, 2021
1 parent ac7e119 commit 1befb9b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion fyle/platform/apis/v1/fyler/my_profile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
V1 Fyler My Profile
"""
from typing import Dict

from .... import exceptions
from ....internals.get_resources import GetResources


Expand All @@ -11,4 +13,24 @@ class MyProfile(GetResources):
MY_PROFILE = '/my_profile'

def __init__(self, version, role):
super().__init__(version, role, MyProfile.MY_PROFILE)
super().__init__(version, role, MyProfile.MY_PROFILE)

def get_by_id(self, id_: str) -> Dict:
raise NotImplementedError()

def get(self) -> Dict:
"""
Get Single Resource object by ID
:return: Resource Object
"""
query_params = {}

response = self.api.make_get_request(
api_url=self.endpoint,
query_params=query_params,
)

if response is None or response['data'] is None or response['data'] == {}:
raise exceptions.NotFoundItemError('Not found item with ID')

return response
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='fyle',
version='v0.7.0',
version='v0.8.0',
author='Siva Narayanan',
author_email='[email protected]',
description='Python SDK for accessing Fyle Platform APIs',
Expand Down

0 comments on commit 1befb9b

Please sign in to comment.