Skip to content

Commit

Permalink
Added Remove User, Get Credits Endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
nnayudu committed Dec 17, 2020
1 parent 10a942b commit d091f6f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setuptools.setup(
name="shrimpy_python",
version="0.0.12",
version="0.0.13",
author="ShrimpyOfficial",
author_email="[email protected]",
description="The Official Shrimpy API Python Client",
Expand Down
12 changes: 12 additions & 0 deletions shrimpy/shrimpy_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit d091f6f

Please sign in to comment.