Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/update reasons #67

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions alice/onboarding/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ 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]]:
"""
Expand All @@ -1205,8 +1204,6 @@ 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
Expand All @@ -1218,7 +1215,6 @@ 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()

Expand Down Expand Up @@ -1414,7 +1410,6 @@ 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]]:
"""
Expand All @@ -1433,8 +1428,6 @@ 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

Expand All @@ -1450,7 +1443,6 @@ def get_authentications(
page_size=page_size,
page=page,
descending=descending,
version=version,
verbose=verbose,
).unwrap_or_return()

Expand All @@ -1468,7 +1460,6 @@ def get_authentication(
self,
user_id: str,
authentication_id: str,
version: Version = Version.DEFAULT,
verbose: bool = False,
) -> Result[Dict[str, Any], Union[OnboardingError, AuthError]]:
"""
Expand All @@ -1481,8 +1472,6 @@ 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

Expand All @@ -1496,7 +1485,6 @@ def get_authentication(
response = self.onboarding_client.get_authentication(
user_id=user_id,
authentication_id=authentication_id,
version=version,
verbose=verbose,
).unwrap_or_return()

Expand Down Expand Up @@ -1700,7 +1688,7 @@ def update_user_state(
user_id: str,
user_state: UserState,
operator: str = "auto",
state_update_reasons: Optional[List[Dict[str, str]]] = None,
update_reasons: Optional[List[Dict[str, str]]] = None,
verbose: bool = False,
) -> Result[bool, OnboardingError]:
"""
Expand All @@ -1713,7 +1701,7 @@ def update_user_state(
User identifier
operator
Who is accepting the user
state_update_reasons
update_reasons
List of reasons for status update
verbose
Used for print service response as well as the time elapsed
Expand All @@ -1727,7 +1715,7 @@ def update_user_state(
user_id=user_id,
user_state=user_state,
operator=operator,
state_update_reasons=state_update_reasons,
update_reasons=update_reasons,
verbose=verbose,
).unwrap_or_return()

Expand Down
18 changes: 3 additions & 15 deletions alice/onboarding/onboarding_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,6 @@ def identify_user(
self,
target_user_id: str,
probe_user_ids: List[str],
version: Version = Version.DEFAULT,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -1373,8 +1372,6 @@ 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

Expand All @@ -1391,7 +1388,6 @@ 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}

Expand Down Expand Up @@ -1628,7 +1624,6 @@ def get_authentications(
page: int = 1,
page_size: int = 0,
descending: bool = True,
version: Version = Version.DEFAULT,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -1645,8 +1640,6 @@ 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

Expand All @@ -1663,7 +1656,6 @@ 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)}"
Expand All @@ -1687,7 +1679,6 @@ def get_authentication(
self,
user_id: str,
authentication_id: str,
version: Version = Version.DEFAULT,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -1700,8 +1691,6 @@ 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

Expand All @@ -1718,7 +1707,6 @@ 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(
Expand Down Expand Up @@ -1954,7 +1942,7 @@ def update_user_state(
user_id: str,
user_state: UserState,
operator: str = "auto",
state_update_reasons: Optional[List[Dict[str, str]]] = None,
update_reasons: Optional[List[Dict[str, str]]] = None,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -1968,7 +1956,7 @@ def update_user_state(
User identifier
operator
Who is accepting the user
state_update_reasons
update_reasons
List of reasons for status update
verbose
Used for print service response as well as the time elapsed
Expand All @@ -1992,7 +1980,7 @@ def update_user_state(
headers=headers,
json={
"state": user_state.value,
"state_update_reasons": state_update_reasons,
"update_reasons": update_reasons,
"operator": operator,
},
timeout=self.timeout,
Expand Down