# Copyright (c) 2023 BigRep GmbH based on file: ./UltimakerCloudConstants.py
# Cura is released under the terms of the LGPLv3 or higher.

# ---------
# Constants used for the Cloud API
# ---------
DEFAULT_CLOUD_API_ROOT = ""  # type: str
DEFAULT_CLOUD_API_VERSION = "1"  # type: str
DEFAULT_CLOUD_ACCOUNT_API_ROOT = "https://idp.qa-serviceplatform.bigrep.com/auth/realms/bigrep/protocol/openid-connect"  # type: str
DEFAULT_DIGITAL_FACTORY_URL = ""  # type: str

DEFAULT_SERVICE_PLATFORM_API_ROOT = "https://qa-serviceplatform.bigrep.com"
DEFAULT_CONNECT_API_ROOT = "https://qa-connect.bigrep.com"  # type: str
DEFAULT_CONNECT_AUTH = "https://blade-auth.qa-connect.bigrep.com"

# Container Metadata keys
META_UM_LINKED_TO_ACCOUNT = "um_linked_to_account"
"""(bool) Whether a cloud printer is linked to a BigRep connect account"""

META_CAPABILITIES = "capabilities"
"""(list[str]) a list of capabilities this printer supports"""

try:
    from cura.CuraVersion import CuraCloudAPIRoot  # type: ignore
    if CuraCloudAPIRoot == "":
        CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT
except ImportError:
    CuraCloudAPIRoot = DEFAULT_CLOUD_API_ROOT

try:
    from cura.CuraVersion import CuraCloudAPIVersion  # type: ignore
    if CuraCloudAPIVersion == "":
        CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION
except ImportError:
    CuraCloudAPIVersion = DEFAULT_CLOUD_API_VERSION

try:
    from cura.CuraVersion import CuraCloudAccountAPIRoot  # type: ignore
    if CuraCloudAccountAPIRoot == "":
        CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT
except ImportError:
    CuraCloudAccountAPIRoot = DEFAULT_CLOUD_ACCOUNT_API_ROOT

try:
    from cura.CuraVersion import CuraDigitalFactoryURL # type: ignore
    if CuraDigitalFactoryURL == "":
        CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL
except ImportError:
    CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL

try:
    from cura.CuraVersion import CuraDigitalFactoryURL # type: ignore
    if CuraDigitalFactoryURL == "":
        CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL
except ImportError:
    CuraDigitalFactoryURL = DEFAULT_DIGITAL_FACTORY_URL

try:
    from cura.CuraVersion import BigRepServicePlatformAPIRoot # type: ignore
    if BigRepServicePlatformAPIRoot == "":
        BigRepServicePlatformAPIRoot = DEFAULT_SERVICE_PLATFORM_API_ROOT
except ImportError:
    BigRepServicePlatformAPIRoot = DEFAULT_SERVICE_PLATFORM_API_ROOT

try:
    from cura.CuraVersion import BigRepConnectAPIRoot # type: ignore
    if BigRepConnectAPIRoot == "":
        BigRepConnectAPIRoot = DEFAULT_CONNECT_API_ROOT
except ImportError:
    BigRepConnectAPIRoot = DEFAULT_CONNECT_API_ROOT

try:
    from cura.CuraVersion import BigRepConnectAuth # type: ignore
    if BigRepConnectAuth == "":
        BigRepConnectAuth = DEFAULT_CONNECT_AUTH
except ImportError:
    BigRepConnectAuth = DEFAULT_CONNECT_AUTH