@@ -2297,6 +2297,24 @@ def get_client_installation_provider(self, client_id: str, provider_id: str) ->
22972297 )
22982298 return raise_error_from_response (data_raw , KeycloakGetError , expected_codes = [HTTP_OK ])
22992299
2300+ def get_realm_users_profile (self ) -> dict :
2301+ """
2302+ Get list of attributes and group for given realm.
2303+
2304+ Related documentation:
2305+ https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#_get_adminrealmsrealmusersprofile
2306+
2307+ Return https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#UPConfig
2308+ :returns: UPConfig
2309+
2310+ """
2311+ params_path = {"realm-name" : self .connection .realm_name }
2312+
2313+ data_raw = self .connection .raw_get (
2314+ urls_patterns .URL_ADMIN_REALM_USER_PROFILE .format (** params_path ),
2315+ )
2316+ return raise_error_from_response (data_raw , KeycloakGetError , expected_codes = [HTTP_OK ])
2317+
23002318 def get_realm_roles (self , brief_representation : bool = True , search_text : str = "" ) -> list :
23012319 """
23022320 Get all roles for the realm or client.
@@ -2911,6 +2929,26 @@ def update_realm_role(self, role_name: str, payload: dict) -> bytes:
29112929 expected_codes = [HTTP_NO_CONTENT ],
29122930 )
29132931
2932+ def update_realm_users_profile (self , payload : dict ) -> dict :
2933+ """
2934+ Update realm users profile for the current realm.
2935+
2936+ :param up_config: List of attributes, groups, unmamagedAttributePolicy
2937+
2938+ Related documentation:
2939+ https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#UPConfig
2940+ """
2941+ params_path = {"realm-name" : self .connection .realm_name }
2942+ data_raw = self .connection .raw_put (
2943+ urls_patterns .URL_ADMIN_REALM_USER_PROFILE .format (** params_path ),
2944+ data = json .dumps (payload ),
2945+ )
2946+ return raise_error_from_response (
2947+ data_raw ,
2948+ KeycloakPutError ,
2949+ expected_codes = [HTTP_OK ],
2950+ )
2951+
29142952 def delete_realm_role (self , role_name : str ) -> bytes :
29152953 """
29162954 Delete a role for the realm by name.
@@ -5490,6 +5528,26 @@ async def a_update_realm(self, realm_name: str, payload: dict) -> dict:
54905528 expected_codes = [HTTP_NO_CONTENT ],
54915529 )
54925530
5531+ async def a_update_realm_users_profile (self , payload : dict ) -> dict :
5532+ """
5533+ Update realm users profile for the current realm.
5534+
5535+ :param up_config: List of attributes, groups, unmamagedAttributePolicy
5536+
5537+ Related documentation:
5538+ https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#UPConfig
5539+ """
5540+ params_path = {"realm-name" : self .connection .realm_name }
5541+ data_raw = await self .connection .a_raw_put (
5542+ urls_patterns .URL_ADMIN_REALM_USER_PROFILE .format (** params_path ),
5543+ data = json .dumps (payload ),
5544+ )
5545+ return raise_error_from_response (
5546+ data_raw ,
5547+ KeycloakPutError ,
5548+ expected_codes = [HTTP_OK ],
5549+ )
5550+
54935551 async def a_delete_realm (self , realm_name : str ) -> bytes :
54945552 """
54955553 Delete a realm asynchronously.
@@ -7391,6 +7449,24 @@ async def a_get_client_installation_provider(self, client_id: str, provider_id:
73917449 )
73927450 return raise_error_from_response (data_raw , KeycloakGetError , expected_codes = [HTTP_OK ])
73937451
7452+ async def a_get_realm_users_profile (self ) -> dict :
7453+ """
7454+ Get list of attributes and group for given realm.
7455+
7456+ Related documentation:
7457+ https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#_get_adminrealmsrealmusersprofile
7458+
7459+ Return https://www.keycloak.org/docs-api/26.0.0/rest-api/index.html#UPConfig
7460+ :returns: UPConfig
7461+
7462+ """
7463+ params_path = {"realm-name" : self .connection .realm_name }
7464+
7465+ data_raw = await self .connection .a_raw_get (
7466+ urls_patterns .URL_ADMIN_REALM_USER_PROFILE .format (** params_path ),
7467+ )
7468+ return raise_error_from_response (data_raw , KeycloakGetError , expected_codes = [HTTP_OK ])
7469+
73947470 async def a_get_realm_roles (
73957471 self ,
73967472 brief_representation : bool = True ,
0 commit comments