from __future__ import annotations

from typing import Any, Protocol


class SpherePayGateway(Protocol):
    """Outbound port defining all SpherePay API operations."""

    # --- Customers ---
    async def create_customer(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_customer(self, customer_id: str) -> dict[str, Any]: ...
    async def list_customers(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def patch_customer(self, customer_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def generate_tos_link(self, customer_id: str) -> dict[str, Any]: ...
    async def generate_kyc_link(self, customer_id: str) -> dict[str, Any]: ...
    async def send_otp(self, customer_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def verify_otp(self, customer_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def generate_face_verification_link(self, customer_id: str) -> dict[str, Any]: ...
    async def submit_verification(self, customer_id: str) -> dict[str, Any]: ...

    # --- Bank Accounts ---
    async def create_bank_account(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_bank_account(self, bank_account_id: str) -> dict[str, Any]: ...
    async def list_bank_accounts(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def delete_bank_account(self, bank_account_id: str) -> dict[str, Any]: ...
    async def update_bank_account(self, bank_account_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...

    # --- Wallets ---
    async def create_wallet(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_wallet(self, wallet_id: str) -> dict[str, Any]: ...
    async def list_wallets(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def delete_wallet(self, wallet_id: str) -> dict[str, Any]: ...

    # --- Transfers ---
    async def create_transfer(self, payload: dict[str, Any], idempotency_key: str | None = None) -> dict[str, Any]: ...
    async def get_transfer(self, transfer_id: str) -> dict[str, Any]: ...
    async def list_transfers(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def cancel_transfer(self, transfer_id: str) -> dict[str, Any]: ...

    # --- Documents ---
    async def upload_document(self, payload: dict[str, Any]) -> dict[str, Any]: ...

    # --- Business Representatives ---
    async def create_business_rep(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_business_rep(self, rep_id: str) -> dict[str, Any]: ...
    async def list_business_reps(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def patch_business_rep(self, rep_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def delete_business_rep(self, rep_id: str) -> dict[str, Any]: ...
    async def generate_rep_face_verification_link(self, rep_id: str) -> dict[str, Any]: ...
    async def submit_rep_verification(self, rep_id: str) -> dict[str, Any]: ...

    # --- Offloader Wallets ---
    async def create_offloader_wallet(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_offloader_wallet(self, wallet_id: str) -> dict[str, Any]: ...
    async def list_offloader_wallets(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def update_offloader_wallet(self, wallet_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...

    # --- Virtual Accounts ---
    async def create_virtual_account(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_virtual_account(self, virtual_account_id: str) -> dict[str, Any]: ...
    async def list_virtual_accounts(self, params: dict[str, Any]) -> dict[str, Any]: ...
    async def update_virtual_account(self, virtual_account_id: str, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def deactivate_virtual_account(self, virtual_account_id: str) -> dict[str, Any]: ...
    async def reactivate_virtual_account(self, virtual_account_id: str) -> dict[str, Any]: ...
    async def list_virtual_account_transfers(
        self, virtual_account_id: str, params: dict[str, Any]
    ) -> dict[str, Any]: ...

    # --- Webhooks ---
    async def create_webhook(self, payload: dict[str, Any]) -> dict[str, Any]: ...
    async def get_webhook(self, webhook_id: str) -> dict[str, Any]: ...

    # --- Events ---
    async def get_event(self, event_id: str) -> dict[str, Any]: ...

    # --- CCTP ---
    async def submit_cctp_offramp(self, payload: dict[str, Any]) -> dict[str, Any]: ...
