# Info: UpCloud provider dependencies for batch provisioning workflows (Provisioning)
# Author: Claude Code Agent 7
# Release: 2.0.0
# Date: 2025-09-25
import provisioning

schema NetworkDependencies:
    """Network dependency configuration"""
    private_networks_first: bool = True
    public_networks_managed: bool = True
    network_timeout: int = 300
    network_wait: int = 5

schema ServerDependencies:
    """Server dependency configuration"""
    requires: [str] = ["networks", "ssh_keys"]
    batch_size: int = 5
    batch_wait: int = 30
    max_concurrent: int = 3
    creation_timeout: int = 15

schema StorageDependencies:
    """Storage dependency configuration"""
    flexible_timing: bool = True
    attached_requires_server: bool = True
    batch_size: int = 10
    operation_timeout: int = 10

schema ApiLimits:
    """API rate limits and constraints"""
    requests_per_minute: int = 300
    burst_requests: int = 50
    api_call_delay: int = 200
    max_retries: int = 3
    backoff_multiplier: float = 1.5

schema SharedResources:
    """Shared resources configuration"""
    ssh_keys_shared: bool = True
    networks_shared: bool = False
    storage_shared: bool = False
    firewall_shared: bool = True

schema Lifecycle:
    """Resource lifecycle management"""
    safe_delete: [str] = ["servers", "storage", "networks"]
    confirm_delete: [str] = ["ssh_keys", "shared_networks"]
    protected: [str] = ["payment_methods", "account_settings"]
    cleanup_order: [str] = ["loadbalancers", "storage", "servers", "ssh_keys", "security_groups", "networks"]

schema CrossProvider:
    """Cross-provider compatibility"""
    aws_compatible: bool = True
    local_compatible: bool = True
    mixed_deployments: bool = True
    naming_conflicts: [str] = ["default", "main", "primary"]

schema Validation:
    """Validation and health checks"""
    network_connectivity: bool = True
    ssh_key_validation: bool = True
    zone_validation: bool = True
    quota_validation: bool = True

schema UpCloudDependencies:
    """
    UpCloud provider dependency management for batch workflows
    """
    # Resource creation order and dependencies
    resource_order: [str] = ["networks", "security_groups", "ssh_keys", "servers", "storage", "loadbalancers"]

    # Configuration sections
    network_dependencies: NetworkDependencies = NetworkDependencies {}
    server_dependencies: ServerDependencies = ServerDependencies {}
    storage_dependencies: StorageDependencies = StorageDependencies {}
    api_limits: ApiLimits = ApiLimits {}
    shared_resources: SharedResources = SharedResources {}
    lifecycle: Lifecycle = Lifecycle {}
    cross_provider: CrossProvider = CrossProvider {}
    validation: Validation = Validation {}

# Default dependency configuration for UpCloud provider
upcloud_dependencies: UpCloudDependencies = UpCloudDependencies {}
