# Copyright (c) CloudZero - ALL RIGHTS RESERVED - PROPRIETARY AND CONFIDENTIAL
# Unauthorized copying of this file and/or project, via any medium is strictly prohibited.
# Direct all questions to legal@cloudzero.com
#

"""
CZ-OPS CLI Settings package.

This package provides the settings management system including version migration
capabilities for the CloudZero operations CLI.
"""

# Import all public API elements for backward compatibility
from src.settings.constants import (
    CURRENT_SETTINGS_VERSION,
    LATEST_VERSION,
    MINIMUM_SUPPORTED_VERSION,
    VERSION_COMPATIBILITY,
    get_minimum_required_version,
    validate_settings_version,
)
from src.settings.migrations import (
    SETTINGS_MIGRATIONS,
    SettingsMigration,
    SettingsMigrationError,
    SettingsTooOldError,
    apply_migrations,
    backup_and_reset_settings,
    backup_settings_file,
    load_and_migrate_settings,
)
from src.settings.settings import (
    ApiV4Settings,
    JsonConfigSettingsSource,
    Settings,
    YamlConfigSettingsSource,
    get_formated_error_messages,
)

# Re-export key constants for backward compatibility
_LEGACY_SETTINGS_FILENAME = "~/.cloudzero/ops_config"
_CZOPS_SETTINGS_FILENAME = "~/.cloudzero/czops.json"

__all__ = [
    # Main classes
    "Settings",
    "ApiV4Settings",
    # Source classes
    "JsonConfigSettingsSource",
    "YamlConfigSettingsSource",
    # Migration classes
    "SettingsMigration",
    "SettingsMigrationError",
    "SettingsTooOldError",
    # Functions
    "get_formated_error_messages",
    "apply_migrations",
    "backup_and_reset_settings",
    "backup_settings_file",
    "load_and_migrate_settings",
    "get_minimum_required_version",
    "validate_settings_version",
    # Constants
    "CURRENT_SETTINGS_VERSION",
    "LATEST_VERSION",
    "MINIMUM_SUPPORTED_VERSION",
    "VERSION_COMPATIBILITY",
    "SETTINGS_MIGRATIONS",
    "_LEGACY_SETTINGS_FILENAME",
    "_CZOPS_SETTINGS_FILENAME",
]
