brynq-sdk-vplan 1.2.1__tar.gz → 1.2.3__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.
Files changed (19) hide show
  1. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/PKG-INFO +1 -1
  2. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/__init__.py +1 -0
  3. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/activity.py +3 -3
  4. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/item.py +3 -3
  5. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/leave.py +4 -4
  6. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/order.py +3 -3
  7. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/project.py +3 -3
  8. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/resource.py +4 -4
  9. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/time_tracking.py +3 -3
  10. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/user.py +3 -3
  11. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/PKG-INFO +1 -1
  12. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/setup.py +1 -1
  13. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan/get_data.py +0 -0
  14. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/SOURCES.txt +0 -0
  15. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/dependency_links.txt +0 -0
  16. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/not-zip-safe +0 -0
  17. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/requires.txt +0 -0
  18. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/brynq_sdk_vplan.egg-info/top_level.txt +0 -0
  19. {brynq_sdk_vplan-1.2.1 → brynq_sdk_vplan-1.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_vplan
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: vPlan wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -29,6 +29,7 @@ class VPlan(BrynQ):
29
29
  self.time_tracking = TimeTracking(self)
30
30
  self.user = User(self)
31
31
  self.leave = Leave(self)
32
+ self.timeout = 3600
32
33
 
33
34
  def _get_credentials(self, label) -> dict:
34
35
  """
@@ -75,7 +75,7 @@ class Activity:
75
75
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
76
76
  base_body.update({"archive": data['archive']}) if 'archive' in data else base_body
77
77
 
78
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body)
78
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
79
79
  return response
80
80
 
81
81
  def update_activity(self, activity_id: str, data: dict) -> requests.Response:
@@ -106,7 +106,7 @@ class Activity:
106
106
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
107
107
  base_body.update({"archive": data['archive']}) if 'archive' in data else base_body
108
108
 
109
- response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body)
109
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body, timeout=self.vplan.timeout)
110
110
  return response
111
111
 
112
112
  def delete_activity(self, activity_id):
@@ -115,7 +115,7 @@ class Activity:
115
115
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
116
116
  """
117
117
  url = f"{self.vplan.base_url}activity/{activity_id}"
118
- response = requests.request('DELETE', url, headers=self.vplan.headers)
118
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
119
119
  return response
120
120
 
121
121
  @staticmethod
@@ -79,7 +79,7 @@ class Item:
79
79
  base_body.update({"note": data['note']}) if 'note' in data else base_body
80
80
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
81
81
 
82
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body)
82
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
83
83
  return response
84
84
 
85
85
  def update_item(self, item_id: str, data: dict) -> requests.Response:
@@ -114,7 +114,7 @@ class Item:
114
114
  base_body.update({"note": data['note']}) if 'note' in data else base_body
115
115
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
116
116
 
117
- response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
117
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
118
118
  return response
119
119
 
120
120
  def delete_item(self, item_id):
@@ -123,7 +123,7 @@ class Item:
123
123
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
124
124
  """
125
125
  url = f"{self.vplan.base_url}item/{item_id}"
126
- response = requests.request('DELETE', url, headers=self.vplan.headers)
126
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
127
127
  return response
128
128
 
129
129
 
@@ -26,7 +26,7 @@ class Leave:
26
26
  Returns: requests.Response: The response from the vPlan API.
27
27
  """
28
28
  url = f"{self.vplan.base_url}resource/{resource_id}/schedule_deviation"
29
- response = requests.request('GET', url, headers=self.vplan.headers)
29
+ response = requests.request('GET', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
30
30
  return response
31
31
 
32
32
  def post_leave(self, resource_id: str, data: dict) -> requests.Response:
@@ -53,7 +53,7 @@ class Leave:
53
53
  "start_date": data['start_date'],
54
54
  "end_date": data['end_date']
55
55
  })
56
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body)
56
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
57
57
  return response
58
58
 
59
59
  def update_leave(self, resource_id: str, leave_id: str, data: dict) -> requests.Response:
@@ -81,7 +81,7 @@ class Leave:
81
81
  "start_date": data['start_date'],
82
82
  "end_date": data['end_date']
83
83
  })
84
- response = requests.request('PUT', url, headers=self.vplan.post_headers, data=base_body)
84
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
85
85
  return response
86
86
 
87
87
  def delete_leave(self, resource_id: str, leave_id: str):
@@ -92,7 +92,7 @@ class Leave:
92
92
  :param leave_id: The id of the leave to delete
93
93
  """
94
94
  url = f"{self.vplan.base_url}resource/{resource_id}/schedule_deviation/{leave_id}"
95
- response = requests.request('DELETE', url, headers=self.vplan.headers)
95
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
96
96
  return response
97
97
 
98
98
 
@@ -92,7 +92,7 @@ class Order:
92
92
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
93
93
  base_body.update({"board_id": data['board_id']}) if 'board_id' in data else base_body
94
94
 
95
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
95
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
96
96
  return response
97
97
 
98
98
  def update_order(self, order_id: str, data: dict) -> requests.Response:
@@ -139,7 +139,7 @@ class Order:
139
139
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
140
140
  base_body.update({"board_id": data['board_id']}) if 'board_id' in data else base_body
141
141
 
142
- response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
142
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
143
143
  return response
144
144
 
145
145
  def delete_order(self, order_id):
@@ -148,7 +148,7 @@ class Order:
148
148
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
149
149
  """
150
150
  url = f"{self.vplan.base_url}order/{order_id}"
151
- response = requests.request('DELETE', url, headers=self.vplan.headers)
151
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
152
152
  return response
153
153
 
154
154
 
@@ -74,7 +74,7 @@ class Project:
74
74
  base_body.update({"description": data['description']}) if 'description' in data else base_body
75
75
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
76
76
 
77
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
77
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
78
78
  return response
79
79
 
80
80
  def update_project(self, project_id: str, data: dict) -> requests.Response:
@@ -103,7 +103,7 @@ class Project:
103
103
  base_body.update({"description": data['description']}) if 'description' in data else base_body
104
104
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
105
105
 
106
- response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
106
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
107
107
  return response
108
108
 
109
109
  def delete_project(self, project_id):
@@ -112,7 +112,7 @@ class Project:
112
112
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
113
113
  """
114
114
  url = f"{self.vplan.base_url}project/{project_id}"
115
- response = requests.request('DELETE', url, headers=self.vplan.headers)
115
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
116
116
  return response
117
117
 
118
118
  @staticmethod
@@ -71,7 +71,7 @@ class Resource:
71
71
  # Add fields that you want to update a dict (adding to body itself is too much text)
72
72
  base_body.update({"type": data['type']}) if 'type' in data else base_body
73
73
  base_body.update({"start_date": data['start_date']}) if 'start_date' in data else base_body
74
- base_body.update({"workdays": data['workdays']}) if 'workdays' in data else base_body
74
+ base_body.update({"workdays": eval(data['workdays'])}) if 'workdays' in data else base_body
75
75
  base_body.update({"description": data['description']}) if 'description' in data else base_body
76
76
  base_body.update({"end_date": data['end_date']}) if 'end_date' in data else base_body
77
77
  base_body.update({"integration_schedule": data['integration_schedule']}) if 'integration_schedule' in data else base_body
@@ -80,7 +80,7 @@ class Resource:
80
80
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
81
81
  base_body.update({"archive": data['archive']}) if 'archive' in data else base_body
82
82
 
83
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
83
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
84
84
  return response
85
85
 
86
86
  def update_resource(self, resource_id: str, data: dict) -> requests.Response:
@@ -116,7 +116,7 @@ class Resource:
116
116
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
117
117
  base_body.update({"archive": data['archive']}) if 'archive' in data else base_body
118
118
 
119
- response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body))
119
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, data=json.dumps(base_body), timeout=self.vplan.timeout)
120
120
  return response
121
121
 
122
122
  def delete_resource(self, resource_id):
@@ -125,7 +125,7 @@ class Resource:
125
125
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
126
126
  """
127
127
  url = f"{self.vplan.base_url}resource/{resource_id}"
128
- response = requests.request('DELETE', url, headers=self.vplan.headers)
128
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
129
129
  return response
130
130
 
131
131
  @staticmethod
@@ -82,7 +82,7 @@ class TimeTracking:
82
82
  base_body.update({"external_note": data['external_note']}) if 'external_note' in data else base_body
83
83
  base_body.update({"external_failed": data['external_failed']}) if 'external_failed' in data else base_body
84
84
 
85
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body)
85
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
86
86
  return response
87
87
 
88
88
  def update_time_tracking(self, time_tracking_id: str, data: dict) -> requests.Response:
@@ -117,7 +117,7 @@ class TimeTracking:
117
117
  base_body.update({"note": data['note']}) if 'note' in data else base_body
118
118
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
119
119
 
120
- response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body)
120
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body, timeout=self.vplan.timeout)
121
121
  return response
122
122
 
123
123
  def delete_time_tracking(self, time_tracking_id):
@@ -126,7 +126,7 @@ class TimeTracking:
126
126
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
127
127
  """
128
128
  url = f"{self.vplan.base_url}time_tracking/{time_tracking_id}"
129
- response = requests.request('DELETE', url, headers=self.vplan.headers)
129
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
130
130
  return response
131
131
 
132
132
 
@@ -79,7 +79,7 @@ class User:
79
79
  base_body.update({"note": data['note']}) if 'note' in data else base_body
80
80
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
81
81
 
82
- response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body)
82
+ response = requests.request('POST', url, headers=self.vplan.post_headers, data=base_body, timeout=self.vplan.timeout)
83
83
  return response
84
84
 
85
85
  def update_user(self, user_id: str, data: dict) -> requests.Response:
@@ -114,7 +114,7 @@ class User:
114
114
  base_body.update({"note": data['note']}) if 'note' in data else base_body
115
115
  base_body.update({"external_ref": data['external_ref']}) if 'external_ref' in data else base_body
116
116
 
117
- response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body)
117
+ response = requests.request('PUT', url, headers=self.vplan.post_headers, json=base_body, timeout=self.vplan.timeout)
118
118
  return response
119
119
 
120
120
  def delete_user(self, user_id):
@@ -123,7 +123,7 @@ class User:
123
123
  This method constructs a request URL based on the endpoint and sends a DELETE request to the vPlan API.
124
124
  """
125
125
  url = f"{self.vplan.base_url}user/{user_id}"
126
- response = requests.request('DELETE', url, headers=self.vplan.headers)
126
+ response = requests.request('DELETE', url, headers=self.vplan.headers, timeout=self.vplan.timeout)
127
127
  return response
128
128
 
129
129
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-vplan
3
- Version: 1.2.1
3
+ Version: 1.2.3
4
4
  Summary: vPlan 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_vplan',
5
- version='1.2.1',
5
+ version='1.2.3',
6
6
  description='vPlan wrapper from BrynQ',
7
7
  long_description='vPlan wrapper from BrynQ',
8
8
  author='BrynQ',