# base_exporter.py
#
# Copyright 2025 Pavel Baksy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: GPL-3.0-or-later

from abc import ABC, abstractmethod
from ..models import HttpRequest


class BaseExporter(ABC):
    """Abstract base class for request exporters."""

    @abstractmethod
    def export(self, request: HttpRequest) -> str:
        """
        Export HTTP request to target format.

        Args:
            request: HttpRequest with method, url, headers, body

        Returns:
            Formatted export string
        """
        pass

    @property
    @abstractmethod
    def format_name(self) -> str:
        """Human-readable format name (e.g., 'cURL', 'Insomnia')."""
        pass

    @property
    @abstractmethod
    def file_extension(self) -> str:
        """File extension for export (e.g., 'sh', 'json')."""
        pass
