# AUTO-GENERATED FILE - DO NOT EDIT
# This file was automatically generated by the XDK build tool.
# Any manual changes will be overwritten on the next generation.
"""
Auto-generated structural tests for {"class_name": "Activity", "display_name": "activity", "import_name": "activity", "original": ["activity"], "property_name": "activity"} client.

This module contains tests that validate the structure and API surface
of the {"class_name": "Activity", "display_name": "activity", "import_name": "activity", "original": ["activity"], "property_name": "activity"} client. These tests ensure that all expected methods
exist, have correct signatures, and proper type annotations for robust API contracts.

Generated automatically - do not edit manually.
"""

import pytest
import inspect
from typing import get_type_hints
from xdk.activity.client import ActivityClient
from xdk import Client


class TestActivityStructure:
    """Test the structure of ActivityClient."""


    def setup_class(self):
        """Set up test fixtures."""
        self.client = Client(base_url="https://api.example.com")
        self.activity_client = getattr(self.client, "activity")


    def test_get_subscriptions_exists(self):
        """Test that get_subscriptions method exists with correct signature."""
        # Check method exists
        method = getattr(ActivityClient, "get_subscriptions", None)
        assert (
            method is not None
        ), f"Method get_subscriptions does not exist on ActivityClient"
        # Check method is callable
        assert callable(method), f"get_subscriptions is not callable"
        # Check method signature
        sig = inspect.signature(method)
        params = list(sig.parameters.keys())
        # Should have 'self' as first parameter
        assert (
            len(params) >= 1
        ), f"get_subscriptions should have at least 'self' parameter"
        assert (
            params[0] == "self"
        ), f"First parameter should be 'self', got '{params[0]}'"
        # Check required parameters exist (excluding 'self')
        required_params = []
        for required_param in required_params:
            assert (
                required_param in params
            ), f"Required parameter '{required_param}' missing from get_subscriptions"
        # Check optional parameters have defaults (excluding 'self')
        optional_params = []
        for optional_param in optional_params:
            if optional_param in params:
                param_obj = sig.parameters[optional_param]
                assert (
                    param_obj.default is not inspect.Parameter.empty
                ), f"Optional parameter '{optional_param}' should have a default value"


    def test_get_subscriptions_return_annotation(self):
        """Test that get_subscriptions has proper return type annotation."""
        method = getattr(ActivityClient, "get_subscriptions")
        sig = inspect.signature(method)
        # Check return annotation exists
        assert (
            sig.return_annotation is not inspect.Signature.empty
        ), f"Method get_subscriptions should have return type annotation"


    def test_create_subscription_exists(self):
        """Test that create_subscription method exists with correct signature."""
        # Check method exists
        method = getattr(ActivityClient, "create_subscription", None)
        assert (
            method is not None
        ), f"Method create_subscription does not exist on ActivityClient"
        # Check method is callable
        assert callable(method), f"create_subscription is not callable"
        # Check method signature
        sig = inspect.signature(method)
        params = list(sig.parameters.keys())
        # Should have 'self' as first parameter
        assert (
            len(params) >= 1
        ), f"create_subscription should have at least 'self' parameter"
        assert (
            params[0] == "self"
        ), f"First parameter should be 'self', got '{params[0]}'"
        # Check required parameters exist (excluding 'self')
        required_params = []
        for required_param in required_params:
            assert (
                required_param in params
            ), f"Required parameter '{required_param}' missing from create_subscription"
        # Check optional parameters have defaults (excluding 'self')
        optional_params = []
        for optional_param in optional_params:
            if optional_param in params:
                param_obj = sig.parameters[optional_param]
                assert (
                    param_obj.default is not inspect.Parameter.empty
                ), f"Optional parameter '{optional_param}' should have a default value"


    def test_create_subscription_return_annotation(self):
        """Test that create_subscription has proper return type annotation."""
        method = getattr(ActivityClient, "create_subscription")
        sig = inspect.signature(method)
        # Check return annotation exists
        assert (
            sig.return_annotation is not inspect.Signature.empty
        ), f"Method create_subscription should have return type annotation"


    def test_update_subscription_exists(self):
        """Test that update_subscription method exists with correct signature."""
        # Check method exists
        method = getattr(ActivityClient, "update_subscription", None)
        assert (
            method is not None
        ), f"Method update_subscription does not exist on ActivityClient"
        # Check method is callable
        assert callable(method), f"update_subscription is not callable"
        # Check method signature
        sig = inspect.signature(method)
        params = list(sig.parameters.keys())
        # Should have 'self' as first parameter
        assert (
            len(params) >= 1
        ), f"update_subscription should have at least 'self' parameter"
        assert (
            params[0] == "self"
        ), f"First parameter should be 'self', got '{params[0]}'"
        # Check required parameters exist (excluding 'self')
        required_params = [
            "subscription_id",
        ]
        for required_param in required_params:
            assert (
                required_param in params
            ), f"Required parameter '{required_param}' missing from update_subscription"
        # Check optional parameters have defaults (excluding 'self')
        optional_params = []
        for optional_param in optional_params:
            if optional_param in params:
                param_obj = sig.parameters[optional_param]
                assert (
                    param_obj.default is not inspect.Parameter.empty
                ), f"Optional parameter '{optional_param}' should have a default value"


    def test_update_subscription_return_annotation(self):
        """Test that update_subscription has proper return type annotation."""
        method = getattr(ActivityClient, "update_subscription")
        sig = inspect.signature(method)
        # Check return annotation exists
        assert (
            sig.return_annotation is not inspect.Signature.empty
        ), f"Method update_subscription should have return type annotation"


    def test_delete_subscription_exists(self):
        """Test that delete_subscription method exists with correct signature."""
        # Check method exists
        method = getattr(ActivityClient, "delete_subscription", None)
        assert (
            method is not None
        ), f"Method delete_subscription does not exist on ActivityClient"
        # Check method is callable
        assert callable(method), f"delete_subscription is not callable"
        # Check method signature
        sig = inspect.signature(method)
        params = list(sig.parameters.keys())
        # Should have 'self' as first parameter
        assert (
            len(params) >= 1
        ), f"delete_subscription should have at least 'self' parameter"
        assert (
            params[0] == "self"
        ), f"First parameter should be 'self', got '{params[0]}'"
        # Check required parameters exist (excluding 'self')
        required_params = [
            "subscription_id",
        ]
        for required_param in required_params:
            assert (
                required_param in params
            ), f"Required parameter '{required_param}' missing from delete_subscription"
        # Check optional parameters have defaults (excluding 'self')
        optional_params = []
        for optional_param in optional_params:
            if optional_param in params:
                param_obj = sig.parameters[optional_param]
                assert (
                    param_obj.default is not inspect.Parameter.empty
                ), f"Optional parameter '{optional_param}' should have a default value"


    def test_delete_subscription_return_annotation(self):
        """Test that delete_subscription has proper return type annotation."""
        method = getattr(ActivityClient, "delete_subscription")
        sig = inspect.signature(method)
        # Check return annotation exists
        assert (
            sig.return_annotation is not inspect.Signature.empty
        ), f"Method delete_subscription should have return type annotation"


    def test_stream_exists(self):
        """Test that stream method exists with correct signature."""
        # Check method exists
        method = getattr(ActivityClient, "stream", None)
        assert method is not None, f"Method stream does not exist on ActivityClient"
        # Check method is callable
        assert callable(method), f"stream is not callable"
        # Check method signature
        sig = inspect.signature(method)
        params = list(sig.parameters.keys())
        # Should have 'self' as first parameter
        assert len(params) >= 1, f"stream should have at least 'self' parameter"
        assert (
            params[0] == "self"
        ), f"First parameter should be 'self', got '{params[0]}'"
        # Check required parameters exist (excluding 'self')
        required_params = []
        for required_param in required_params:
            assert (
                required_param in params
            ), f"Required parameter '{required_param}' missing from stream"
        # Check optional parameters have defaults (excluding 'self')
        optional_params = [
            "backfill_minutes",
            "start_time",
            "end_time",
        ]
        for optional_param in optional_params:
            if optional_param in params:
                param_obj = sig.parameters[optional_param]
                assert (
                    param_obj.default is not inspect.Parameter.empty
                ), f"Optional parameter '{optional_param}' should have a default value"


    def test_stream_return_annotation(self):
        """Test that stream has proper return type annotation."""
        method = getattr(ActivityClient, "stream")
        sig = inspect.signature(method)
        # Check return annotation exists
        assert (
            sig.return_annotation is not inspect.Signature.empty
        ), f"Method stream should have return type annotation"


    def test_all_expected_methods_exist(self):
        """Test that all expected methods exist on the client."""
        expected_methods = [
            "get_subscriptions",
            "create_subscription",
            "update_subscription",
            "delete_subscription",
            "stream",
        ]
        for expected_method in expected_methods:
            assert hasattr(
                ActivityClient, expected_method
            ), f"Expected method '{expected_method}' not found on ActivityClient"
            assert callable(
                getattr(ActivityClient, expected_method)
            ), f"'{expected_method}' exists but is not callable"
