From d091f6ffafb826302366beb3e94fbef1cf683cc7 Mon Sep 17 00:00:00 2001 From: Nishant Nayudu Date: Wed, 16 Dec 2020 14:05:26 -0800 Subject: [PATCH] Added Remove User, Get Credits Endpoints --- README.md | 15 +++++++++++++++ setup.py | 2 +- shrimpy/shrimpy_api_client.py | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b06ca9..11dae1e 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,19 @@ user_id = create_user_response['id'] ```python client.name_user( + '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', # user_id 'mycustomname' # name ) ``` +* [`remove_user`](https://developers.shrimpy.io/docs/#removing-a-user) + +```python +client.remove_user( + '701e0d16-1e9e-42c9-b6a1-4cada1f395b8', # user_id +) +``` + ### User API Keys Methods * [`get_api_keys`](https://developers.shrimpy.io/docs/#get-api-keys) @@ -499,6 +508,12 @@ candles = client.get_historical_candles( status = client.get_status() ``` +* [`get_credits`](https://developers.shrimpy.io/docs/#get-credits) + +```python +usage = client.get_credits() +``` + * [`get_usage`](https://developers.shrimpy.io/docs/#get-usage) ```python diff --git a/setup.py b/setup.py index 3290d77..487911b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setuptools.setup( name="shrimpy_python", - version="0.0.12", + version="0.0.13", author="ShrimpyOfficial", author_email="support@shrimpy.io", description="The Official Shrimpy API Python Client", diff --git a/shrimpy/shrimpy_api_client.py b/shrimpy/shrimpy_api_client.py index 35b9212..2eee351 100644 --- a/shrimpy/shrimpy_api_client.py +++ b/shrimpy/shrimpy_api_client.py @@ -107,6 +107,11 @@ def name_user(self, user_id, name): return self._call_endpoint('POST', endpoint, data=data) + def remove_user(self, user_id): + endpoint = 'users/{}'.format(user_id) + return self._call_endpoint('DELETE', endpoint) + + # Deprecated def enable_user(self, user_id): endpoint = 'users/{}/enable'.format(user_id) @@ -463,6 +468,13 @@ def get_status(self): return self._call_endpoint('GET', endpoint) + def get_credits(self): + endpoint = 'management/credits' + + return self._call_endpoint('GET', endpoint) + + + # Deprecated def get_usage(self): endpoint = 'management/usage'