fmconsult-utils-python-sdk 2.0.0__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.
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/PKG-INFO +1 -1
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/pyproject.toml +1 -1
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/http/api.py +35 -17
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult_utils_python_sdk.egg-info/PKG-INFO +1 -1
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/LICENSE +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/README.md +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/setup.cfg +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/auth/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/auth/decorator.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/auth/profile_builder.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/auth/token_manager.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/connection.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/application.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/base.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/city.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/country.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/database/models/state.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/decorators/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/decorators/auth.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/authorization.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/bad_request_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/conflict_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/forbidden_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/not_found_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/not_implemented_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/unauthorized_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/exceptions/unavailable_exception.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/http/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/__init__.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cast.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cnpj.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/configs.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cpf.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/date.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/enum.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/haversine.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/object.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/pagination.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/string.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/url.py +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult_utils_python_sdk.egg-info/SOURCES.txt +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult_utils_python_sdk.egg-info/dependency_links.txt +0 -0
- {fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult_utils_python_sdk.egg-info/top_level.txt +0 -0
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/http/api.py
RENAMED
|
@@ -7,6 +7,7 @@ from fmconsult.exceptions.unavailable_exception import UnavailableException
|
|
|
7
7
|
from fmconsult.exceptions.not_found_exception import NotFoundException
|
|
8
8
|
from fmconsult.exceptions.unauthorized_exception import UnauthorizedException
|
|
9
9
|
from fmconsult.exceptions.conflict_exception import ConflictException
|
|
10
|
+
from fmconsult.utils.configs import ConfigPropertiesHelper
|
|
10
11
|
|
|
11
12
|
class ContentType(Enum):
|
|
12
13
|
APPLICATION_JSON = 'application/json'
|
|
@@ -14,6 +15,14 @@ class ContentType(Enum):
|
|
|
14
15
|
|
|
15
16
|
class ApiBase(object):
|
|
16
17
|
def __init__(self, additional_headers=None):
|
|
18
|
+
# self.logging_level = None
|
|
19
|
+
# try:
|
|
20
|
+
# self.cph = ConfigPropertiesHelper()
|
|
21
|
+
# self.logging_level = self.cph.get_property_value('SELF', 'self.logging.level')
|
|
22
|
+
# except:
|
|
23
|
+
# logging.warning('Logging level not found in config file')
|
|
24
|
+
# pass
|
|
25
|
+
|
|
17
26
|
self.headers = {
|
|
18
27
|
'x-api-token': self.api_token
|
|
19
28
|
}
|
|
@@ -40,25 +49,30 @@ class ApiBase(object):
|
|
|
40
49
|
|
|
41
50
|
def call_request(self, http_method:HTTPMethod, request_url, params=None, payload=None, content_type:ContentType=ContentType.APPLICATION_JSON):
|
|
42
51
|
try:
|
|
43
|
-
|
|
44
|
-
logging.info(
|
|
52
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
53
|
+
# logging.info(f'{str(http_method).upper()} url:')
|
|
54
|
+
# logging.info(request_url)
|
|
45
55
|
|
|
46
56
|
self.headers['Content-Type'] = content_type.value
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
|
|
58
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
59
|
+
# logging.info(f'{str(http_method).upper()} headers:')
|
|
60
|
+
# logging.info(jsonpickle.encode(self.headers))
|
|
49
61
|
|
|
50
62
|
# Verifica se há parâmetros a serem enviados na URL
|
|
51
|
-
if not params is None:
|
|
52
|
-
|
|
53
|
-
|
|
63
|
+
# if not params is None:
|
|
64
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
65
|
+
# logging.info(f'{str(http_method).upper()} params:')
|
|
66
|
+
# logging.info(jsonpickle.encode(params))
|
|
54
67
|
|
|
55
68
|
# Log do payload (apenas se for POST ou PUT)
|
|
56
|
-
if not payload is None:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
# if not payload is None:
|
|
70
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
71
|
+
# logging.info(f'{str(http_method).upper()} payload:')
|
|
72
|
+
# if content_type == ContentType.APPLICATION_JSON:
|
|
73
|
+
# logging.info(jsonpickle.encode(payload))
|
|
74
|
+
# else:
|
|
75
|
+
# logging.info(payload)
|
|
62
76
|
|
|
63
77
|
# Configuração dos parâmetros para requisição
|
|
64
78
|
req_args = {
|
|
@@ -76,8 +90,9 @@ class ApiBase(object):
|
|
|
76
90
|
else:
|
|
77
91
|
req_args['data'] = payload
|
|
78
92
|
|
|
79
|
-
|
|
80
|
-
logging.info(
|
|
93
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
94
|
+
# logging.info(f'request args:')
|
|
95
|
+
# logging.info(req_args)
|
|
81
96
|
|
|
82
97
|
res = self.__make_request(req_args)
|
|
83
98
|
|
|
@@ -95,8 +110,11 @@ class ApiBase(object):
|
|
|
95
110
|
raise Exception(res.content)
|
|
96
111
|
|
|
97
112
|
res = res.content.decode('utf-8')
|
|
98
|
-
|
|
99
|
-
|
|
113
|
+
|
|
114
|
+
# if not(self.logging_level is None) and self.logging_level == 'DEBUG':
|
|
115
|
+
# logging.info(f'{str(http_method).upper()} response:')
|
|
116
|
+
# logging.info(jsonpickle.encode(res))
|
|
117
|
+
|
|
100
118
|
return res
|
|
101
119
|
except UnavailableException as e:
|
|
102
120
|
raise e
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/__init__.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/auth/__init__.py
RENAMED
|
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
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/http/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cast.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cnpj.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/configs.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/cpf.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/date.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/enum.py
RENAMED
|
File without changes
|
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/object.py
RENAMED
|
File without changes
|
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/string.py
RENAMED
|
File without changes
|
{fmconsult_utils_python_sdk-2.0.0 → fmconsult_utils_python_sdk-2.0.2}/src/fmconsult/utils/url.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|