mbu-dev-shared-components 0.0.33__tar.gz → 0.0.35__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.
- {mbu_dev_shared_components-0.0.33/mbu_dev_shared_components.egg-info → mbu_dev_shared_components-0.0.35}/PKG-INFO +1 -1
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/cases.py +9 -10
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/documents.py +5 -6
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/objects.py +13 -10
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35/mbu_dev_shared_components.egg-info}/PKG-INFO +1 -1
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/.gitignore +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/LICENSE +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/README.md +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/office365/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/office365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/office365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/office365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/office365/sharepoint_api/files.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/sap/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components.egg-info/requires.txt +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/pyproject.toml +0 -0
- {mbu_dev_shared_components-0.0.33 → mbu_dev_shared_components-0.0.35}/setup.cfg +0 -0
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"""This module has functions to do with case related calls
|
|
2
2
|
to the GetOrganized api."""
|
|
3
|
-
from typing import Dict, Any
|
|
4
3
|
import requests
|
|
5
4
|
from mbu_dev_shared_components.getorganized.auth import get_ntlm_go_api_credentials
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
def find_case_by_case_properties(case_data:
|
|
7
|
+
def find_case_by_case_properties(case_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
9
8
|
"""
|
|
10
9
|
Sends a POST request to search for cases based on specific case properties provided in `case_data`.
|
|
11
10
|
|
|
12
11
|
Parameters:
|
|
13
|
-
case_data (
|
|
12
|
+
case_data (str): A JSON string containing case properties to filter cases by in the API search.
|
|
14
13
|
api_endpoint (str): GetOrganized API endpoint.
|
|
15
14
|
api_username (str): The API username for GetOrganized API.
|
|
16
15
|
api_password (str): The API password for GetOrganized API.
|
|
@@ -22,17 +21,17 @@ def find_case_by_case_properties(case_data: Dict[str, Any], api_endpoint: str, a
|
|
|
22
21
|
requests.RequestException: If the HTTP request fails for any reason.
|
|
23
22
|
"""
|
|
24
23
|
headers = {"Content-Type": "application/json"}
|
|
25
|
-
response = requests.request(method='POST', url=api_endpoint, headers=headers,
|
|
24
|
+
response = requests.request(method='POST', url=api_endpoint, headers=headers, data=case_data, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
26
25
|
|
|
27
26
|
return response
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
def create_case_folder(case_data:
|
|
29
|
+
def create_case_folder(case_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
31
30
|
"""
|
|
32
31
|
Sends a POST request to create a new case folder with the provided `case_data`.
|
|
33
32
|
|
|
34
33
|
Parameters:
|
|
35
|
-
case_data (
|
|
34
|
+
case_data (str): A JSON string containing the data required to create a new case folder.
|
|
36
35
|
api_endpoint (str): GetOrganized API endpoint.
|
|
37
36
|
api_username (str): The API username for GetOrganized API.
|
|
38
37
|
api_password (str): The API password for GetOrganized API.
|
|
@@ -44,17 +43,17 @@ def create_case_folder(case_data: Dict[str, Any], api_endpoint: str, api_usernam
|
|
|
44
43
|
requests.RequestException: If the HTTP request fails for any reason.
|
|
45
44
|
"""
|
|
46
45
|
headers = {"Content-Type": "application/json"}
|
|
47
|
-
response = requests.request(method='POST', url=api_endpoint, headers=headers,
|
|
46
|
+
response = requests.request(method='POST', url=api_endpoint, headers=headers, data=case_data, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
48
47
|
|
|
49
48
|
return response
|
|
50
49
|
|
|
51
50
|
|
|
52
|
-
def create_case(case_data:
|
|
51
|
+
def create_case(case_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
53
52
|
"""
|
|
54
53
|
Sends a POST request to create a new case in the system with the specified `case_data`.
|
|
55
54
|
|
|
56
55
|
Parameters:
|
|
57
|
-
case_data (
|
|
56
|
+
case_data (str): A JSON string containing the data required to create a new case.
|
|
58
57
|
api_endpoint (str): GetOrganized API endpoint.
|
|
59
58
|
api_username (str): The API username for GetOrganized API.
|
|
60
59
|
api_password (str): The API password for GetOrganized API.
|
|
@@ -66,6 +65,6 @@ def create_case(case_data: Dict[str, Any], api_endpoint: str, api_username: str,
|
|
|
66
65
|
requests.RequestException: If the HTTP request fails for any reason.
|
|
67
66
|
"""
|
|
68
67
|
headers = {"Content-Type": "application/json"}
|
|
69
|
-
response = requests.request(method='POST', url=api_endpoint, headers=headers,
|
|
68
|
+
response = requests.request(method='POST', url=api_endpoint, headers=headers, data=case_data, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
70
69
|
|
|
71
70
|
return response
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"""This module..."""
|
|
2
|
-
from typing import Dict, Any
|
|
3
2
|
import requests
|
|
4
3
|
from mbu_dev_shared_components.getorganized.auth import get_ntlm_go_api_credentials
|
|
5
4
|
|
|
6
5
|
|
|
7
|
-
def upload_file_to_case(file_data:
|
|
6
|
+
def upload_file_to_case(file_data: str, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
8
7
|
"""
|
|
9
8
|
Uploads a file to a case by sending file data as a JSON payload to a specific API endpoint.
|
|
10
9
|
The function uses NTLM authentication and expects an environment variable for the API base URL.
|
|
11
10
|
|
|
12
11
|
Parameters:
|
|
13
|
-
file_data (
|
|
12
|
+
file_data (str): A JSON string containing file data and associated case information to be uploaded.
|
|
14
13
|
api_endpoint (str): GetOrganized API endpoint.
|
|
15
14
|
api_username (str): The API username for GetOrganized API.
|
|
16
15
|
api_password (str): The API password for GetOrganized API.
|
|
@@ -22,12 +21,12 @@ def upload_file_to_case(file_data: Dict[str, Any], api_endpoint: str, api_userna
|
|
|
22
21
|
requests.RequestException: If the HTTP request fails for any reason.
|
|
23
22
|
"""
|
|
24
23
|
headers = {'Content-Type': 'application/json'}
|
|
25
|
-
response = requests.request(method='POST', url=api_endpoint, headers=headers,
|
|
24
|
+
response = requests.request(method='POST', url=api_endpoint, headers=headers, data=file_data, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
26
25
|
|
|
27
26
|
return response
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
def mark_file_as_case_record(documents_id: list, api_endpoint: str, api_username: str, api_password: str) ->
|
|
29
|
+
def mark_file_as_case_record(documents_id: list, api_endpoint: str, api_username: str, api_password: str) -> requests.Response:
|
|
31
30
|
"""
|
|
32
31
|
Marks one or more documents by their IDs as case records in the system via a POST request to a specific API endpoint.
|
|
33
32
|
This operation modifies the status of the documents to reflect their new role as official case records.
|
|
@@ -50,4 +49,4 @@ def mark_file_as_case_record(documents_id: list, api_endpoint: str, api_username
|
|
|
50
49
|
print(payload)
|
|
51
50
|
response = requests.request(method='POST', url=api_endpoint, headers=headers, json=payload, auth=get_ntlm_go_api_credentials(api_username, api_password), timeout=60)
|
|
52
51
|
|
|
53
|
-
return response
|
|
52
|
+
return response
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
"""
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"""
|
|
2
|
+
This module contains classes relating data to be used in API requests to
|
|
3
|
+
GetOrganized when working with cases and documents.
|
|
4
|
+
"""
|
|
4
5
|
import dataclasses
|
|
5
6
|
from typing import Literal
|
|
6
7
|
|
|
@@ -24,14 +25,14 @@ class CaseDataJson:
|
|
|
24
25
|
return_when_case_fully_created (bool): A flag indicating whether to wait for the case to be fully created before returning.
|
|
25
26
|
|
|
26
27
|
Returns:
|
|
27
|
-
|
|
28
|
+
dict: A dictionary representing the case data in JSON format.
|
|
28
29
|
"""
|
|
29
30
|
case_data = {
|
|
30
31
|
"CaseTypePrefix": case_type_prefix,
|
|
31
32
|
"MetadataXml": metadata_xml,
|
|
32
33
|
"ReturnWhenCaseFullyCreated": return_when_case_fully_created
|
|
33
34
|
}
|
|
34
|
-
return
|
|
35
|
+
return case_data
|
|
35
36
|
|
|
36
37
|
def search_case_folder_data_json(self, case_type_prefix: CaseTypePrefix, person_full_name: str, person_id: str, person_ssn: str) -> str:
|
|
37
38
|
"""
|
|
@@ -39,10 +40,12 @@ class CaseDataJson:
|
|
|
39
40
|
|
|
40
41
|
Parameters:
|
|
41
42
|
case_type_prefix (CaseTypePrefix): The prefix indicating the type of the case. Must be one of the predefined literal values.
|
|
42
|
-
|
|
43
|
+
person_full_name (str): The full name of the person associated with the case.
|
|
44
|
+
person_id (str): The ID of the person associated with the case.
|
|
45
|
+
person_ssn (str): The Social Security Number of the person associated with the case.
|
|
43
46
|
|
|
44
47
|
Returns:
|
|
45
|
-
|
|
48
|
+
dict: A dictionary representing the search criteria for the case folder in JSON format.
|
|
46
49
|
"""
|
|
47
50
|
search_case_folder_data = {
|
|
48
51
|
"FieldProperties": [
|
|
@@ -68,7 +71,7 @@ class CaseDataJson:
|
|
|
68
71
|
"ExcludeDeletedCases": "True",
|
|
69
72
|
"ReturnCasesNumber": "1"
|
|
70
73
|
}
|
|
71
|
-
return
|
|
74
|
+
return search_case_folder_data
|
|
72
75
|
|
|
73
76
|
|
|
74
77
|
@dataclasses.dataclass
|
|
@@ -93,7 +96,7 @@ class DocumentJsonCreator:
|
|
|
93
96
|
data_in_bytes (bytes): The binary data of the file being represented.
|
|
94
97
|
|
|
95
98
|
Returns:
|
|
96
|
-
|
|
99
|
+
dict: A dictionary representing the document data in JSON format.
|
|
97
100
|
"""
|
|
98
101
|
document_data = {
|
|
99
102
|
"CaseId": case_id,
|
|
@@ -104,4 +107,4 @@ class DocumentJsonCreator:
|
|
|
104
107
|
"Overwrite": overwrite,
|
|
105
108
|
"Bytes": data_in_bytes
|
|
106
109
|
}
|
|
107
|
-
return
|
|
110
|
+
return document_data
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|