2016-11-30 17:01:44 +00:00
|
|
|
from app.notify_client import NotifyAdminAPIClient
|
2016-08-08 10:28:40 +01:00
|
|
|
|
|
|
|
|
|
2016-11-30 17:01:44 +00:00
|
|
|
class OrganisationsClient(NotifyAdminAPIClient):
|
2016-08-08 10:28:40 +01:00
|
|
|
|
2016-09-12 12:14:57 +01:00
|
|
|
def __init__(self):
|
2016-09-12 14:59:53 +01:00
|
|
|
super().__init__("a", "b", "c")
|
2016-08-08 10:28:40 +01:00
|
|
|
|
|
|
|
|
def init_app(self, app):
|
|
|
|
|
self.base_url = app.config['API_HOST_NAME']
|
2016-09-08 15:55:07 +01:00
|
|
|
self.service_id = app.config['ADMIN_CLIENT_USER_NAME']
|
|
|
|
|
self.api_key = app.config['ADMIN_CLIENT_SECRET']
|
2016-08-08 10:28:40 +01:00
|
|
|
|
2016-08-24 09:34:14 +01:00
|
|
|
def get_organisation(self, id):
|
|
|
|
|
return self.get(url='/organisation/{}'.format(id))
|
|
|
|
|
|
2016-08-08 10:28:40 +01:00
|
|
|
def get_organisations(self):
|
|
|
|
|
return self.get(url='/organisation')['organisations']
|