"""Api logic.""" from functools import partial from auth.models import grass def request(verb, resource, params=None, data=None, headers=None): """Fetch some data from our API. Args: verb (str): the http verb for the request. resource (str): the resource to use. params (dict): params for the request. data (dict): body of the request. headers (dict): optional headers. Returns: response.Response: the response of the request. """ return grass.request( verb, resource, params=params, data=data, headers=headers) get_authorization = partial(request, 'GET', '/users/auth/authorize') get_access_token = partial(request, 'POST', '/users/auth/token') login = partial(request, 'POST', '/users/auth/login')