From 812d1a31b0943bdf10af3c702388f6607f001e4e Mon Sep 17 00:00:00 2001 From: milorenzo <59612324+miguel-lorenzo@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:06:21 +0200 Subject: [PATCH] Revert "Fix/update reasons" --- alice/onboarding/onboarding.py | 18 +++++++++++++++--- alice/onboarding/onboarding_client.py | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/alice/onboarding/onboarding.py b/alice/onboarding/onboarding.py index 1396719..b62e4f1 100644 --- a/alice/onboarding/onboarding.py +++ b/alice/onboarding/onboarding.py @@ -1193,6 +1193,7 @@ def identify_user( self, target_user_id: str, probe_user_ids: List[str], + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[bool, Union[OnboardingError, AuthError]]: """ @@ -1204,6 +1205,8 @@ def identify_user( User identifier (Target) probe_user_ids List of user identifier to match against (N Probes) + version + Set Identify version verbose Used for print service response as well as the time elapsed Returns @@ -1215,6 +1218,7 @@ def identify_user( response = self.onboarding_client.identify_user( target_user_id=target_user_id, probe_user_ids=probe_user_ids, + version=version, verbose=verbose, ).unwrap_or_return() @@ -1410,6 +1414,7 @@ def get_authentications( page: int = 1, page_size: int = 0, descending: bool = True, + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[List[Dict[str, Any]], Union[OnboardingError, AuthError]]: """ @@ -1428,6 +1433,8 @@ def get_authentications( Numbers of authentications per page that will be returned. To return all the authentications select 0. descending Order of the authentications according to their creation date. + version + Set Authentication Version verbose Used for print service response as well as the time elapsed @@ -1443,6 +1450,7 @@ def get_authentications( page_size=page_size, page=page, descending=descending, + version=version, verbose=verbose, ).unwrap_or_return() @@ -1460,6 +1468,7 @@ def get_authentication( self, user_id: str, authentication_id: str, + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[Dict[str, Any], Union[OnboardingError, AuthError]]: """ @@ -1472,6 +1481,8 @@ def get_authentication( User identifier authentication_id Authentication identifier + version + Set Authentication Version verbose Used for print service response as well as the time elapsed @@ -1485,6 +1496,7 @@ def get_authentication( response = self.onboarding_client.get_authentication( user_id=user_id, authentication_id=authentication_id, + version=version, verbose=verbose, ).unwrap_or_return() @@ -1688,7 +1700,7 @@ def update_user_state( user_id: str, user_state: UserState, operator: str = "auto", - update_reasons: Optional[List[Dict[str, str]]] = None, + state_update_reasons: Optional[List[Dict[str, str]]] = None, verbose: bool = False, ) -> Result[bool, OnboardingError]: """ @@ -1701,7 +1713,7 @@ def update_user_state( User identifier operator Who is accepting the user - update_reasons + state_update_reasons List of reasons for status update verbose Used for print service response as well as the time elapsed @@ -1715,7 +1727,7 @@ def update_user_state( user_id=user_id, user_state=user_state, operator=operator, - update_reasons=update_reasons, + state_update_reasons=state_update_reasons, verbose=verbose, ).unwrap_or_return() diff --git a/alice/onboarding/onboarding_client.py b/alice/onboarding/onboarding_client.py index 2da0b11..40fc75c 100644 --- a/alice/onboarding/onboarding_client.py +++ b/alice/onboarding/onboarding_client.py @@ -1361,6 +1361,7 @@ def identify_user( self, target_user_id: str, probe_user_ids: List[str], + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[Response, Error]: """ @@ -1372,6 +1373,8 @@ def identify_user( User identifier (Target) probe_user_ids List of user identifier to match against (N Probes) + version + Set Identify Version verbose Used for print service response as well as the time elapsed @@ -1388,6 +1391,7 @@ def identify_user( print_token("backend_token_with_user", backend_user_token, verbose=verbose) headers = self._auth_headers(backend_user_token) + headers["Alice-Identify-Version"] = version.value data = {"user_ids": probe_user_ids} @@ -1624,6 +1628,7 @@ def get_authentications( page: int = 1, page_size: int = 0, descending: bool = True, + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[Response, Error]: """ @@ -1640,6 +1645,8 @@ def get_authentications( Numbers of authentications that will be returned for each page. To return all the authentications select 0. descending Order of the authentications according to their creation date. + version + Set Authentication Version verbose Used for print service response as well as the time elapsed @@ -1656,6 +1663,7 @@ def get_authentications( print_token("backend_token_with_user", backend_user_token, verbose=verbose) headers = self._auth_headers(backend_user_token) + headers["Alice-Authentication-Version"] = version.value url_query_params = ( f"?page={str(page)}&page_size={str(page_size)}&descending={str(descending)}" @@ -1679,6 +1687,7 @@ def get_authentication( self, user_id: str, authentication_id: str, + version: Version = Version.DEFAULT, verbose: bool = False, ) -> Result[Response, Error]: """ @@ -1691,6 +1700,8 @@ def get_authentication( User identifier authentication_id Authentication identifier. + version + Set Authentication Version verbose Used for print service response as well as the time elapsed @@ -1707,6 +1718,7 @@ def get_authentication( print_token("backend_token_with_user", backend_user_token, verbose=verbose) headers = self._auth_headers(backend_user_token) + headers["Alice-Authentication-Version"] = version.value try: response = self.session.get( @@ -1942,7 +1954,7 @@ def update_user_state( user_id: str, user_state: UserState, operator: str = "auto", - update_reasons: Optional[List[Dict[str, str]]] = None, + state_update_reasons: Optional[List[Dict[str, str]]] = None, verbose: bool = False, ) -> Result[Response, Error]: """ @@ -1956,7 +1968,7 @@ def update_user_state( User identifier operator Who is accepting the user - update_reasons + state_update_reasons List of reasons for status update verbose Used for print service response as well as the time elapsed @@ -1980,7 +1992,7 @@ def update_user_state( headers=headers, json={ "state": user_state.value, - "update_reasons": update_reasons, + "state_update_reasons": state_update_reasons, "operator": operator, }, timeout=self.timeout,