maleo-identity 0.0.27__py3-none-any.whl → 0.0.29__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-identity might be problematic. Click here for more details.

Files changed (26) hide show
  1. maleo_identity/client/controllers/__init__.py +4 -2
  2. maleo_identity/client/controllers/http/organization.py +166 -31
  3. maleo_identity/client/controllers/http/user.py +170 -32
  4. maleo_identity/client/manager.py +25 -8
  5. maleo_identity/client/services/__init__.py +4 -2
  6. maleo_identity/client/services/organization.py +317 -81
  7. maleo_identity/client/services/user.py +342 -87
  8. maleo_identity/models/schemas/general/user.py +10 -0
  9. maleo_identity/models/transfers/parameters/client/organization.py +9 -2
  10. maleo_identity/models/transfers/parameters/client/organization_role.py +8 -8
  11. maleo_identity/models/transfers/parameters/client/user.py +13 -2
  12. maleo_identity/models/transfers/parameters/client/user_organization.py +12 -12
  13. maleo_identity/models/transfers/parameters/client/user_organization_role.py +8 -8
  14. maleo_identity/models/transfers/parameters/client/user_profile.py +4 -4
  15. maleo_identity/models/transfers/parameters/client/user_system_role.py +8 -8
  16. maleo_identity/models/transfers/parameters/service/organization.py +9 -2
  17. maleo_identity/models/transfers/parameters/service/organization_role.py +6 -6
  18. maleo_identity/models/transfers/parameters/service/user.py +13 -2
  19. maleo_identity/models/transfers/parameters/service/user_organization.py +8 -8
  20. maleo_identity/models/transfers/parameters/service/user_organization_role.py +6 -6
  21. maleo_identity/models/transfers/parameters/service/user_profile.py +4 -4
  22. maleo_identity/models/transfers/parameters/service/user_system_role.py +6 -6
  23. {maleo_identity-0.0.27.dist-info → maleo_identity-0.0.29.dist-info}/METADATA +3 -3
  24. {maleo_identity-0.0.27.dist-info → maleo_identity-0.0.29.dist-info}/RECORD +26 -26
  25. {maleo_identity-0.0.27.dist-info → maleo_identity-0.0.29.dist-info}/WHEEL +0 -0
  26. {maleo_identity-0.0.27.dist-info → maleo_identity-0.0.29.dist-info}/top_level.txt +0 -0
@@ -2,25 +2,45 @@ from maleo_foundation.managers.client.base import ClientService
2
2
  from maleo_foundation.utils.exceptions import BaseExceptions
3
3
  from maleo_identity.client.controllers import MaleoIdentityOrganizationControllers
4
4
  from maleo_identity.enums.general import MaleoIdentityGeneralEnums
5
- from maleo_identity.models.transfers.parameters.general.organization_role import MaleoIdentityOrganizationRoleGeneralParametersTransfers
6
- from maleo_identity.models.transfers.parameters.general.organization import MaleoIdentityOrganizationGeneralParametersTransfers
7
- from maleo_identity.models.transfers.parameters.general.user_organization import MaleoIdentityUserOrganizationGeneralParametersTransfers
8
- from maleo_identity.models.transfers.parameters.general.user_organization_role import MaleoIdentityUserOrganizationRoleGeneralParametersTransfers
9
- from maleo_identity.models.transfers.parameters.client.organization_role import MaleoIdentityOrganizationRoleClientParametersTransfers
10
- from maleo_identity.models.transfers.parameters.client.organization import MaleoIdentityOrganizationClientParametersTransfers
11
- from maleo_identity.models.transfers.parameters.client.user_organization import MaleoIdentityUserOrganizationClientParametersTransfers
12
- from maleo_identity.models.transfers.parameters.client.user_organization_role import MaleoIdentityUserOrganizationRoleClientParametersTransfers
13
- from maleo_identity.models.transfers.results.client.organization_role import MaleoIdentityOrganizationRoleClientResultsTransfers
14
- from maleo_identity.models.transfers.results.client.organization import MaleoIdentityOrganizationClientResultsTransfers
15
- from maleo_identity.models.transfers.results.client.user_organization import MaleoIdentityUserOrganizationClientResultsTransfers
16
- from maleo_identity.models.transfers.results.client.user_organization_role import MaleoIdentityUserOrganizationRoleClientResultsTransfers
17
- from maleo_identity.types.results.client.organization_role import MaleoIdentityOrganizationRoleClientResultsTypes
18
- from maleo_identity.types.results.client.organization import MaleoIdentityOrganizationClientResultsTypes
19
- from maleo_identity.types.results.client.user_organization import MaleoIdentityUserOrganizationClientResultsTypes
20
- from maleo_identity.types.results.client.user_organization_role import MaleoIdentityUserOrganizationRoleClientResultsTypes
5
+ from maleo_identity.models.transfers.parameters.general.organization_role \
6
+ import MaleoIdentityOrganizationRoleGeneralParametersTransfers
7
+ from maleo_identity.models.transfers.parameters.general.organization \
8
+ import MaleoIdentityOrganizationGeneralParametersTransfers
9
+ from maleo_identity.models.transfers.parameters.general.user_organization \
10
+ import MaleoIdentityUserOrganizationGeneralParametersTransfers
11
+ from maleo_identity.models.transfers.parameters.general.user_organization_role \
12
+ import MaleoIdentityUserOrganizationRoleGeneralParametersTransfers
13
+ from maleo_identity.models.transfers.parameters.client.organization_role \
14
+ import MaleoIdentityOrganizationRoleClientParametersTransfers
15
+ from maleo_identity.models.transfers.parameters.client.organization \
16
+ import MaleoIdentityOrganizationClientParametersTransfers
17
+ from maleo_identity.models.transfers.parameters.client.user_organization \
18
+ import MaleoIdentityUserOrganizationClientParametersTransfers
19
+ from maleo_identity.models.transfers.parameters.client.user_organization_role \
20
+ import MaleoIdentityUserOrganizationRoleClientParametersTransfers
21
+ from maleo_identity.models.transfers.results.client.organization_role \
22
+ import MaleoIdentityOrganizationRoleClientResultsTransfers
23
+ from maleo_identity.models.transfers.results.client.organization \
24
+ import MaleoIdentityOrganizationClientResultsTransfers
25
+ from maleo_identity.models.transfers.results.client.user_organization \
26
+ import MaleoIdentityUserOrganizationClientResultsTransfers
27
+ from maleo_identity.models.transfers.results.client.user_organization_role \
28
+ import MaleoIdentityUserOrganizationRoleClientResultsTransfers
29
+ from maleo_identity.types.results.client.organization_role \
30
+ import MaleoIdentityOrganizationRoleClientResultsTypes
31
+ from maleo_identity.types.results.client.organization \
32
+ import MaleoIdentityOrganizationClientResultsTypes
33
+ from maleo_identity.types.results.client.user_organization \
34
+ import MaleoIdentityUserOrganizationClientResultsTypes
35
+ from maleo_identity.types.results.client.user_organization_role \
36
+ import MaleoIdentityUserOrganizationRoleClientResultsTypes
21
37
 
22
38
  class MaleoIdentityOrganizationClientService(ClientService):
23
- def __init__(self, logger, controllers:MaleoIdentityOrganizationControllers):
39
+ def __init__(
40
+ self,
41
+ logger,
42
+ controllers:MaleoIdentityOrganizationControllers
43
+ ):
24
44
  super().__init__(logger)
25
45
  self._controllers = controllers
26
46
 
@@ -41,25 +61,49 @@ class MaleoIdentityOrganizationClientService(ClientService):
41
61
  )
42
62
  async def _impl():
43
63
  #* Validate chosen controller type
44
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
64
+ if not isinstance(
65
+ controller_type,
66
+ MaleoIdentityGeneralEnums.ClientControllerType
67
+ ):
45
68
  message = "Invalid controller type"
46
69
  description = "The provided controller type did not exists"
47
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
70
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
71
+ message=message,
72
+ description=description
73
+ )
48
74
  #* Retrieve organizations using chosen controller
49
75
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
50
- controller_result = await self._controllers.http.get_organizations(parameters=parameters)
76
+ controller_result = (
77
+ await self._controllers.http
78
+ .get_organizations(parameters=parameters)
79
+ )
51
80
  else:
52
81
  message = "Invalid controller type"
53
82
  description = "The provided controller type has not been implemented"
54
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
83
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
84
+ message=message,
85
+ description=description
86
+ )
55
87
  #* Return proper response
56
88
  if not controller_result.success:
57
- return MaleoIdentityOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
89
+ return (
90
+ MaleoIdentityOrganizationClientResultsTransfers
91
+ .Fail
92
+ .model_validate(controller_result.content)
93
+ )
58
94
  else:
59
95
  if controller_result.content["data"] is None:
60
- return MaleoIdentityOrganizationClientResultsTransfers.NoData.model_validate(controller_result.content)
96
+ return (
97
+ MaleoIdentityOrganizationClientResultsTransfers
98
+ .NoData
99
+ .model_validate(controller_result.content)
100
+ )
61
101
  else:
62
- return MaleoIdentityOrganizationClientResultsTransfers.MultipleData.model_validate(controller_result.content)
102
+ return (
103
+ MaleoIdentityOrganizationClientResultsTransfers
104
+ .MultipleData
105
+ .model_validate(controller_result.content)
106
+ )
63
107
  return await _impl()
64
108
 
65
109
  async def get_organization(
@@ -75,22 +119,42 @@ class MaleoIdentityOrganizationClientService(ClientService):
75
119
  )
76
120
  async def _impl():
77
121
  #* Validate chosen controller type
78
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
122
+ if not isinstance(
123
+ controller_type,
124
+ MaleoIdentityGeneralEnums.ClientControllerType
125
+ ):
79
126
  message = "Invalid controller type"
80
127
  description = "The provided controller type did not exists"
81
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
128
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
129
+ message=message,
130
+ description=description
131
+ )
82
132
  #* Retrieve organization using chosen controller
83
133
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
84
- controller_result = await self._controllers.http.get_organization(parameters=parameters)
134
+ controller_result = (
135
+ await self._controllers.http
136
+ .get_organization(parameters=parameters)
137
+ )
85
138
  else:
86
139
  message = "Invalid controller type"
87
140
  description = "The provided controller type has not been implemented"
88
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
141
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
142
+ message=message,
143
+ description=description
144
+ )
89
145
  #* Return proper response
90
146
  if not controller_result.success:
91
- return MaleoIdentityOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
147
+ return (
148
+ MaleoIdentityOrganizationClientResultsTransfers
149
+ .Fail
150
+ .model_validate(controller_result.content)
151
+ )
92
152
  else:
93
- return MaleoIdentityOrganizationClientResultsTransfers.SingleData.model_validate(controller_result.content)
153
+ return (
154
+ MaleoIdentityOrganizationClientResultsTransfers
155
+ .SingleData
156
+ .model_validate(controller_result.content)
157
+ )
94
158
  return await _impl()
95
159
 
96
160
  async def create(
@@ -106,22 +170,42 @@ class MaleoIdentityOrganizationClientService(ClientService):
106
170
  )
107
171
  async def _impl():
108
172
  #* Validate chosen controller type
109
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
173
+ if not isinstance(
174
+ controller_type,
175
+ MaleoIdentityGeneralEnums.ClientControllerType
176
+ ):
110
177
  message = "Invalid controller type"
111
178
  description = "The provided controller type did not exists"
112
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
179
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
180
+ message=message,
181
+ description=description
182
+ )
113
183
  #* Create a new organization using chosen controller
114
184
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
115
- controller_result = await self._controllers.http.create(parameters=parameters)
185
+ controller_result = (
186
+ await self._controllers.http
187
+ .create(parameters=parameters)
188
+ )
116
189
  else:
117
190
  message = "Invalid controller type"
118
191
  description = "The provided controller type has not been implemented"
119
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
192
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
193
+ message=message,
194
+ description=description
195
+ )
120
196
  #* Return proper response
121
197
  if not controller_result.success:
122
- return MaleoIdentityOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
198
+ return (
199
+ MaleoIdentityOrganizationClientResultsTransfers
200
+ .Fail
201
+ .model_validate(controller_result.content)
202
+ )
123
203
  else:
124
- return MaleoIdentityOrganizationClientResultsTransfers.SingleData.model_validate(controller_result.content)
204
+ return (
205
+ MaleoIdentityOrganizationClientResultsTransfers
206
+ .SingleData
207
+ .model_validate(controller_result.content)
208
+ )
125
209
  return await _impl()
126
210
 
127
211
  async def update(
@@ -137,22 +221,42 @@ class MaleoIdentityOrganizationClientService(ClientService):
137
221
  )
138
222
  async def _impl():
139
223
  #* Validate chosen controller type
140
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
224
+ if not isinstance(
225
+ controller_type,
226
+ MaleoIdentityGeneralEnums.ClientControllerType
227
+ ):
141
228
  message = "Invalid controller type"
142
229
  description = "The provided controller type did not exists"
143
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
230
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
231
+ message=message,
232
+ description=description
233
+ )
144
234
  #* Update organization's data using chosen controller
145
235
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
146
- controller_result = await self._controllers.http.update(parameters=parameters)
236
+ controller_result = (
237
+ await self._controllers.http
238
+ .update(parameters=parameters)
239
+ )
147
240
  else:
148
241
  message = "Invalid controller type"
149
242
  description = "The provided controller type has not been implemented"
150
- return MaleoIdentityOrganizationClientResultsTransfers.Fail(message=message, description=description)
243
+ return MaleoIdentityOrganizationClientResultsTransfers.Fail(
244
+ message=message,
245
+ description=description
246
+ )
151
247
  #* Return proper response
152
248
  if not controller_result.success:
153
- return MaleoIdentityOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
249
+ return (
250
+ MaleoIdentityOrganizationClientResultsTransfers
251
+ .Fail
252
+ .model_validate(controller_result.content)
253
+ )
154
254
  else:
155
- return MaleoIdentityOrganizationClientResultsTransfers.SingleData.model_validate(controller_result.content)
255
+ return (
256
+ MaleoIdentityOrganizationClientResultsTransfers
257
+ .SingleData
258
+ .model_validate(controller_result.content)
259
+ )
156
260
  return await _impl()
157
261
 
158
262
  async def get_organization_users(
@@ -168,25 +272,49 @@ class MaleoIdentityOrganizationClientService(ClientService):
168
272
  )
169
273
  async def _impl():
170
274
  #* Validate chosen controller type
171
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
275
+ if not isinstance(
276
+ controller_type,
277
+ MaleoIdentityGeneralEnums.ClientControllerType
278
+ ):
172
279
  message = "Invalid controller type"
173
280
  description = "The provided controller type did not exists"
174
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(message=message, description=description)
281
+ return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(
282
+ message=message,
283
+ description=description
284
+ )
175
285
  #* Retrieve organization's users using chosen controller
176
286
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
177
- controller_result = await self._controllers.http.get_organization_users(parameters=parameters)
287
+ controller_result = (
288
+ await self._controllers.http
289
+ .get_organization_users(parameters=parameters)
290
+ )
178
291
  else:
179
292
  message = "Invalid controller type"
180
293
  description = "The provided controller type has not been implemented"
181
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(message=message, description=description)
294
+ return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(
295
+ message=message,
296
+ description=description
297
+ )
182
298
  #* Return proper response
183
299
  if not controller_result.success:
184
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
300
+ return (
301
+ MaleoIdentityUserOrganizationClientResultsTransfers
302
+ .Fail
303
+ .model_validate(controller_result.content)
304
+ )
185
305
  else:
186
306
  if controller_result.content["data"] is None:
187
- return MaleoIdentityUserOrganizationClientResultsTransfers.NoData.model_validate(controller_result.content)
307
+ return (
308
+ MaleoIdentityUserOrganizationClientResultsTransfers
309
+ .NoData
310
+ .model_validate(controller_result.content)
311
+ )
188
312
  else:
189
- return MaleoIdentityUserOrganizationClientResultsTransfers.MultipleData.model_validate(controller_result.content)
313
+ return (
314
+ MaleoIdentityUserOrganizationClientResultsTransfers
315
+ .MultipleData
316
+ .model_validate(controller_result.content)
317
+ )
190
318
  return await _impl()
191
319
 
192
320
  async def get_organization_user(
@@ -202,22 +330,42 @@ class MaleoIdentityOrganizationClientService(ClientService):
202
330
  )
203
331
  async def _impl():
204
332
  #* Validate chosen controller type
205
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
333
+ if not isinstance(
334
+ controller_type,
335
+ MaleoIdentityGeneralEnums.ClientControllerType
336
+ ):
206
337
  message = "Invalid controller type"
207
338
  description = "The provided controller type did not exists"
208
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(message=message, description=description)
339
+ return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(
340
+ message=message,
341
+ description=description
342
+ )
209
343
  #* Retrieve organization's user using chosen controller
210
344
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
211
- controller_result = await self._controllers.http.get_organization_user(parameters=parameters)
345
+ controller_result = (
346
+ await self._controllers.http
347
+ .get_organization_user(parameters=parameters)
348
+ )
212
349
  else:
213
350
  message = "Invalid controller type"
214
351
  description = "The provided controller type has not been implemented"
215
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(message=message, description=description)
352
+ return MaleoIdentityUserOrganizationClientResultsTransfers.Fail(
353
+ message=message,
354
+ description=description
355
+ )
216
356
  #* Return proper response
217
357
  if not controller_result.success:
218
- return MaleoIdentityUserOrganizationClientResultsTransfers.Fail.model_validate(controller_result.content)
358
+ return (
359
+ MaleoIdentityUserOrganizationClientResultsTransfers
360
+ .Fail
361
+ .model_validate(controller_result.content)
362
+ )
219
363
  else:
220
- return MaleoIdentityUserOrganizationClientResultsTransfers.SingleData.model_validate(controller_result.content)
364
+ return (
365
+ MaleoIdentityUserOrganizationClientResultsTransfers
366
+ .SingleData
367
+ .model_validate(controller_result.content)
368
+ )
221
369
  return await _impl()
222
370
 
223
371
  async def get_organization_roles(
@@ -233,25 +381,49 @@ class MaleoIdentityOrganizationClientService(ClientService):
233
381
  )
234
382
  async def _impl():
235
383
  #* Validate chosen controller type
236
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
384
+ if not isinstance(
385
+ controller_type,
386
+ MaleoIdentityGeneralEnums.ClientControllerType
387
+ ):
237
388
  message = "Invalid controller type"
238
389
  description = "The provided controller type did not exists"
239
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
390
+ return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(
391
+ message=message,
392
+ description=description
393
+ )
240
394
  #* Retrieve organization's roles using chosen controller
241
395
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
242
- controller_result = await self._controllers.http.get_organization_roles(parameters=parameters)
396
+ controller_result = (
397
+ await self._controllers.http
398
+ .get_organization_roles(parameters=parameters)
399
+ )
243
400
  else:
244
401
  message = "Invalid controller type"
245
402
  description = "The provided controller type has not been implemented"
246
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
403
+ return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(
404
+ message=message,
405
+ description=description
406
+ )
247
407
  #* Return proper response
248
408
  if not controller_result.success:
249
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail.model_validate(controller_result.content)
409
+ return (
410
+ MaleoIdentityOrganizationRoleClientResultsTransfers
411
+ .Fail
412
+ .model_validate(controller_result.content)
413
+ )
250
414
  else:
251
415
  if controller_result.content["data"] is None:
252
- return MaleoIdentityOrganizationRoleClientResultsTransfers.NoData.model_validate(controller_result.content)
416
+ return (
417
+ MaleoIdentityOrganizationRoleClientResultsTransfers
418
+ .NoData
419
+ .model_validate(controller_result.content)
420
+ )
253
421
  else:
254
- return MaleoIdentityOrganizationRoleClientResultsTransfers.MultipleData.model_validate(controller_result.content)
422
+ return (
423
+ MaleoIdentityOrganizationRoleClientResultsTransfers
424
+ .MultipleData
425
+ .model_validate(controller_result.content)
426
+ )
255
427
  return await _impl()
256
428
 
257
429
  async def get_organization_role(
@@ -267,22 +439,42 @@ class MaleoIdentityOrganizationClientService(ClientService):
267
439
  )
268
440
  async def _impl():
269
441
  #* Validate chosen controller type
270
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
442
+ if not isinstance(
443
+ controller_type,
444
+ MaleoIdentityGeneralEnums.ClientControllerType
445
+ ):
271
446
  message = "Invalid controller type"
272
447
  description = "The provided controller type did not exists"
273
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
448
+ return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(
449
+ message=message,
450
+ description=description
451
+ )
274
452
  #* Retrieve organization's role using chosen controller
275
453
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
276
- controller_result = await self._controllers.http.get_organization_role(parameters=parameters)
454
+ controller_result = (
455
+ await self._controllers.http
456
+ .get_organization_role(parameters=parameters)
457
+ )
277
458
  else:
278
459
  message = "Invalid controller type"
279
460
  description = "The provided controller type has not been implemented"
280
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
461
+ return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail(
462
+ message=message,
463
+ description=description
464
+ )
281
465
  #* Return proper response
282
466
  if not controller_result.success:
283
- return MaleoIdentityOrganizationRoleClientResultsTransfers.Fail.model_validate(controller_result.content)
467
+ return (
468
+ MaleoIdentityOrganizationRoleClientResultsTransfers
469
+ .Fail
470
+ .model_validate(controller_result.content)
471
+ )
284
472
  else:
285
- return MaleoIdentityOrganizationRoleClientResultsTransfers.SingleData.model_validate(controller_result.content)
473
+ return (
474
+ MaleoIdentityOrganizationRoleClientResultsTransfers
475
+ .SingleData
476
+ .model_validate(controller_result.content)
477
+ )
286
478
  return await _impl()
287
479
 
288
480
  async def get_organization_user_roles(
@@ -298,25 +490,49 @@ class MaleoIdentityOrganizationClientService(ClientService):
298
490
  )
299
491
  async def _impl():
300
492
  #* Validate chosen controller type
301
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
493
+ if not isinstance(
494
+ controller_type,
495
+ MaleoIdentityGeneralEnums.ClientControllerType
496
+ ):
302
497
  message = "Invalid controller type"
303
498
  description = "The provided controller type did not exists"
304
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
499
+ return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(
500
+ message=message,
501
+ description=description
502
+ )
305
503
  #* Retrieve organization's user roles using chosen controller
306
504
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
307
- controller_result = await self._controllers.http.get_organization_user_roles(parameters=parameters)
505
+ controller_result = (
506
+ await self._controllers.http
507
+ .get_organization_user_roles(parameters=parameters)
508
+ )
308
509
  else:
309
510
  message = "Invalid controller type"
310
511
  description = "The provided controller type has not been implemented"
311
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
512
+ return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(
513
+ message=message,
514
+ description=description
515
+ )
312
516
  #* Return proper response
313
517
  if not controller_result.success:
314
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail.model_validate(controller_result.content)
518
+ return (
519
+ MaleoIdentityUserOrganizationRoleClientResultsTransfers
520
+ .Fail
521
+ .model_validate(controller_result.content)
522
+ )
315
523
  else:
316
524
  if controller_result.content["data"] is None:
317
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.NoData.model_validate(controller_result.content)
525
+ return (
526
+ MaleoIdentityUserOrganizationRoleClientResultsTransfers
527
+ .NoData
528
+ .model_validate(controller_result.content)
529
+ )
318
530
  else:
319
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.MultipleData.model_validate(controller_result.content)
531
+ return (
532
+ MaleoIdentityUserOrganizationRoleClientResultsTransfers
533
+ .MultipleData
534
+ .model_validate(controller_result.content)
535
+ )
320
536
  return await _impl()
321
537
 
322
538
  async def get_organization_user_role(
@@ -332,20 +548,40 @@ class MaleoIdentityOrganizationClientService(ClientService):
332
548
  )
333
549
  async def _impl():
334
550
  #* Validate chosen controller type
335
- if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
551
+ if not isinstance(
552
+ controller_type,
553
+ MaleoIdentityGeneralEnums.ClientControllerType
554
+ ):
336
555
  message = "Invalid controller type"
337
556
  description = "The provided controller type did not exists"
338
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
557
+ return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(
558
+ message=message,
559
+ description=description
560
+ )
339
561
  #* Retrieve organization's user role using chosen controller
340
562
  if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
341
- controller_result = await self._controllers.http.get_organization_user_role(parameters=parameters)
563
+ controller_result = (
564
+ await self._controllers.http
565
+ .get_organization_user_role(parameters=parameters)
566
+ )
342
567
  else:
343
568
  message = "Invalid controller type"
344
569
  description = "The provided controller type has not been implemented"
345
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(message=message, description=description)
570
+ return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail(
571
+ message=message,
572
+ description=description
573
+ )
346
574
  #* Return proper response
347
575
  if not controller_result.success:
348
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail.model_validate(controller_result.content)
576
+ return (
577
+ MaleoIdentityUserOrganizationRoleClientResultsTransfers
578
+ .Fail
579
+ .model_validate(controller_result.content)
580
+ )
349
581
  else:
350
- return MaleoIdentityUserOrganizationRoleClientResultsTransfers.SingleData.model_validate(controller_result.content)
582
+ return (
583
+ MaleoIdentityUserOrganizationRoleClientResultsTransfers
584
+ .SingleData
585
+ .model_validate(controller_result.content)
586
+ )
351
587
  return await _impl()