From 789d76a5463049f6e4245db210e6e97dd1e4c02d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Garc=C3=ADa=20Salom=C3=B3n?= Date: Tue, 22 Aug 2023 10:29:04 +0200 Subject: [PATCH] feat: allow passing flow ID as input --- alice/onboarding/onboarding.py | 4 ++++ alice/onboarding/onboarding_client.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/alice/onboarding/onboarding.py b/alice/onboarding/onboarding.py index c29bc62..d83aa70 100644 --- a/alice/onboarding/onboarding.py +++ b/alice/onboarding/onboarding.py @@ -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]: """ @@ -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 @@ -1817,6 +1820,7 @@ def create_flow( steps=steps, default=default, name=name, + id_=id_, verbose=verbose, ).unwrap_or_return() diff --git a/alice/onboarding/onboarding_client.py b/alice/onboarding/onboarding_client.py index 9f9d97a..3ba8954 100644 --- a/alice/onboarding/onboarding_client.py +++ b/alice/onboarding/onboarding_client.py @@ -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]: """ @@ -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 @@ -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",