maleo-metadata-client 0.0.14__py3-none-any.whl → 0.0.22__py3-none-any.whl
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.
Potentially problematic release.
This version of maleo-metadata-client might be problematic. Click here for more details.
- maleo/metadata/client/manager.py +9 -0
- maleo/metadata/client/services/blood_type.py +25 -25
- maleo/metadata/client/services/gender.py +25 -25
- maleo/metadata/client/services/medical_role.py +35 -35
- maleo/metadata/client/services/medical_service.py +25 -25
- maleo/metadata/client/services/organization_role.py +304 -0
- maleo/metadata/client/services/organization_type.py +25 -27
- maleo/metadata/client/services/service.py +25 -25
- maleo/metadata/client/services/system_role.py +25 -25
- maleo/metadata/client/services/user_type.py +25 -25
- {maleo_metadata_client-0.0.14.dist-info → maleo_metadata_client-0.0.22.dist-info}/METADATA +36 -36
- maleo_metadata_client-0.0.22.dist-info/RECORD +17 -0
- maleo_metadata_client-0.0.14.dist-info/RECORD +0 -16
- {maleo_metadata_client-0.0.14.dist-info → maleo_metadata_client-0.0.22.dist-info}/WHEEL +0 -0
- {maleo_metadata_client-0.0.14.dist-info → maleo_metadata_client-0.0.22.dist-info}/licenses/LICENSE +0 -0
- {maleo_metadata_client-0.0.14.dist-info → maleo_metadata_client-0.0.22.dist-info}/top_level.txt +0 -0
maleo/metadata/client/manager.py
CHANGED
|
@@ -4,6 +4,7 @@ from .services.blood_type import BloodTypeClientService
|
|
|
4
4
|
from .services.gender import GenderClientService
|
|
5
5
|
from .services.medical_role import MedicalRoleClientService
|
|
6
6
|
from .services.medical_service import MedicalServiceClientService
|
|
7
|
+
from .services.organization_role import OrganizationRoleClientService
|
|
7
8
|
from .services.organization_type import OrganizationTypeClientService
|
|
8
9
|
from .services.service import ServiceClientService
|
|
9
10
|
from .services.system_role import SystemRoleClientService
|
|
@@ -44,6 +45,14 @@ class MaleoMetadataClientManager(MaleoClientManager[MaleoMetadataClientConfig]):
|
|
|
44
45
|
private_key=self._private_key,
|
|
45
46
|
redis=self._redis,
|
|
46
47
|
)
|
|
48
|
+
self.organization_role = OrganizationRoleClientService(
|
|
49
|
+
application_context=self._application_context,
|
|
50
|
+
config=self._config,
|
|
51
|
+
logger=self._logger,
|
|
52
|
+
http_client_manager=self._http_client_manager,
|
|
53
|
+
private_key=self._private_key,
|
|
54
|
+
redis=self._redis,
|
|
55
|
+
)
|
|
47
56
|
self.organization_type = OrganizationTypeClientService(
|
|
48
57
|
application_context=self._application_context,
|
|
49
58
|
config=self._config,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from copy import deepcopy
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
|
-
from typing import Literal,
|
|
4
|
+
from typing import Literal, overload
|
|
5
5
|
from uuid import UUID
|
|
6
6
|
from maleo.client.maleo.config import MaleoMetadataClientConfig
|
|
7
7
|
from maleo.client.maleo.service import MaleoClientService
|
|
@@ -36,12 +36,12 @@ from maleo.schemas.response import (
|
|
|
36
36
|
ReadSingleDataResponse,
|
|
37
37
|
)
|
|
38
38
|
from maleo.schemas.security.authorization import (
|
|
39
|
-
|
|
39
|
+
OptAnyAuthorization,
|
|
40
40
|
AnyAuthorization,
|
|
41
41
|
Factory as AuthorizationFactory,
|
|
42
42
|
)
|
|
43
|
-
from maleo.schemas.security.impersonation import
|
|
44
|
-
from maleo.types.dict import
|
|
43
|
+
from maleo.schemas.security.impersonation import OptImpersonation
|
|
44
|
+
from maleo.types.dict import OptStrToStrDict
|
|
45
45
|
from maleo.utils.merger import merge_dicts
|
|
46
46
|
|
|
47
47
|
|
|
@@ -58,9 +58,9 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
58
58
|
resource_operation_action: ReadResourceOperationAction,
|
|
59
59
|
connection_context: ConnectionContext,
|
|
60
60
|
authorization: AnyAuthorization,
|
|
61
|
-
impersonation:
|
|
61
|
+
impersonation: OptImpersonation = None,
|
|
62
62
|
parameters: ReadMultipleParameter,
|
|
63
|
-
headers:
|
|
63
|
+
headers: OptStrToStrDict = None,
|
|
64
64
|
) -> ReadMultipleDataResponse[StandardBloodTypeSchema, StrictPagination, None]: ...
|
|
65
65
|
@overload
|
|
66
66
|
async def read(
|
|
@@ -72,9 +72,9 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
72
72
|
resource_operation_action: ReadResourceOperationAction,
|
|
73
73
|
connection_context: ConnectionContext,
|
|
74
74
|
authorization: AnyAuthorization,
|
|
75
|
-
impersonation:
|
|
75
|
+
impersonation: OptImpersonation = None,
|
|
76
76
|
parameters: ReadMultipleParameter,
|
|
77
|
-
headers:
|
|
77
|
+
headers: OptStrToStrDict = None,
|
|
78
78
|
) -> ReadMultipleDataResponse[FullBloodTypeSchema, StrictPagination, None]: ...
|
|
79
79
|
@overload
|
|
80
80
|
async def read(
|
|
@@ -86,9 +86,9 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
86
86
|
resource_operation_action: ReadResourceOperationAction,
|
|
87
87
|
connection_context: ConnectionContext,
|
|
88
88
|
authorization: AnyAuthorization,
|
|
89
|
-
impersonation:
|
|
89
|
+
impersonation: OptImpersonation = None,
|
|
90
90
|
parameters: ReadSingleParameter,
|
|
91
|
-
headers:
|
|
91
|
+
headers: OptStrToStrDict = None,
|
|
92
92
|
) -> ReadSingleDataResponse[StandardBloodTypeSchema, None]: ...
|
|
93
93
|
@overload
|
|
94
94
|
async def read(
|
|
@@ -100,9 +100,9 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
100
100
|
resource_operation_action: ReadResourceOperationAction,
|
|
101
101
|
connection_context: ConnectionContext,
|
|
102
102
|
authorization: AnyAuthorization,
|
|
103
|
-
impersonation:
|
|
103
|
+
impersonation: OptImpersonation = None,
|
|
104
104
|
parameters: ReadSingleParameter,
|
|
105
|
-
headers:
|
|
105
|
+
headers: OptStrToStrDict = None,
|
|
106
106
|
) -> ReadSingleDataResponse[FullBloodTypeSchema, None]: ...
|
|
107
107
|
async def read(
|
|
108
108
|
self,
|
|
@@ -112,16 +112,16 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
112
112
|
operation_id: UUID,
|
|
113
113
|
resource_operation_action: ReadResourceOperationAction,
|
|
114
114
|
connection_context: ConnectionContext,
|
|
115
|
-
authorization:
|
|
116
|
-
impersonation:
|
|
117
|
-
parameters:
|
|
118
|
-
headers:
|
|
119
|
-
) ->
|
|
120
|
-
ReadMultipleDataResponse[StandardBloodTypeSchema, StrictPagination, None]
|
|
121
|
-
ReadMultipleDataResponse[FullBloodTypeSchema, StrictPagination, None]
|
|
122
|
-
ReadSingleDataResponse[StandardBloodTypeSchema, None]
|
|
123
|
-
ReadSingleDataResponse[FullBloodTypeSchema, None]
|
|
124
|
-
|
|
115
|
+
authorization: OptAnyAuthorization = None,
|
|
116
|
+
impersonation: OptImpersonation = None,
|
|
117
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
118
|
+
headers: OptStrToStrDict = None,
|
|
119
|
+
) -> (
|
|
120
|
+
ReadMultipleDataResponse[StandardBloodTypeSchema, StrictPagination, None]
|
|
121
|
+
| ReadMultipleDataResponse[FullBloodTypeSchema, StrictPagination, None]
|
|
122
|
+
| ReadSingleDataResponse[StandardBloodTypeSchema, None]
|
|
123
|
+
| ReadSingleDataResponse[FullBloodTypeSchema, None]
|
|
124
|
+
):
|
|
125
125
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
126
126
|
data_model_cls = get_schema_model(granularity)
|
|
127
127
|
|
|
@@ -226,10 +226,10 @@ class BloodTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
226
226
|
if isinstance(parameters, ReadMultipleParameter):
|
|
227
227
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
228
228
|
elif isinstance(parameters, ReadSingleParameter):
|
|
229
|
-
if parameters.
|
|
230
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
229
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
230
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
231
231
|
else:
|
|
232
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
232
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
233
233
|
|
|
234
234
|
params = parameters.to_query_params()
|
|
235
235
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from copy import deepcopy
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
|
-
from typing import Literal,
|
|
4
|
+
from typing import Literal, overload
|
|
5
5
|
from uuid import UUID
|
|
6
6
|
from maleo.client.maleo.config import MaleoMetadataClientConfig
|
|
7
7
|
from maleo.client.maleo.service import MaleoClientService
|
|
@@ -36,12 +36,12 @@ from maleo.schemas.response import (
|
|
|
36
36
|
ReadSingleDataResponse,
|
|
37
37
|
)
|
|
38
38
|
from maleo.schemas.security.authorization import (
|
|
39
|
-
|
|
39
|
+
OptAnyAuthorization,
|
|
40
40
|
AnyAuthorization,
|
|
41
41
|
Factory as AuthorizationFactory,
|
|
42
42
|
)
|
|
43
|
-
from maleo.schemas.security.impersonation import
|
|
44
|
-
from maleo.types.dict import
|
|
43
|
+
from maleo.schemas.security.impersonation import OptImpersonation
|
|
44
|
+
from maleo.types.dict import OptStrToStrDict
|
|
45
45
|
from maleo.utils.merger import merge_dicts
|
|
46
46
|
|
|
47
47
|
|
|
@@ -58,9 +58,9 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
58
58
|
resource_operation_action: ReadResourceOperationAction,
|
|
59
59
|
connection_context: ConnectionContext,
|
|
60
60
|
authorization: AnyAuthorization,
|
|
61
|
-
impersonation:
|
|
61
|
+
impersonation: OptImpersonation = None,
|
|
62
62
|
parameters: ReadMultipleParameter,
|
|
63
|
-
headers:
|
|
63
|
+
headers: OptStrToStrDict = None,
|
|
64
64
|
) -> ReadMultipleDataResponse[StandardGenderSchema, StrictPagination, None]: ...
|
|
65
65
|
@overload
|
|
66
66
|
async def read(
|
|
@@ -72,9 +72,9 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
72
72
|
resource_operation_action: ReadResourceOperationAction,
|
|
73
73
|
connection_context: ConnectionContext,
|
|
74
74
|
authorization: AnyAuthorization,
|
|
75
|
-
impersonation:
|
|
75
|
+
impersonation: OptImpersonation = None,
|
|
76
76
|
parameters: ReadMultipleParameter,
|
|
77
|
-
headers:
|
|
77
|
+
headers: OptStrToStrDict = None,
|
|
78
78
|
) -> ReadMultipleDataResponse[FullGenderSchema, StrictPagination, None]: ...
|
|
79
79
|
@overload
|
|
80
80
|
async def read(
|
|
@@ -86,9 +86,9 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
86
86
|
resource_operation_action: ReadResourceOperationAction,
|
|
87
87
|
connection_context: ConnectionContext,
|
|
88
88
|
authorization: AnyAuthorization,
|
|
89
|
-
impersonation:
|
|
89
|
+
impersonation: OptImpersonation = None,
|
|
90
90
|
parameters: ReadSingleParameter,
|
|
91
|
-
headers:
|
|
91
|
+
headers: OptStrToStrDict = None,
|
|
92
92
|
) -> ReadSingleDataResponse[StandardGenderSchema, None]: ...
|
|
93
93
|
@overload
|
|
94
94
|
async def read(
|
|
@@ -100,9 +100,9 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
100
100
|
resource_operation_action: ReadResourceOperationAction,
|
|
101
101
|
connection_context: ConnectionContext,
|
|
102
102
|
authorization: AnyAuthorization,
|
|
103
|
-
impersonation:
|
|
103
|
+
impersonation: OptImpersonation = None,
|
|
104
104
|
parameters: ReadSingleParameter,
|
|
105
|
-
headers:
|
|
105
|
+
headers: OptStrToStrDict = None,
|
|
106
106
|
) -> ReadSingleDataResponse[FullGenderSchema, None]: ...
|
|
107
107
|
async def read(
|
|
108
108
|
self,
|
|
@@ -112,16 +112,16 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
112
112
|
operation_id: UUID,
|
|
113
113
|
resource_operation_action: ReadResourceOperationAction,
|
|
114
114
|
connection_context: ConnectionContext,
|
|
115
|
-
authorization:
|
|
116
|
-
impersonation:
|
|
117
|
-
parameters:
|
|
118
|
-
headers:
|
|
119
|
-
) ->
|
|
120
|
-
ReadMultipleDataResponse[StandardGenderSchema, StrictPagination, None]
|
|
121
|
-
ReadMultipleDataResponse[FullGenderSchema, StrictPagination, None]
|
|
122
|
-
ReadSingleDataResponse[StandardGenderSchema, None]
|
|
123
|
-
ReadSingleDataResponse[FullGenderSchema, None]
|
|
124
|
-
|
|
115
|
+
authorization: OptAnyAuthorization = None,
|
|
116
|
+
impersonation: OptImpersonation = None,
|
|
117
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
118
|
+
headers: OptStrToStrDict = None,
|
|
119
|
+
) -> (
|
|
120
|
+
ReadMultipleDataResponse[StandardGenderSchema, StrictPagination, None]
|
|
121
|
+
| ReadMultipleDataResponse[FullGenderSchema, StrictPagination, None]
|
|
122
|
+
| ReadSingleDataResponse[StandardGenderSchema, None]
|
|
123
|
+
| ReadSingleDataResponse[FullGenderSchema, None]
|
|
124
|
+
):
|
|
125
125
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
126
126
|
data_model_cls = get_schema_model(granularity)
|
|
127
127
|
|
|
@@ -226,10 +226,10 @@ class GenderClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
226
226
|
if isinstance(parameters, ReadMultipleParameter):
|
|
227
227
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
228
228
|
elif isinstance(parameters, ReadSingleParameter):
|
|
229
|
-
if parameters.
|
|
230
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
229
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
230
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
231
231
|
else:
|
|
232
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
232
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
233
233
|
|
|
234
234
|
params = parameters.to_query_params()
|
|
235
235
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from copy import deepcopy
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
|
-
from typing import Literal,
|
|
4
|
+
from typing import Literal, overload
|
|
5
5
|
from uuid import UUID
|
|
6
6
|
from maleo.client.maleo.config import MaleoMetadataClientConfig
|
|
7
7
|
from maleo.client.maleo.service import MaleoClientService
|
|
@@ -37,13 +37,13 @@ from maleo.schemas.response import (
|
|
|
37
37
|
ReadSingleDataResponse,
|
|
38
38
|
)
|
|
39
39
|
from maleo.schemas.security.authorization import (
|
|
40
|
-
|
|
40
|
+
OptAnyAuthorization,
|
|
41
41
|
AnyAuthorization,
|
|
42
42
|
Factory as AuthorizationFactory,
|
|
43
43
|
)
|
|
44
|
-
from maleo.schemas.security.impersonation import
|
|
45
|
-
from maleo.types.dict import
|
|
46
|
-
from maleo.types.integer import
|
|
44
|
+
from maleo.schemas.security.impersonation import OptImpersonation
|
|
45
|
+
from maleo.types.dict import OptStrToStrDict
|
|
46
|
+
from maleo.types.integer import OptInt
|
|
47
47
|
from maleo.utils.merger import merge_dicts
|
|
48
48
|
|
|
49
49
|
|
|
@@ -61,9 +61,9 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
61
61
|
resource_operation_action: ReadResourceOperationAction,
|
|
62
62
|
connection_context: ConnectionContext,
|
|
63
63
|
authorization: AnyAuthorization,
|
|
64
|
-
impersonation:
|
|
64
|
+
impersonation: OptImpersonation = None,
|
|
65
65
|
parameters: ReadMultipleSpecializationsParameter,
|
|
66
|
-
headers:
|
|
66
|
+
headers: OptStrToStrDict = None,
|
|
67
67
|
) -> ReadMultipleDataResponse[
|
|
68
68
|
StandardMedicalRoleSchema, StrictPagination, None
|
|
69
69
|
]: ...
|
|
@@ -78,9 +78,9 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
78
78
|
resource_operation_action: ReadResourceOperationAction,
|
|
79
79
|
connection_context: ConnectionContext,
|
|
80
80
|
authorization: AnyAuthorization,
|
|
81
|
-
impersonation:
|
|
81
|
+
impersonation: OptImpersonation = None,
|
|
82
82
|
parameters: ReadMultipleSpecializationsParameter,
|
|
83
|
-
headers:
|
|
83
|
+
headers: OptStrToStrDict = None,
|
|
84
84
|
) -> ReadMultipleDataResponse[FullMedicalRoleSchema, StrictPagination, None]: ...
|
|
85
85
|
@overload
|
|
86
86
|
async def read(
|
|
@@ -92,9 +92,9 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
92
92
|
resource_operation_action: ReadResourceOperationAction,
|
|
93
93
|
connection_context: ConnectionContext,
|
|
94
94
|
authorization: AnyAuthorization,
|
|
95
|
-
impersonation:
|
|
95
|
+
impersonation: OptImpersonation = None,
|
|
96
96
|
parameters: ReadMultipleParameter,
|
|
97
|
-
headers:
|
|
97
|
+
headers: OptStrToStrDict = None,
|
|
98
98
|
) -> ReadMultipleDataResponse[
|
|
99
99
|
StandardMedicalRoleSchema, StrictPagination, None
|
|
100
100
|
]: ...
|
|
@@ -108,9 +108,9 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
108
108
|
resource_operation_action: ReadResourceOperationAction,
|
|
109
109
|
connection_context: ConnectionContext,
|
|
110
110
|
authorization: AnyAuthorization,
|
|
111
|
-
impersonation:
|
|
111
|
+
impersonation: OptImpersonation = None,
|
|
112
112
|
parameters: ReadMultipleParameter,
|
|
113
|
-
headers:
|
|
113
|
+
headers: OptStrToStrDict = None,
|
|
114
114
|
) -> ReadMultipleDataResponse[FullMedicalRoleSchema, StrictPagination, None]: ...
|
|
115
115
|
@overload
|
|
116
116
|
async def read(
|
|
@@ -122,9 +122,9 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
122
122
|
resource_operation_action: ReadResourceOperationAction,
|
|
123
123
|
connection_context: ConnectionContext,
|
|
124
124
|
authorization: AnyAuthorization,
|
|
125
|
-
impersonation:
|
|
125
|
+
impersonation: OptImpersonation = None,
|
|
126
126
|
parameters: ReadSingleParameter,
|
|
127
|
-
headers:
|
|
127
|
+
headers: OptStrToStrDict = None,
|
|
128
128
|
) -> ReadSingleDataResponse[StandardMedicalRoleSchema, None]: ...
|
|
129
129
|
@overload
|
|
130
130
|
async def read(
|
|
@@ -136,33 +136,33 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
136
136
|
resource_operation_action: ReadResourceOperationAction,
|
|
137
137
|
connection_context: ConnectionContext,
|
|
138
138
|
authorization: AnyAuthorization,
|
|
139
|
-
impersonation:
|
|
139
|
+
impersonation: OptImpersonation = None,
|
|
140
140
|
parameters: ReadSingleParameter,
|
|
141
|
-
headers:
|
|
141
|
+
headers: OptStrToStrDict = None,
|
|
142
142
|
) -> ReadSingleDataResponse[FullMedicalRoleSchema, None]: ...
|
|
143
143
|
async def read(
|
|
144
144
|
self,
|
|
145
145
|
cardinality: Cardinality,
|
|
146
146
|
granularity: Granularity,
|
|
147
147
|
*,
|
|
148
|
-
parent_id:
|
|
148
|
+
parent_id: OptInt = None,
|
|
149
149
|
operation_id: UUID,
|
|
150
150
|
resource_operation_action: ReadResourceOperationAction,
|
|
151
151
|
connection_context: ConnectionContext,
|
|
152
|
-
authorization:
|
|
153
|
-
impersonation:
|
|
154
|
-
parameters:
|
|
155
|
-
ReadMultipleSpecializationsParameter
|
|
156
|
-
ReadMultipleParameter
|
|
157
|
-
ReadSingleParameter
|
|
158
|
-
|
|
159
|
-
headers:
|
|
160
|
-
) ->
|
|
161
|
-
ReadMultipleDataResponse[StandardMedicalRoleSchema, StrictPagination, None]
|
|
162
|
-
ReadMultipleDataResponse[FullMedicalRoleSchema, StrictPagination, None]
|
|
163
|
-
ReadSingleDataResponse[StandardMedicalRoleSchema, None]
|
|
164
|
-
ReadSingleDataResponse[FullMedicalRoleSchema, None]
|
|
165
|
-
|
|
152
|
+
authorization: OptAnyAuthorization = None,
|
|
153
|
+
impersonation: OptImpersonation = None,
|
|
154
|
+
parameters: (
|
|
155
|
+
ReadMultipleSpecializationsParameter
|
|
156
|
+
| ReadMultipleParameter
|
|
157
|
+
| ReadSingleParameter
|
|
158
|
+
),
|
|
159
|
+
headers: OptStrToStrDict = None,
|
|
160
|
+
) -> (
|
|
161
|
+
ReadMultipleDataResponse[StandardMedicalRoleSchema, StrictPagination, None]
|
|
162
|
+
| ReadMultipleDataResponse[FullMedicalRoleSchema, StrictPagination, None]
|
|
163
|
+
| ReadSingleDataResponse[StandardMedicalRoleSchema, None]
|
|
164
|
+
| ReadSingleDataResponse[FullMedicalRoleSchema, None]
|
|
165
|
+
):
|
|
166
166
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
167
167
|
data_model_cls = get_schema_model(granularity)
|
|
168
168
|
|
|
@@ -273,10 +273,10 @@ class MedicalRoleClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
273
273
|
elif isinstance(parameters, ReadMultipleParameter):
|
|
274
274
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
275
275
|
elif isinstance(parameters, ReadSingleParameter):
|
|
276
|
-
if parameters.
|
|
277
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
276
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
277
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
278
278
|
else:
|
|
279
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
279
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
280
280
|
|
|
281
281
|
params = parameters.to_query_params()
|
|
282
282
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from copy import deepcopy
|
|
3
3
|
from datetime import datetime, timezone
|
|
4
|
-
from typing import Literal,
|
|
4
|
+
from typing import Literal, overload
|
|
5
5
|
from uuid import UUID
|
|
6
6
|
from maleo.client.maleo.config import MaleoMetadataClientConfig
|
|
7
7
|
from maleo.client.maleo.service import MaleoClientService
|
|
@@ -36,12 +36,12 @@ from maleo.schemas.response import (
|
|
|
36
36
|
ReadSingleDataResponse,
|
|
37
37
|
)
|
|
38
38
|
from maleo.schemas.security.authorization import (
|
|
39
|
-
|
|
39
|
+
OptAnyAuthorization,
|
|
40
40
|
AnyAuthorization,
|
|
41
41
|
Factory as AuthorizationFactory,
|
|
42
42
|
)
|
|
43
|
-
from maleo.schemas.security.impersonation import
|
|
44
|
-
from maleo.types.dict import
|
|
43
|
+
from maleo.schemas.security.impersonation import OptImpersonation
|
|
44
|
+
from maleo.types.dict import OptStrToStrDict
|
|
45
45
|
from maleo.utils.merger import merge_dicts
|
|
46
46
|
|
|
47
47
|
|
|
@@ -58,9 +58,9 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
58
58
|
resource_operation_action: ReadResourceOperationAction,
|
|
59
59
|
connection_context: ConnectionContext,
|
|
60
60
|
authorization: AnyAuthorization,
|
|
61
|
-
impersonation:
|
|
61
|
+
impersonation: OptImpersonation = None,
|
|
62
62
|
parameters: ReadMultipleParameter,
|
|
63
|
-
headers:
|
|
63
|
+
headers: OptStrToStrDict = None,
|
|
64
64
|
) -> ReadMultipleDataResponse[
|
|
65
65
|
StandardMedicalServiceSchema, StrictPagination, None
|
|
66
66
|
]: ...
|
|
@@ -74,9 +74,9 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
74
74
|
resource_operation_action: ReadResourceOperationAction,
|
|
75
75
|
connection_context: ConnectionContext,
|
|
76
76
|
authorization: AnyAuthorization,
|
|
77
|
-
impersonation:
|
|
77
|
+
impersonation: OptImpersonation = None,
|
|
78
78
|
parameters: ReadMultipleParameter,
|
|
79
|
-
headers:
|
|
79
|
+
headers: OptStrToStrDict = None,
|
|
80
80
|
) -> ReadMultipleDataResponse[FullMedicalServiceSchema, StrictPagination, None]: ...
|
|
81
81
|
@overload
|
|
82
82
|
async def read(
|
|
@@ -88,9 +88,9 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
88
88
|
resource_operation_action: ReadResourceOperationAction,
|
|
89
89
|
connection_context: ConnectionContext,
|
|
90
90
|
authorization: AnyAuthorization,
|
|
91
|
-
impersonation:
|
|
91
|
+
impersonation: OptImpersonation = None,
|
|
92
92
|
parameters: ReadSingleParameter,
|
|
93
|
-
headers:
|
|
93
|
+
headers: OptStrToStrDict = None,
|
|
94
94
|
) -> ReadSingleDataResponse[StandardMedicalServiceSchema, None]: ...
|
|
95
95
|
@overload
|
|
96
96
|
async def read(
|
|
@@ -102,9 +102,9 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
102
102
|
resource_operation_action: ReadResourceOperationAction,
|
|
103
103
|
connection_context: ConnectionContext,
|
|
104
104
|
authorization: AnyAuthorization,
|
|
105
|
-
impersonation:
|
|
105
|
+
impersonation: OptImpersonation = None,
|
|
106
106
|
parameters: ReadSingleParameter,
|
|
107
|
-
headers:
|
|
107
|
+
headers: OptStrToStrDict = None,
|
|
108
108
|
) -> ReadSingleDataResponse[FullMedicalServiceSchema, None]: ...
|
|
109
109
|
async def read(
|
|
110
110
|
self,
|
|
@@ -114,16 +114,16 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
114
114
|
operation_id: UUID,
|
|
115
115
|
resource_operation_action: ReadResourceOperationAction,
|
|
116
116
|
connection_context: ConnectionContext,
|
|
117
|
-
authorization:
|
|
118
|
-
impersonation:
|
|
119
|
-
parameters:
|
|
120
|
-
headers:
|
|
121
|
-
) ->
|
|
122
|
-
ReadMultipleDataResponse[StandardMedicalServiceSchema, StrictPagination, None]
|
|
123
|
-
ReadMultipleDataResponse[FullMedicalServiceSchema, StrictPagination, None]
|
|
124
|
-
ReadSingleDataResponse[StandardMedicalServiceSchema, None]
|
|
125
|
-
ReadSingleDataResponse[FullMedicalServiceSchema, None]
|
|
126
|
-
|
|
117
|
+
authorization: OptAnyAuthorization = None,
|
|
118
|
+
impersonation: OptImpersonation = None,
|
|
119
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
120
|
+
headers: OptStrToStrDict = None,
|
|
121
|
+
) -> (
|
|
122
|
+
ReadMultipleDataResponse[StandardMedicalServiceSchema, StrictPagination, None]
|
|
123
|
+
| ReadMultipleDataResponse[FullMedicalServiceSchema, StrictPagination, None]
|
|
124
|
+
| ReadSingleDataResponse[StandardMedicalServiceSchema, None]
|
|
125
|
+
| ReadSingleDataResponse[FullMedicalServiceSchema, None]
|
|
126
|
+
):
|
|
127
127
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
128
128
|
data_model_cls = get_schema_model(granularity)
|
|
129
129
|
|
|
@@ -228,10 +228,10 @@ class MedicalServiceClientService(MaleoClientService[MaleoMetadataClientConfig])
|
|
|
228
228
|
if isinstance(parameters, ReadMultipleParameter):
|
|
229
229
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
230
230
|
elif isinstance(parameters, ReadSingleParameter):
|
|
231
|
-
if parameters.
|
|
232
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
231
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
232
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
233
233
|
else:
|
|
234
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
234
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
235
235
|
|
|
236
236
|
params = parameters.to_query_params()
|
|
237
237
|
|