diff --git a/alice/onboarding/onboarding.py b/alice/onboarding/onboarding.py index 5d0a3cf..71c6557 100644 --- a/alice/onboarding/onboarding.py +++ b/alice/onboarding/onboarding.py @@ -1743,7 +1743,7 @@ def retrieve_flow( ).unwrap_or_return() if response.status_code == 200: - return Success(response.content) + return Success(response.json()) else: return Failure( OnboardingError.from_response( @@ -1773,7 +1773,7 @@ def retrieve_flows( ).unwrap_or_return() if response.status_code == 200: - return Success(response.content) + return Success(response.json()) else: return Failure( OnboardingError.from_response( diff --git a/alice/webhooks/webhooks.py b/alice/webhooks/webhooks.py index 41a7fe4..76058e5 100644 --- a/alice/webhooks/webhooks.py +++ b/alice/webhooks/webhooks.py @@ -70,16 +70,10 @@ def get_subscriptable_events( else: return Failure( OnboardingError.from_response( - operation="get_available_events", response=response + operation="get_subscriptable_events", response=response ) ) - @early_return - def get_available_events( - self, verbose: Optional[bool] = False - ) -> Result[bool, Union[OnboardingError, AuthError]]: - return self.get_subscriptable_events(verbose) - @early_return def create_webhook( self, webhook: Webhook, verbose: Optional[bool] = False diff --git a/alice/webhooks/webhooks_client.py b/alice/webhooks/webhooks_client.py index 7ca3fcc..7d81262 100644 --- a/alice/webhooks/webhooks_client.py +++ b/alice/webhooks/webhooks_client.py @@ -68,13 +68,6 @@ def get_subscriptable_events( return Success(response) - @early_return - @timeit - def get_available_events( - self, verbose: Optional[bool] = False - ) -> Result[Response, AuthError]: - return self.get_available_events(verbose) # type: ignore - @early_return @timeit def create_webhook( diff --git a/tests/test_integration_webhooks.py b/tests/test_integration_webhooks.py index c1224f0..4b2adaf 100644 --- a/tests/test_integration_webhooks.py +++ b/tests/test_integration_webhooks.py @@ -25,7 +25,7 @@ def test_should_execute_all_webhook_lifecycle(given_valid_api_key): webhooks_client = Webhooks.from_config(config) # Check Available events - result = webhooks_client.get_available_events() + result = webhooks_client.get_subscriptable_events() assert_success(result, value_is_instance_of=list) selected_event = result.value[0]