"""Nextcloud service definition.

Nextcloud is included as a proof-of-concept third-party service. It has no
dashboard widgets yet; its service page holds connection config only.
"""

from __future__ import annotations

from media_library_viewer_api.integrations.base import (
    SecretField,
    ServiceBaseUrl,
    ServiceConfigBase,
    ServiceDefinition,
)


class NextcloudConfig(ServiceConfigBase):
    """Non-secret Nextcloud connection config."""

    base_url: ServiceBaseUrl
    username: str = ""


DEFINITION = ServiceDefinition(
    service_type="nextcloud",
    name="Nextcloud",
    description="Self-hosted files and collaboration.",
    config_model=NextcloudConfig,
    secret_fields=[
        SecretField(key="app_password", label="App password", required=True),
    ],
    widget_kinds=[],
)
