Skip to content

Commit

Permalink
feat: allow passing flow ID as input
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsalomon committed Aug 22, 2023
1 parent 36f92ed commit 789d76a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alice/onboarding/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,7 @@ def create_flow(
steps: List[OnboardingSteps],
default: bool,
name: str,
id_: Union[str, None] = None,
verbose: bool = False,
) -> Result[str, OnboardingError]:
"""
Expand All @@ -1805,6 +1806,8 @@ def create_flow(
Mark the Flow as the default flow to the users of the client
name
The name of the flow
id_
UUID for the flow [Optional]
verbose
Used for print service response as well as the time elapsed
Returns
Expand All @@ -1817,6 +1820,7 @@ def create_flow(
steps=steps,
default=default,
name=name,
id_=id_,
verbose=verbose,
).unwrap_or_return()

Expand Down
6 changes: 6 additions & 0 deletions alice/onboarding/onboarding_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2059,6 +2059,7 @@ def create_flow(
steps: List[OnboardingSteps],
default: bool,
name: str,
id_: Union[str, None] = None,
verbose: bool = False,
) -> Result[Response, Error]:
"""
Expand All @@ -2073,6 +2074,8 @@ def create_flow(
Set the flow as default for all new client users
name
The name of the flow
id_
UUID for the flow [Optional]
verbose
Used for print service response as well as the time elapsed
Returns
Expand All @@ -2092,6 +2095,9 @@ def create_flow(
"steps": [step.value for step in steps],
}

if id_:
data.update({"id": id_})

try:
response = requests.post(
f"{self.url}/flow",
Expand Down

0 comments on commit 789d76a

Please sign in to comment.