Skip to content

Commit 8211fa8

Browse files
authored
Merge pull request #32 from DLTADragonHawk/master
Fields Query Parameter & Info API Endpoint
2 parents 50cf0fb + af1d652 commit 8211fa8

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

connectpyse/cw_controller.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ def __init__(self, url=None, auth=None, ensure_ascii=None):
1414
self.customfieldconditions = ''
1515
self.page = ''
1616
self.pageSize = ''
17+
self.fields = ''
1718
self.API_URL = url if url is not None else API_URL
1819
self.basic_auth = auth if auth is not None else basic_auth
1920
self.ensure_ascii = ensure_ascii if ensure_ascii is not None else ENSURE_ASCII
2021
super().__init__('{}/{}'.format(self.API_URL, self.module_url))
2122

2223
def _format_user_params(self):
2324
user_params = {}
24-
for param in ['conditions', 'orderBy', 'childconditions', 'customfieldconditions', 'page', 'pageSize', 'recordId', 'recordType']:
25+
for param in ['conditions', 'orderBy', 'childconditions', 'customfieldconditions', 'page', 'pageSize', 'recordId', 'recordType', 'fields']:
2526
if getattr(self, param) != '':
2627
user_params[param] = getattr(self, param)
2728
return user_params

connectpyse/system/info.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
class Info(CWModel):
55

66
def __init__(self, json_dict=None):
7-
self.version = None # (String)
7+
self.cloudRegion = None # (String)
88
self.isCloud = None # (Boolean)
9+
self.licenseBits = None # (list(dict))
10+
self.maxWorkFlowRecordsAllowed = None # Int
911
self.serverTimeZone = None # (String)
12+
self.version = None # (String)
13+
14+
1015

1116
# initialize object with json dict
1217
super().__init__(json_dict)

connectpyse/system/info_api.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from ..cw_controller import CWController
2+
# Class for /system/info
3+
from connectpyse.system import info
4+
5+
class InfoAPI(CWController):
6+
def __init__(self, **kwargs):
7+
"""
8+
*Fields attribute is not supported*
9+
"""
10+
self.module_url = 'system'
11+
self.module = 'info'
12+
self._class = info.Info
13+
super().__init__(**kwargs) # instance gets passed to parent object
14+
15+
16+
def get_info(self):
17+
an_instance = self._class(getattr(self, self.module).get(user_headers=self.basic_auth,
18+
user_params=self._format_user_params()))
19+
return an_instance
20+

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
long_description = f.read()
66

77
setup(name='connectpyse',
8-
version='0.7.1',
8+
version='0.7.3',
99
description='A ConnectWise API tool for the rest of us.',
1010
long_description=long_description,
1111
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)