brynq-sdk-bob 2.8.5__py3-none-any.whl → 2.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
brynq_sdk_bob/__init__.py CHANGED
@@ -21,8 +21,9 @@ class Bob(BrynQ):
21
21
  def __init__(self, system_type: Optional[Literal['source', 'target']] = None, test_environment: bool = True, debug: bool = False, target_system: str = None):
22
22
  super().__init__()
23
23
  self.timeout = 3600
24
+ self.test_environment = test_environment
24
25
  self.headers = self._get_request_headers(system_type)
25
- if test_environment:
26
+ if self.test_environment:
26
27
  self.base_url = "https://api.sandbox.hibob.com/v1/"
27
28
  else:
28
29
  self.base_url = "https://api.hibob.com/v1/"
@@ -46,6 +47,15 @@ class Bob(BrynQ):
46
47
 
47
48
  def _get_request_headers(self, system_type):
48
49
  credentials = self.interfaces.credentials.get(system='bob', system_type=system_type)
50
+ # multiple creds possible, not fetched by environment test status, get first occurence
51
+ if isinstance(credentials, list):
52
+ credentials = next(
53
+ (
54
+ element for element in credentials
55
+ if element.get('data', {}).get('Test Environment') == self.test_environment
56
+ ),
57
+ credentials[0]
58
+ )
49
59
  auth_token = base64.b64encode(f"{credentials.get('data').get('User ID')}:{credentials.get('data').get('API Token')}".encode()).decode('utf-8')
50
60
  headers = {
51
61
  "accept": "application/json",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: brynq_sdk_bob
3
- Version: 2.8.5
3
+ Version: 2.9.0
4
4
  Summary: Bob wrapper from BrynQ
5
5
  Author: BrynQ
6
6
  Author-email: support@brynq.com
@@ -1,4 +1,4 @@
1
- brynq_sdk_bob/__init__.py,sha256=M2y-juQ-GgzglQa0HvbWmeA9fBzv5L3MShHbTfb9rsk,3014
1
+ brynq_sdk_bob/__init__.py,sha256=AFIEA5akwZqu-USQbMt26Rp8krqumvOsG1J83jhMQSg,3470
2
2
  brynq_sdk_bob/bank.py,sha256=zTdfe_qCZt2FB7SZbQ7njIDspwTinLFdbeH_xUby2FY,966
3
3
  brynq_sdk_bob/company.py,sha256=rjOpkm0CZ1EeJ-jddBl36GrGKUQviC1ca1aUL2tl1_M,848
4
4
  brynq_sdk_bob/custom_tables.py,sha256=MvnR2mIcyK0rpwd0P7xV3BPIvCYQVEClBvo901GttPs,2642
@@ -23,7 +23,7 @@ brynq_sdk_bob/schemas/people.py,sha256=42BJVgJmT-h5kzuQl6iI7wZDSGNA0KTQQVIAqeeyH
23
23
  brynq_sdk_bob/schemas/salary.py,sha256=TSaM1g92y3oiDcUrfJW7ushgKZenI9xB6XW3kKuU0dE,4540
24
24
  brynq_sdk_bob/schemas/timeoff.py,sha256=gTYu_bNcfHrkTz4eIHCZ4WzgMTj2U4nI3X6JTzDovhk,12817
25
25
  brynq_sdk_bob/schemas/work.py,sha256=YgtBJ0WXJOq55bFlT_kY_IbHh0SlQEtaa0W8vms-xA4,3048
26
- brynq_sdk_bob-2.8.5.dist-info/METADATA,sha256=lf34rFTbsXhfWfTdBkdmjLHTvTzXXwUm6IYhuyW0sOY,371
27
- brynq_sdk_bob-2.8.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- brynq_sdk_bob-2.8.5.dist-info/top_level.txt,sha256=oGiWqOuAAiVoLIzGe6F-Lo4IJBYz5ftOwBft7HtPuoY,14
29
- brynq_sdk_bob-2.8.5.dist-info/RECORD,,
26
+ brynq_sdk_bob-2.9.0.dist-info/METADATA,sha256=aYpW-QeJZdjrvK9wfDMu3y228359XcZVyZLim7TNgc8,371
27
+ brynq_sdk_bob-2.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
+ brynq_sdk_bob-2.9.0.dist-info/top_level.txt,sha256=oGiWqOuAAiVoLIzGe6F-Lo4IJBYz5ftOwBft7HtPuoY,14
29
+ brynq_sdk_bob-2.9.0.dist-info/RECORD,,