brynq-sdk-salesforce 2.0.2__tar.gz → 3.0.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_salesforce
3
- Version: 2.0.2
3
+ Version: 3.0.0
4
4
  Summary: Salesforce wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -3,7 +3,7 @@ import urllib.parse
3
3
  import warnings
4
4
  import requests
5
5
  import json
6
- from typing import Union, List
6
+ from typing import Union, List, Literal, Optional
7
7
  import pandas as pd
8
8
  import os
9
9
 
@@ -13,22 +13,21 @@ class Salesforce(BrynQ):
13
13
  This class is meant to be a simple wrapper around the Salesforce API. In order to start using it, authorize your application is BrynQ.
14
14
  You will receive a code which you can use to obtain a refresh token using the get_refresh_token method. Use this refresh token to refresh your access token always before you make a data call.
15
15
  """
16
- def __init__(self, label: Union[str, List], debug: bool = False, sandbox: bool = False):
16
+ def __init__(self, system_type: Optional[Literal['source', 'target']] = None, debug: bool = False, sandbox: bool = False):
17
17
  super().__init__()
18
18
  if sandbox:
19
19
  self.system = 'salesforce-sandbox'
20
20
  else:
21
21
  self.system = 'salesforce'
22
- self.credentials = self.get_system_credential(system=self.system, label=label)
23
- self.credential_id = self.credentials['id']
24
- self.customer_url = self.credentials['auth']['instance_url']
22
+ credentials = self.interfaces.credentials.get(system=self.system, system_type=system_type)
23
+ self.credentials = credentials.get('data')
24
+ self.customer_url = self.credentials['instance_url']
25
25
  self.debug = debug
26
26
  self.api_version = 56.0
27
27
  self.timeout = 3600
28
28
 
29
29
  def __get_headers(self) -> dict:
30
- credentials = self.refresh_system_credential(system=self.system, system_id=self.credential_id)
31
- headers = {"Authorization": f"Bearer {credentials['access_token']}",
30
+ headers = {"Authorization": f"Bearer {self.credentials['access_token']}",
32
31
  "Content-Type": "application/json"}
33
32
  if self.debug:
34
33
  print(f"Headers: {headers}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-salesforce
3
- Version: 2.0.2
3
+ Version: 3.0.0
4
4
  Summary: Salesforce wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -1,4 +1,4 @@
1
- brynq-sdk-brynq>=2
1
+ brynq-sdk-brynq<5,>=4
2
2
  requests<=3,>=2
3
3
  pandas<3,>=1
4
4
  pyarrow>=10
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_salesforce',
5
- version='2.0.2',
5
+ version='3.0.0',
6
6
  description='Salesforce wrapper from BrynQ',
7
7
  long_description='Salesforce wrapper from BrynQ',
8
8
  author='BrynQ',
@@ -10,7 +10,7 @@ setup(
10
10
  packages=find_namespace_packages(include=['brynq_sdk*']),
11
11
  license='BrynQ License',
12
12
  install_requires=[
13
- 'brynq-sdk-brynq>=2',
13
+ 'brynq-sdk-brynq>=4,<5',
14
14
  'requests>=2,<=3',
15
15
  'pandas>=1,<3',
16
16
  'pyarrow>=10'