added gitignore
This commit is contained in:
parent
c56243589b
commit
e14328c68b
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
__pycache__
|
||||
@ -2,27 +2,6 @@ import requests
|
||||
|
||||
class InvoiceNinja(object):
|
||||
API_V1 = 'api/v1'
|
||||
ENDPOINT_URLS = {
|
||||
'clients': 'clients',
|
||||
'products': 'products',
|
||||
'invoices': 'invoices',
|
||||
'recurring invoices': 'recurring_invoices',
|
||||
'payments': 'payments',
|
||||
'quotes': 'quotes',
|
||||
'credits': 'credits',
|
||||
'reports': 'reports',
|
||||
'activities': 'activities',
|
||||
'charts': 'charts',
|
||||
'companies': 'companies',
|
||||
'documents': 'documents',
|
||||
'emails': 'emails',
|
||||
'expense': 'expenses',
|
||||
'export': 'export',
|
||||
'import': 'import_json',
|
||||
'ping': 'ping',
|
||||
'health check': 'health_check',
|
||||
'users': 'users'
|
||||
}
|
||||
|
||||
def __init__(self,
|
||||
endpoint_url: str = 'https://invoicing.co',
|
||||
@ -31,19 +10,17 @@ class InvoiceNinja(object):
|
||||
self.api_token = api_token
|
||||
self.headers = dict()
|
||||
|
||||
def _get_url_for(self, endpoint: str = 'ping'):
|
||||
'''
|
||||
Get complete URL for an endpoint.
|
||||
def set_url(url: str):
|
||||
self.endpoint_url = url
|
||||
|
||||
Endpoint URLs are appended to the Invoice Ninja base URL
|
||||
and returned.
|
||||
'''
|
||||
if endpoint in self.ENDPOINT_URLS:
|
||||
return '{}/{}'.format(self.endpoint_url,
|
||||
self.ENDPOINT_URLS[endpoint])
|
||||
def get_url():
|
||||
return self.endpoint_url
|
||||
|
||||
else:
|
||||
raise KeyError('Endpoint URL not found')
|
||||
def set_token(token: str):
|
||||
self.api_token = token
|
||||
|
||||
def get_token():
|
||||
return self.api_token
|
||||
|
||||
#def _get_headers(self, headers: dict = dict()):
|
||||
def build_headers(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user