#    Copyright 2025 Genesis Corporation.
#
#    All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import typing as tp

from gcl_sdk.common import exceptions
from gcl_sdk.agents.universal.dm import models


class AgentDriverException(exceptions.UniversalAgentException):
    __template__ = "An unknown agent driver exception occurred."


class ResourceAlreadyExists(AgentDriverException):
    __template__ = "The resource already exists: {resource}"
    resource: models.Resource


class ResourceNotFound(AgentDriverException):
    __template__ = "The resource not found: {resource}"
    resource: models.Resource


class InvalidDataPlaneObjectError(AgentDriverException):
    """The data plane object is invalid exception.

    The exception is thrown when the data plane object is invalid
    and driver expects it will be called to recreate the DP object.
    """

    __template__ = "The data plane object is invalid: {obj}"
    obj: tp.Any
