import logging
import os

logger = logging.getLogger("copernicusmarine")

COPERNICUSMARINE_SERVICE_USERNAME = os.getenv(
    "COPERNICUSMARINE_SERVICE_USERNAME"
) or os.getenv("COPERNICUS_MARINE_SERVICE_USERNAME")
if os.getenv("COPERNICUS_MARINE_SERVICE_USERNAME"):
    logger.warning(
        "COPERNICUS_MARINE_SERVICE_USERNAME is deprecated. "
        "Please use COPERNICUSMARINE_SERVICE_USERNAME instead."
    )
COPERNICUSMARINE_SERVICE_PASSWORD = os.getenv(
    "COPERNICUSMARINE_SERVICE_PASSWORD"
) or os.getenv("COPERNICUS_MARINE_SERVICE_PASSWORD")
if os.getenv("COPERNICUS_MARINE_SERVICE_PASSWORD"):
    logger.warning(
        "COPERNICUS_MARINE_SERVICE_PASSWORD is deprecated. "
        "Please use COPERNICUSMARINE_SERVICE_PASSWORD instead."
    )

COPERNICUSMARINE_CREDENTIALS_DIRECTORY = os.getenv(
    "COPERNICUSMARINE_CREDENTIALS_DIRECTORY"
)

COPERNICUSMARINE_DISABLE_SSL_CONTEXT = os.getenv(
    "COPERNICUSMARINE_DISABLE_SSL_CONTEXT", "False"
)

COPERNICUSMARINE_SET_SSL_CERTIFICATE_PATH = os.getenv(
    "COPERNICUSMARINE_SET_SSL_CERTIFICATE_PATH"
)

COPERNICUSMARINE_TRUST_ENV = os.getenv("COPERNICUSMARINE_TRUST_ENV", "True")

COPERNICUSMARINE_HTTPS_TIMEOUT = os.getenv(
    "COPERNICUSMARINE_HTTPS_TIMEOUT", "60"
)

COPERNICUSMARINE_HTTPS_RETRIES = os.getenv(
    "COPERNICUSMARINE_HTTPS_RETRIES", "5"
)

PROXY_HTTPS = os.getenv("HTTPS_PROXY", "")
PROXY_HTTP = os.getenv("HTTP_PROXY", "")

COPERNICUSMARINE_CONFIG_URL = os.getenv(
    "COPERNICUSMARINE_CONFIG_URL",
)
