Skip to content

Commit

Permalink
feat: add state_update_reasons to function update_user_state (#66)
Browse files Browse the repository at this point in the history
* feat: add state_update_reasons to function update_user_state

* fix: typo error in state_update_reasons

* fix: typo error in state_update_reasons of onboarding
  • Loading branch information
jask90 authored Jun 29, 2023
1 parent 46c6b36 commit 2ecf68d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion alice/onboarding/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,7 @@ def update_user_state(
user_id: str,
user_state: UserState,
operator: str = "auto",
state_update_reasons: Optional[List[Dict[str, str]]] = None,
verbose: bool = False,
) -> Result[bool, OnboardingError]:
"""
Expand All @@ -1712,6 +1713,8 @@ def update_user_state(
User identifier
operator
Who is accepting the user
state_update_reasons
List of reasons for status update
verbose
Used for print service response as well as the time elapsed
Returns
Expand All @@ -1721,7 +1724,11 @@ def update_user_state(
"""
verbose = self.verbose or verbose
response = self.onboarding_client.update_user_state(
user_id=user_id, user_state=user_state, operator=operator, verbose=verbose
user_id=user_id,
user_state=user_state,
operator=operator,
state_update_reasons=state_update_reasons,
verbose=verbose,
).unwrap_or_return()

if response.status_code == 200:
Expand Down
4 changes: 4 additions & 0 deletions alice/onboarding/onboarding_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,7 @@ def update_user_state(
user_id: str,
user_state: UserState,
operator: str = "auto",
state_update_reasons: Optional[List[Dict[str, str]]] = None,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -1967,6 +1968,8 @@ def update_user_state(
User identifier
operator
Who is accepting the user
state_update_reasons
List of reasons for status update
verbose
Used for print service response as well as the time elapsed
Expand All @@ -1989,6 +1992,7 @@ def update_user_state(
headers=headers,
json={
"state": user_state.value,
"state_update_reasons": state_update_reasons,
"operator": operator,
},
timeout=self.timeout,
Expand Down

0 comments on commit 2ecf68d

Please sign in to comment.