brynq-sdk-salesforce 2.0.1__tar.gz → 2.0.2__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.1
3
+ Version: 2.0.2
4
4
  Summary: Salesforce wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -24,6 +24,7 @@ class Salesforce(BrynQ):
24
24
  self.customer_url = self.credentials['auth']['instance_url']
25
25
  self.debug = debug
26
26
  self.api_version = 56.0
27
+ self.timeout = 3600
27
28
 
28
29
  def __get_headers(self) -> dict:
29
30
  credentials = self.refresh_system_credential(system=self.system, system_id=self.credential_id)
@@ -50,7 +51,7 @@ class Salesforce(BrynQ):
50
51
  done = False
51
52
  url = f"{self.customer_url}/services/data/v37.0/query/?"
52
53
  while done is False:
53
- response = requests.get(url=url, params=params_str, headers=self.__get_headers())
54
+ response = requests.get(url=url, params=params_str, headers=self.__get_headers(), timeout=self.timeout)
54
55
  response.raise_for_status()
55
56
  response = response.json()
56
57
  done = response['done']
@@ -79,7 +80,7 @@ class Salesforce(BrynQ):
79
80
  done = False
80
81
  url = f"{self.customer_url}/services/data/v37.0/query/?"
81
82
  while done is False:
82
- response = requests.get(url=url, params=params_str, headers=self.__get_headers())
83
+ response = requests.get(url=url, params=params_str, headers=self.__get_headers(), timeout=self.timeout)
83
84
  response.raise_for_status()
84
85
  response = response.json()
85
86
  done = response['done']
@@ -119,7 +120,7 @@ class Salesforce(BrynQ):
119
120
  if self.debug:
120
121
  print(f"Payload: {body}")
121
122
 
122
- response = requests.post(url=f"{self.customer_url}/services/data/v37.0/sobjects/Contact", data=body, headers=self.__get_headers())
123
+ response = requests.post(url=f"{self.customer_url}/services/data/v37.0/sobjects/Contact", data=body, headers=self.__get_headers(), timeout=self.timeout)
123
124
  response.raise_for_status()
124
125
  if self.debug:
125
126
  print(f"Response: {response.content, response.text}")
@@ -156,7 +157,7 @@ class Salesforce(BrynQ):
156
157
  if self.debug:
157
158
  print(f"Payload: {body}")
158
159
 
159
- response = requests.patch(url=f"{self.customer_url}/services/data/v37.0/sobjects/Contact/{data['contact_id']}", data=body, headers=self.__get_headers())
160
+ response = requests.patch(url=f"{self.customer_url}/services/data/v37.0/sobjects/Contact/{data['contact_id']}", data=body, headers=self.__get_headers(), timeout=self.timeout)
160
161
  response.raise_for_status()
161
162
  if self.debug:
162
163
  print(f"Response: {response.content, response.text}")
@@ -181,7 +182,7 @@ class Salesforce(BrynQ):
181
182
  :return: data or error
182
183
  """
183
184
  url = f"{self.customer_url}/services/data/v{self.api_version}/sobjects/{table}/describe/"
184
- response = requests.get(url, headers=self.__get_headers())
185
+ response = requests.get(url, headers=self.__get_headers(), timeout=self.timeout)
185
186
  return response
186
187
 
187
188
  def query_table(self, data_dir: str, table: str, fields: Union[str, List], filter: str = None, filename: str = None) -> pd.DataFrame:
@@ -262,7 +263,7 @@ class Salesforce(BrynQ):
262
263
 
263
264
  # With the created URL and parameters, call the API
264
265
  while not done:
265
- response = requests.get(url=url, params=params_str, headers=self.__get_headers())
266
+ response = requests.get(url=url, params=params_str, headers=self.__get_headers(), timeout=self.timeout)
266
267
  response.raise_for_status()
267
268
  done = response.json()['done']
268
269
  df_temp = pd.DataFrame(response.json()['records'])
@@ -287,7 +288,7 @@ class Salesforce(BrynQ):
287
288
  df_del = pd.DataFrame()
288
289
  url = f'{self.customer_url}/services/data/v{self.api_version}/queryAll/?'
289
290
  while done is False:
290
- response = requests.get(url=url, params=params_str, headers=self.__get_headers())
291
+ response = requests.get(url=url, params=params_str, headers=self.__get_headers(), timeout=self.timeout)
291
292
  response.raise_for_status()
292
293
  done = response.json()['done']
293
294
  df_temp = pd.DataFrame(response.json()['records'])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-salesforce
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Salesforce wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -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.1',
5
+ version='2.0.2',
6
6
  description='Salesforce wrapper from BrynQ',
7
7
  long_description='Salesforce wrapper from BrynQ',
8
8
  author='BrynQ',