maleo-metadata-client 0.0.10__py3-none-any.whl → 0.0.20__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/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_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.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/METADATA +17 -16
- maleo_metadata_client-0.0.20.dist-info/RECORD +16 -0
- maleo_metadata_client-0.0.10.dist-info/RECORD +0 -16
- {maleo_metadata_client-0.0.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/WHEEL +0 -0
- {maleo_metadata_client-0.0.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/licenses/LICENSE +0 -0
- {maleo_metadata_client-0.0.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/top_level.txt +0 -0
|
@@ -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
|
|
|
@@ -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 OrganizationTypeClientService(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
|
StandardOrganizationTypeSchema, StrictPagination, None
|
|
66
66
|
]: ...
|
|
@@ -74,9 +74,9 @@ class OrganizationTypeClientService(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[
|
|
81
81
|
FullOrganizationTypeSchema, StrictPagination, None
|
|
82
82
|
]: ...
|
|
@@ -90,9 +90,9 @@ class OrganizationTypeClientService(MaleoClientService[MaleoMetadataClientConfig
|
|
|
90
90
|
resource_operation_action: ReadResourceOperationAction,
|
|
91
91
|
connection_context: ConnectionContext,
|
|
92
92
|
authorization: AnyAuthorization,
|
|
93
|
-
impersonation:
|
|
93
|
+
impersonation: OptImpersonation = None,
|
|
94
94
|
parameters: ReadSingleParameter,
|
|
95
|
-
headers:
|
|
95
|
+
headers: OptStrToStrDict = None,
|
|
96
96
|
) -> ReadSingleDataResponse[StandardOrganizationTypeSchema, None]: ...
|
|
97
97
|
@overload
|
|
98
98
|
async def read(
|
|
@@ -104,9 +104,9 @@ class OrganizationTypeClientService(MaleoClientService[MaleoMetadataClientConfig
|
|
|
104
104
|
resource_operation_action: ReadResourceOperationAction,
|
|
105
105
|
connection_context: ConnectionContext,
|
|
106
106
|
authorization: AnyAuthorization,
|
|
107
|
-
impersonation:
|
|
107
|
+
impersonation: OptImpersonation = None,
|
|
108
108
|
parameters: ReadSingleParameter,
|
|
109
|
-
headers:
|
|
109
|
+
headers: OptStrToStrDict = None,
|
|
110
110
|
) -> ReadSingleDataResponse[FullOrganizationTypeSchema, None]: ...
|
|
111
111
|
async def read(
|
|
112
112
|
self,
|
|
@@ -116,18 +116,16 @@ class OrganizationTypeClientService(MaleoClientService[MaleoMetadataClientConfig
|
|
|
116
116
|
operation_id: UUID,
|
|
117
117
|
resource_operation_action: ReadResourceOperationAction,
|
|
118
118
|
connection_context: ConnectionContext,
|
|
119
|
-
authorization:
|
|
120
|
-
impersonation:
|
|
121
|
-
parameters:
|
|
122
|
-
headers:
|
|
123
|
-
) ->
|
|
124
|
-
ReadMultipleDataResponse[
|
|
125
|
-
|
|
126
|
-
]
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
ReadSingleDataResponse[FullOrganizationTypeSchema, None],
|
|
130
|
-
]:
|
|
119
|
+
authorization: OptAnyAuthorization = None,
|
|
120
|
+
impersonation: OptImpersonation = None,
|
|
121
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
122
|
+
headers: OptStrToStrDict = None,
|
|
123
|
+
) -> (
|
|
124
|
+
ReadMultipleDataResponse[StandardOrganizationTypeSchema, StrictPagination, None]
|
|
125
|
+
| ReadMultipleDataResponse[FullOrganizationTypeSchema, StrictPagination, None]
|
|
126
|
+
| ReadSingleDataResponse[StandardOrganizationTypeSchema, None]
|
|
127
|
+
| ReadSingleDataResponse[FullOrganizationTypeSchema, None]
|
|
128
|
+
):
|
|
131
129
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
132
130
|
data_model_cls = get_schema_model(granularity)
|
|
133
131
|
|
|
@@ -232,10 +230,10 @@ class OrganizationTypeClientService(MaleoClientService[MaleoMetadataClientConfig
|
|
|
232
230
|
if isinstance(parameters, ReadMultipleParameter):
|
|
233
231
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
234
232
|
elif isinstance(parameters, ReadSingleParameter):
|
|
235
|
-
if parameters.
|
|
236
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
233
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
234
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
237
235
|
else:
|
|
238
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
236
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
239
237
|
|
|
240
238
|
params = parameters.to_query_params()
|
|
241
239
|
|
|
@@ -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 ServiceClientService(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[StandardServiceSchema, StrictPagination, None]: ...
|
|
65
65
|
@overload
|
|
66
66
|
async def read(
|
|
@@ -72,9 +72,9 @@ class ServiceClientService(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[FullServiceSchema, StrictPagination, None]: ...
|
|
79
79
|
@overload
|
|
80
80
|
async def read(
|
|
@@ -86,9 +86,9 @@ class ServiceClientService(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[StandardServiceSchema, None]: ...
|
|
93
93
|
@overload
|
|
94
94
|
async def read(
|
|
@@ -100,9 +100,9 @@ class ServiceClientService(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[FullServiceSchema, None]: ...
|
|
107
107
|
async def read(
|
|
108
108
|
self,
|
|
@@ -112,16 +112,16 @@ class ServiceClientService(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[StandardServiceSchema, StrictPagination, None]
|
|
121
|
-
ReadMultipleDataResponse[FullServiceSchema, StrictPagination, None]
|
|
122
|
-
ReadSingleDataResponse[StandardServiceSchema, None]
|
|
123
|
-
ReadSingleDataResponse[FullServiceSchema, None]
|
|
124
|
-
|
|
115
|
+
authorization: OptAnyAuthorization = None,
|
|
116
|
+
impersonation: OptImpersonation = None,
|
|
117
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
118
|
+
headers: OptStrToStrDict = None,
|
|
119
|
+
) -> (
|
|
120
|
+
ReadMultipleDataResponse[StandardServiceSchema, StrictPagination, None]
|
|
121
|
+
| ReadMultipleDataResponse[FullServiceSchema, StrictPagination, None]
|
|
122
|
+
| ReadSingleDataResponse[StandardServiceSchema, None]
|
|
123
|
+
| ReadSingleDataResponse[FullServiceSchema, 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 ServiceClientService(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 SystemRoleClientService(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[StandardSystemRoleSchema, StrictPagination, None]: ...
|
|
65
65
|
@overload
|
|
66
66
|
async def read(
|
|
@@ -72,9 +72,9 @@ class SystemRoleClientService(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[FullSystemRoleSchema, StrictPagination, None]: ...
|
|
79
79
|
@overload
|
|
80
80
|
async def read(
|
|
@@ -86,9 +86,9 @@ class SystemRoleClientService(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[StandardSystemRoleSchema, None]: ...
|
|
93
93
|
@overload
|
|
94
94
|
async def read(
|
|
@@ -100,9 +100,9 @@ class SystemRoleClientService(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[FullSystemRoleSchema, None]: ...
|
|
107
107
|
async def read(
|
|
108
108
|
self,
|
|
@@ -112,16 +112,16 @@ class SystemRoleClientService(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[StandardSystemRoleSchema, StrictPagination, None]
|
|
121
|
-
ReadMultipleDataResponse[FullSystemRoleSchema, StrictPagination, None]
|
|
122
|
-
ReadSingleDataResponse[StandardSystemRoleSchema, None]
|
|
123
|
-
ReadSingleDataResponse[FullSystemRoleSchema, None]
|
|
124
|
-
|
|
115
|
+
authorization: OptAnyAuthorization = None,
|
|
116
|
+
impersonation: OptImpersonation = None,
|
|
117
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
118
|
+
headers: OptStrToStrDict = None,
|
|
119
|
+
) -> (
|
|
120
|
+
ReadMultipleDataResponse[StandardSystemRoleSchema, StrictPagination, None]
|
|
121
|
+
| ReadMultipleDataResponse[FullSystemRoleSchema, StrictPagination, None]
|
|
122
|
+
| ReadSingleDataResponse[StandardSystemRoleSchema, None]
|
|
123
|
+
| ReadSingleDataResponse[FullSystemRoleSchema, 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 SystemRoleClientService(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 UserTypeClientService(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[StandardUserTypeSchema, StrictPagination, None]: ...
|
|
65
65
|
@overload
|
|
66
66
|
async def read(
|
|
@@ -72,9 +72,9 @@ class UserTypeClientService(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[FullUserTypeSchema, StrictPagination, None]: ...
|
|
79
79
|
@overload
|
|
80
80
|
async def read(
|
|
@@ -86,9 +86,9 @@ class UserTypeClientService(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[StandardUserTypeSchema, None]: ...
|
|
93
93
|
@overload
|
|
94
94
|
async def read(
|
|
@@ -100,9 +100,9 @@ class UserTypeClientService(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[FullUserTypeSchema, None]: ...
|
|
107
107
|
async def read(
|
|
108
108
|
self,
|
|
@@ -112,16 +112,16 @@ class UserTypeClientService(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[StandardUserTypeSchema, StrictPagination, None]
|
|
121
|
-
ReadMultipleDataResponse[FullUserTypeSchema, StrictPagination, None]
|
|
122
|
-
ReadSingleDataResponse[StandardUserTypeSchema, None]
|
|
123
|
-
ReadSingleDataResponse[FullUserTypeSchema, None]
|
|
124
|
-
|
|
115
|
+
authorization: OptAnyAuthorization = None,
|
|
116
|
+
impersonation: OptImpersonation = None,
|
|
117
|
+
parameters: ReadMultipleParameter | ReadSingleParameter,
|
|
118
|
+
headers: OptStrToStrDict = None,
|
|
119
|
+
) -> (
|
|
120
|
+
ReadMultipleDataResponse[StandardUserTypeSchema, StrictPagination, None]
|
|
121
|
+
| ReadMultipleDataResponse[FullUserTypeSchema, StrictPagination, None]
|
|
122
|
+
| ReadSingleDataResponse[StandardUserTypeSchema, None]
|
|
123
|
+
| ReadSingleDataResponse[FullUserTypeSchema, None]
|
|
124
|
+
):
|
|
125
125
|
redis_client = self._redis.manager.client.get(Connection.ASYNC)
|
|
126
126
|
data_model_cls = get_schema_model(granularity)
|
|
127
127
|
|
|
@@ -224,10 +224,10 @@ class UserTypeClientService(MaleoClientService[MaleoMetadataClientConfig]):
|
|
|
224
224
|
if isinstance(parameters, ReadMultipleParameter):
|
|
225
225
|
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/"
|
|
226
226
|
elif isinstance(parameters, ReadSingleParameter):
|
|
227
|
-
if parameters.
|
|
228
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
227
|
+
if parameters.identifier_type is IdentifierType.ID:
|
|
228
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_value}"
|
|
229
229
|
else:
|
|
230
|
-
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.
|
|
230
|
+
url = f"{self._config.url}/v1/{self.resource.identifiers[-1].slug}/{parameters.identifier_type}/{parameters.identifier_value}"
|
|
231
231
|
|
|
232
232
|
params = parameters.to_query_params()
|
|
233
233
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-metadata-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.20
|
|
4
4
|
Summary: MaleoMetadata client package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: MIT
|
|
@@ -50,19 +50,20 @@ Requires-Dist: identify>=2.6.15
|
|
|
50
50
|
Requires-Dist: idna>=3.11
|
|
51
51
|
Requires-Dist: importlib_metadata>=8.7.0
|
|
52
52
|
Requires-Dist: iniconfig>=2.1.0
|
|
53
|
-
Requires-Dist: maleo-client>=0.0.
|
|
54
|
-
Requires-Dist: maleo-crypto>=0.0.
|
|
55
|
-
Requires-Dist: maleo-database>=0.1.
|
|
56
|
-
Requires-Dist: maleo-enums>=0.0.
|
|
57
|
-
Requires-Dist: maleo-google>=0.1.
|
|
58
|
-
Requires-Dist: maleo-infra>=0.1.
|
|
59
|
-
Requires-Dist: maleo-logging>=0.0.
|
|
60
|
-
Requires-Dist: maleo-
|
|
61
|
-
Requires-Dist: maleo-
|
|
62
|
-
Requires-Dist: maleo-
|
|
63
|
-
Requires-Dist: maleo-
|
|
64
|
-
Requires-Dist: maleo-
|
|
65
|
-
Requires-Dist: maleo-
|
|
53
|
+
Requires-Dist: maleo-client>=0.0.10
|
|
54
|
+
Requires-Dist: maleo-crypto>=0.0.40
|
|
55
|
+
Requires-Dist: maleo-database>=0.1.50
|
|
56
|
+
Requires-Dist: maleo-enums>=0.0.40
|
|
57
|
+
Requires-Dist: maleo-google>=0.1.20
|
|
58
|
+
Requires-Dist: maleo-infra>=0.1.50
|
|
59
|
+
Requires-Dist: maleo-logging>=0.0.40
|
|
60
|
+
Requires-Dist: maleo-managers>=0.0.92
|
|
61
|
+
Requires-Dist: maleo-metadata>=0.3.50
|
|
62
|
+
Requires-Dist: maleo-middlewares>=0.1.20
|
|
63
|
+
Requires-Dist: maleo-schemas>=0.1.50
|
|
64
|
+
Requires-Dist: maleo-soma>=0.2.10
|
|
65
|
+
Requires-Dist: maleo-types>=0.0.20
|
|
66
|
+
Requires-Dist: maleo-utils>=0.0.40
|
|
66
67
|
Requires-Dist: motor>=3.7.1
|
|
67
68
|
Requires-Dist: mypy_extensions>=1.1.0
|
|
68
69
|
Requires-Dist: nodeenv>=1.9.1
|
|
@@ -81,9 +82,9 @@ Requires-Dist: pyasn1>=0.6.1
|
|
|
81
82
|
Requires-Dist: pyasn1_modules>=0.4.2
|
|
82
83
|
Requires-Dist: pycparser>=2.23
|
|
83
84
|
Requires-Dist: pycryptodome>=3.23.0
|
|
84
|
-
Requires-Dist: pydantic>=2.12.
|
|
85
|
+
Requires-Dist: pydantic>=2.12.2
|
|
85
86
|
Requires-Dist: pydantic-settings>=2.11.0
|
|
86
|
-
Requires-Dist: pydantic_core>=2.41.
|
|
87
|
+
Requires-Dist: pydantic_core>=2.41.4
|
|
87
88
|
Requires-Dist: Pygments>=2.19.2
|
|
88
89
|
Requires-Dist: PyJWT>=2.10.1
|
|
89
90
|
Requires-Dist: pymongo>=4.15.3
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
maleo/metadata/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
maleo/metadata/client/manager.py,sha256=u8TgKlG5nGjGIwB8rrw4f2LkqV3h26_Tsak9F5b2TqE,3263
|
|
3
|
+
maleo/metadata/client/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
maleo/metadata/client/services/blood_type.py,sha256=3iDtiwK8GVU7XP8r0_CJ3PugA_6IZdby8H0cObjuoFc,13404
|
|
5
|
+
maleo/metadata/client/services/gender.py,sha256=ymoQFu5mn_Ie9BEp589m5VH1BEjr9tR6NexAD_gtJiI,13323
|
|
6
|
+
maleo/metadata/client/services/medical_role.py,sha256=np5L0EZZESQ2uPnw11lxVfVrm1BBcP7LoBMfD0omJLo,15345
|
|
7
|
+
maleo/metadata/client/services/medical_service.py,sha256=ICimER6wdhAFn4D27cKQGq2AZywnx18KY83_sLqSRuc,13533
|
|
8
|
+
maleo/metadata/client/services/organization_type.py,sha256=UDOx7pROtgXrvBgoR5Cd2ZwF7QzxTcI5XCj-ztW-3pc,13593
|
|
9
|
+
maleo/metadata/client/services/service.py,sha256=wkabWNpzrWbhZtZhTxXhklpmmFfkBpvEKUU1hLhvMUI,13346
|
|
10
|
+
maleo/metadata/client/services/system_role.py,sha256=IG_h2fy_tOI_HvacVdQ7oIsFcvn0R04FbvckXQoxd_w,13427
|
|
11
|
+
maleo/metadata/client/services/user_type.py,sha256=9qLyyfujoCJhH5lCNza1UDC0tRE88xS8krTjl5U0UuY,13311
|
|
12
|
+
maleo_metadata_client-0.0.20.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
13
|
+
maleo_metadata_client-0.0.20.dist-info/METADATA,sha256=6-stLdFv64YdW9de993E5IzWQLtAqHMong8U0YqjIcg,4377
|
|
14
|
+
maleo_metadata_client-0.0.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
maleo_metadata_client-0.0.20.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
16
|
+
maleo_metadata_client-0.0.20.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
maleo/metadata/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
maleo/metadata/client/manager.py,sha256=u8TgKlG5nGjGIwB8rrw4f2LkqV3h26_Tsak9F5b2TqE,3263
|
|
3
|
-
maleo/metadata/client/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
maleo/metadata/client/services/blood_type.py,sha256=4TUOL1D18aK_IdM7P7KQiAp3wssXQKIhhTPrOIYwfTc,13494
|
|
5
|
-
maleo/metadata/client/services/gender.py,sha256=5hTWzX7RTO5DxUtKQC9hAD2x5JyV4tNQ3qPrLSA-7lc,13413
|
|
6
|
-
maleo/metadata/client/services/medical_role.py,sha256=kxNF5rqb5ReyOh69j_TQXJioUIjPkNzLzg5lxPGfsAU,15483
|
|
7
|
-
maleo/metadata/client/services/medical_service.py,sha256=y3PQ_2EbjUQkmFNtgNxzuVtfsY95yx_89bx8WIXozNo,13623
|
|
8
|
-
maleo/metadata/client/services/organization_type.py,sha256=zoOIASfTj3JZ4blxIcCkrJd7iEnyuSkEyL12j8egYy0,13705
|
|
9
|
-
maleo/metadata/client/services/service.py,sha256=8KuM4eTpp9D5aC9HrFHUpz9E5rIGegK5xLy8wRisOlo,13436
|
|
10
|
-
maleo/metadata/client/services/system_role.py,sha256=zFM2_qqsXQ21sUT8I7VKqVC6AJ1Byf32I8kt0sD-DvU,13517
|
|
11
|
-
maleo/metadata/client/services/user_type.py,sha256=Ml73ZJVeBoI86LtF4ogFQMJmZ3fQARv5ZAJzjur9pIA,13401
|
|
12
|
-
maleo_metadata_client-0.0.10.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
13
|
-
maleo_metadata_client-0.0.10.dist-info/METADATA,sha256=IK4fbjGHcbsLLUCZ2eYn-CoMSqpYfTOMpeTiX9O7K3c,4336
|
|
14
|
-
maleo_metadata_client-0.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
-
maleo_metadata_client-0.0.10.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
16
|
-
maleo_metadata_client-0.0.10.dist-info/RECORD,,
|
|
File without changes
|
{maleo_metadata_client-0.0.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{maleo_metadata_client-0.0.10.dist-info → maleo_metadata_client-0.0.20.dist-info}/top_level.txt
RENAMED
|
File without changes
|