# 
# Generated by the nebius.base.protos.compiler.  DO NOT EDIT!
# 

"""Auto-generated Nebius SDK package for ``nebius.common.error.v1alpha1``"""

import builtins as builtins
import collections.abc as abc
import google.protobuf.descriptor as descriptor_1
import google.protobuf.message as message_1
import nebius.api.nebius.common.error.v1alpha1.common_errors_pb2 as common_errors_pb2
import nebius.api.nebius.common.error.v1alpha1.error_pb2 as error_pb2
import nebius.base.protos.descriptor as descriptor
import nebius.base.protos.pb_classes as pb_classes
import nebius.base.protos.pb_enum as pb_enum
import nebius.base.protos.unset as unset
import typing as typing
#@ local imports here @#

# file: nebius/common/error/v1alpha1/common_errors.proto
class BadRequest(pb_classes.Message):
    """
    The request is invalid.
    """
    
    __PB2_CLASS__ = common_errors_pb2.BadRequest
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.BadRequest",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    class Violation(pb_classes.Message):
        __PB2_CLASS__ = common_errors_pb2.BadRequest.Violation
        __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.BadRequest.Violation",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
        __mask_functions__ = {
        }
        
        def __init__(
            self,
            initial_message: message_1.Message|None = None,
            *,
            field: "builtins.str|None|unset.UnsetType" = unset.Unset,
            message: "builtins.str|None|unset.UnsetType" = unset.Unset,
        ) -> None:
            super().__init__(initial_message)
            if not isinstance(field, unset.UnsetType):
                self.field = field
            if not isinstance(message, unset.UnsetType):
                self.message = message
        
        def __dir__(self) ->abc.Iterable[builtins.str]:
            return [
                "field",
                "message",
            ]
        
        @builtins.property
        def field(self) -> "builtins.str":
            """
            What field value is invalid.
            """
            
            return super()._get_field("field", explicit_presence=False,
            )
        @field.setter
        def field(self, value: "builtins.str|None") -> None:
            return super()._set_field("field",value,explicit_presence=False,
            )
        
        @builtins.property
        def message(self) -> "builtins.str":
            """
            Description why the value is invalid, in English.
            """
            
            return super()._get_field("message", explicit_presence=False,
            )
        @message.setter
        def message(self, value: "builtins.str|None") -> None:
            return super()._set_field("message",value,explicit_presence=False,
            )
        
        __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
            "field":"field",
            "message":"message",
        }
        
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        violations: "abc.Iterable[BadRequest.Violation]|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(violations, unset.UnsetType):
            self.violations = violations
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "violations",
            "Violation",
        ]
    
    @builtins.property
    def violations(self) -> "abc.MutableSequence[BadRequest.Violation]":
        """
        Describes all violations.
        """
        
        return super()._get_field("violations", explicit_presence=False,
        wrap=pb_classes.Repeated.with_wrap(BadRequest.Violation,None,None),
        )
    @violations.setter
    def violations(self, value: "abc.Iterable[BadRequest.Violation]|None") -> None:
        return super()._set_field("violations",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "violations":"violations",
        "Violation":"Violation",
    }
    
class BadResourceState(pb_classes.Message):
    """
    The resource we are trying to use, create, change or delete is in a bad state and cannot be used.
    """
    
    __PB2_CLASS__ = common_errors_pb2.BadResourceState
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.BadResourceState",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
        message: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
        if not isinstance(message, unset.UnsetType):
            self.message = message
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "resource_id",
            "message",
        ]
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        ID of the resource which is bad.
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    @builtins.property
    def message(self) -> "builtins.str":
        """
        The reason why this state is bad and cannot be used.
        """
        
        return super()._get_field("message", explicit_presence=False,
        )
    @message.setter
    def message(self, value: "builtins.str|None") -> None:
        return super()._set_field("message",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "resource_id":"resource_id",
        "message":"message",
    }
    
class ResourceNotFound(pb_classes.Message):
    """
    Resource we are trying to interact with does not exist.
    """
    
    __PB2_CLASS__ = common_errors_pb2.ResourceNotFound
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.ResourceNotFound",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "resource_id",
        ]
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        ID of the requested resource.
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "resource_id":"resource_id",
    }
    
class ResourceAlreadyExists(pb_classes.Message):
    """
    Resource we are trying to create already exists.
    """
    
    __PB2_CLASS__ = common_errors_pb2.ResourceAlreadyExists
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.ResourceAlreadyExists",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "resource_id",
        ]
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        ID of the existing resource.
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "resource_id":"resource_id",
    }
    
class ResourceConflict(pb_classes.Message):
    """
    There is a difference between the actual resource state and the expected one.
    """
    
    __PB2_CLASS__ = common_errors_pb2.ResourceConflict
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.ResourceConflict",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
        message: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
        if not isinstance(message, unset.UnsetType):
            self.message = message
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "resource_id",
            "message",
        ]
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        ID of conflicting resource.
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    @builtins.property
    def message(self) -> "builtins.str":
        """
        Detailed info about conflict.
        """
        
        return super()._get_field("message", explicit_presence=False,
        )
    @message.setter
    def message(self, value: "builtins.str|None") -> None:
        return super()._set_field("message",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "resource_id":"resource_id",
        "message":"message",
    }
    
class OperationAborted(pb_classes.Message):
    """
    Operation on the resource has been aborted by a subsequent operation.
    """
    
    __PB2_CLASS__ = common_errors_pb2.OperationAborted
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.OperationAborted",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        operation_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
        aborted_by_operation_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(operation_id, unset.UnsetType):
            self.operation_id = operation_id
        if not isinstance(aborted_by_operation_id, unset.UnsetType):
            self.aborted_by_operation_id = aborted_by_operation_id
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "operation_id",
            "aborted_by_operation_id",
            "resource_id",
        ]
    
    @builtins.property
    def operation_id(self) -> "builtins.str":
        """
        ID of the aborted operation
        """
        
        return super()._get_field("operation_id", explicit_presence=False,
        )
    @operation_id.setter
    def operation_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("operation_id",value,explicit_presence=False,
        )
    
    @builtins.property
    def aborted_by_operation_id(self) -> "builtins.str":
        """
        ID of the subsequent operation
        """
        
        return super()._get_field("aborted_by_operation_id", explicit_presence=False,
        )
    @aborted_by_operation_id.setter
    def aborted_by_operation_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("aborted_by_operation_id",value,explicit_presence=False,
        )
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        Resource ID corresponding to both of the operations
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "operation_id":"operation_id",
        "aborted_by_operation_id":"aborted_by_operation_id",
        "resource_id":"resource_id",
    }
    
class OutOfRange(pb_classes.Message):
    """
    Indicates that element with requested parameters is exceeding the particular range.
    """
    
    __PB2_CLASS__ = common_errors_pb2.OutOfRange
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.OutOfRange",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        requested: "builtins.str|None|unset.UnsetType" = unset.Unset,
        limit: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(requested, unset.UnsetType):
            self.requested = requested
        if not isinstance(limit, unset.UnsetType):
            self.limit = limit
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "requested",
            "limit",
        ]
    
    @builtins.property
    def requested(self) -> "builtins.str":
        """
        Requested value.
        """
        
        return super()._get_field("requested", explicit_presence=False,
        )
    @requested.setter
    def requested(self, value: "builtins.str|None") -> None:
        return super()._set_field("requested",value,explicit_presence=False,
        )
    
    @builtins.property
    def limit(self) -> "builtins.str":
        """
        Available limit.
        """
        
        return super()._get_field("limit", explicit_presence=False,
        )
    @limit.setter
    def limit(self, value: "builtins.str|None") -> None:
        return super()._set_field("limit",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "requested":"requested",
        "limit":"limit",
    }
    
class PermissionDenied(pb_classes.Message):
    """
    Indicates that the action cannot be performed because there are insufficient access rights to a resource.
    """
    
    __PB2_CLASS__ = common_errors_pb2.PermissionDenied
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.PermissionDenied",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        resource_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(resource_id, unset.UnsetType):
            self.resource_id = resource_id
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "resource_id",
        ]
    
    @builtins.property
    def resource_id(self) -> "builtins.str":
        """
        ID of the resource that cannot be accessed.
        """
        
        return super()._get_field("resource_id", explicit_presence=False,
        )
    @resource_id.setter
    def resource_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("resource_id",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "resource_id":"resource_id",
    }
    
class InternalError(pb_classes.Message):
    """
    Generic internal error.
    """
    
    __PB2_CLASS__ = common_errors_pb2.InternalError
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.InternalError",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        request_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
        trace_id: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(request_id, unset.UnsetType):
            self.request_id = request_id
        if not isinstance(trace_id, unset.UnsetType):
            self.trace_id = trace_id
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "request_id",
            "trace_id",
        ]
    
    @builtins.property
    def request_id(self) -> "builtins.str":
        """
        Error request ID.
        """
        
        return super()._get_field("request_id", explicit_presence=False,
        )
    @request_id.setter
    def request_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("request_id",value,explicit_presence=False,
        )
    
    @builtins.property
    def trace_id(self) -> "builtins.str":
        """
        Trace ID for the failing request.
        """
        
        return super()._get_field("trace_id", explicit_presence=False,
        )
    @trace_id.setter
    def trace_id(self, value: "builtins.str|None") -> None:
        return super()._set_field("trace_id",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "request_id":"request_id",
        "trace_id":"trace_id",
    }
    
class TooManyRequests(pb_classes.Message):
    """
    You initiated too many requests to the service at once. Enhance your calm.
    """
    
    __PB2_CLASS__ = common_errors_pb2.TooManyRequests
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.TooManyRequests",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        violation: "builtins.str|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(violation, unset.UnsetType):
            self.violation = violation
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "violation",
        ]
    
    @builtins.property
    def violation(self) -> "builtins.str":
        """
        What request limit is exceeded (service-dependent).
        """
        
        return super()._get_field("violation", explicit_presence=False,
        )
    @violation.setter
    def violation(self, value: "builtins.str|None") -> None:
        return super()._set_field("violation",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "violation":"violation",
    }
    
class QuotaFailure(pb_classes.Message):
    """
    Indicates a failure due to exceeding specified limits or allocations in a system or service
    """
    
    __PB2_CLASS__ = common_errors_pb2.QuotaFailure
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.QuotaFailure",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    class Violation(pb_classes.Message):
        __PB2_CLASS__ = common_errors_pb2.QuotaFailure.Violation
        __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.QuotaFailure.Violation",common_errors_pb2.DESCRIPTOR,descriptor_1.Descriptor)
        __mask_functions__ = {
        }
        
        def __init__(
            self,
            initial_message: message_1.Message|None = None,
            *,
            quota: "builtins.str|None|unset.UnsetType" = unset.Unset,
            message: "builtins.str|None|unset.UnsetType" = unset.Unset,
            limit: "builtins.str|None|unset.UnsetType" = unset.Unset,
            requested: "builtins.str|None|unset.UnsetType" = unset.Unset,
        ) -> None:
            super().__init__(initial_message)
            if not isinstance(quota, unset.UnsetType):
                self.quota = quota
            if not isinstance(message, unset.UnsetType):
                self.message = message
            if not isinstance(limit, unset.UnsetType):
                self.limit = limit
            if not isinstance(requested, unset.UnsetType):
                self.requested = requested
        
        def __dir__(self) ->abc.Iterable[builtins.str]:
            return [
                "quota",
                "message",
                "limit",
                "requested",
            ]
        
        @builtins.property
        def quota(self) -> "builtins.str":
            """
            Which quota check failed.
            """
            
            return super()._get_field("quota", explicit_presence=False,
            )
        @quota.setter
        def quota(self, value: "builtins.str|None") -> None:
            return super()._set_field("quota",value,explicit_presence=False,
            )
        
        @builtins.property
        def message(self) -> "builtins.str":
            """
            A description of how the quota check failed.
            """
            
            return super()._get_field("message", explicit_presence=False,
            )
        @message.setter
        def message(self, value: "builtins.str|None") -> None:
            return super()._set_field("message",value,explicit_presence=False,
            )
        
        @builtins.property
        def limit(self) -> "builtins.str":
            """
            Maximum permissible value.
            """
            
            return super()._get_field("limit", explicit_presence=False,
            )
        @limit.setter
        def limit(self, value: "builtins.str|None") -> None:
            return super()._set_field("limit",value,explicit_presence=False,
            )
        
        @builtins.property
        def requested(self) -> "builtins.str":
            """
            Requested value.
            """
            
            return super()._get_field("requested", explicit_presence=False,
            )
        @requested.setter
        def requested(self, value: "builtins.str|None") -> None:
            return super()._set_field("requested",value,explicit_presence=False,
            )
        
        __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
            "quota":"quota",
            "message":"message",
            "limit":"limit",
            "requested":"requested",
        }
        
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        violations: "abc.Iterable[QuotaFailure.Violation]|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(violations, unset.UnsetType):
            self.violations = violations
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "violations",
            "Violation",
        ]
    
    @builtins.property
    def violations(self) -> "abc.MutableSequence[QuotaFailure.Violation]":
        """
        Describes all quota violations
        """
        
        return super()._get_field("violations", explicit_presence=False,
        wrap=pb_classes.Repeated.with_wrap(QuotaFailure.Violation,None,None),
        )
    @violations.setter
    def violations(self, value: "abc.Iterable[QuotaFailure.Violation]|None") -> None:
        return super()._set_field("violations",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "violations":"violations",
        "Violation":"Violation",
    }
    
# file: nebius/common/error/v1alpha1/error.proto
class ServiceError(pb_classes.Message):
    __PB2_CLASS__ = error_pb2.ServiceError
    __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.Descriptor](".nebius.common.error.v1alpha1.ServiceError",error_pb2.DESCRIPTOR,descriptor_1.Descriptor)
    __mask_functions__ = {
    }
    
    class RetryType(pb_enum.Enum):
        __PB2_DESCRIPTOR__ = descriptor.DescriptorWrap[descriptor_1.EnumDescriptor](".nebius.common.error.v1alpha1.ServiceError.RetryType",error_pb2.DESCRIPTOR,descriptor_1.EnumDescriptor)
        UNSPECIFIED = 0
        CALL = 1
        """
        Just retry the failed call.
        """
        
        UNIT_OF_WORK = 2
        """
        Retry whole logic before call and make a new one.
        """
        
        NOTHING = 3
        """
        Do not retry, this is a fatal error.
        """
        
    
    class __OneOfClass_details__(pb_classes.OneOf):
        name: builtins.str= "details"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__()
            self._message: "ServiceError" = msg
    
    class __OneOfClass_details_bad_request__(__OneOfClass_details__):
        field: typing.Literal["bad_request"] = "bad_request"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "BadRequest":
            return self._message.bad_request
    
    class __OneOfClass_details_bad_resource_state__(__OneOfClass_details__):
        field: typing.Literal["bad_resource_state"] = "bad_resource_state"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "BadResourceState":
            return self._message.bad_resource_state
    
    class __OneOfClass_details_resource_not_found__(__OneOfClass_details__):
        field: typing.Literal["resource_not_found"] = "resource_not_found"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "ResourceNotFound":
            return self._message.resource_not_found
    
    class __OneOfClass_details_resource_already_exists__(__OneOfClass_details__):
        field: typing.Literal["resource_already_exists"] = "resource_already_exists"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "ResourceAlreadyExists":
            return self._message.resource_already_exists
    
    class __OneOfClass_details_out_of_range__(__OneOfClass_details__):
        field: typing.Literal["out_of_range"] = "out_of_range"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "OutOfRange":
            return self._message.out_of_range
    
    class __OneOfClass_details_permission_denied__(__OneOfClass_details__):
        field: typing.Literal["permission_denied"] = "permission_denied"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "PermissionDenied":
            return self._message.permission_denied
    
    class __OneOfClass_details_resource_conflict__(__OneOfClass_details__):
        field: typing.Literal["resource_conflict"] = "resource_conflict"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "ResourceConflict":
            return self._message.resource_conflict
    
    class __OneOfClass_details_operation_aborted__(__OneOfClass_details__):
        field: typing.Literal["operation_aborted"] = "operation_aborted"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "OperationAborted":
            return self._message.operation_aborted
    
    class __OneOfClass_details_too_many_requests__(__OneOfClass_details__):
        field: typing.Literal["too_many_requests"] = "too_many_requests"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "TooManyRequests":
            return self._message.too_many_requests
    
    class __OneOfClass_details_quota_failure__(__OneOfClass_details__):
        field: typing.Literal["quota_failure"] = "quota_failure"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "QuotaFailure":
            return self._message.quota_failure
    
    class __OneOfClass_details_internal_error__(__OneOfClass_details__):
        field: typing.Literal["internal_error"] = "internal_error"
        
        def __init__(self, msg: "ServiceError") -> None:
            super().__init__(msg)
        @builtins.property
        def value(self) -> "InternalError":
            return self._message.internal_error
    
    @builtins.property
    def details(self) -> __OneOfClass_details_bad_request__|__OneOfClass_details_bad_resource_state__|__OneOfClass_details_resource_not_found__|__OneOfClass_details_resource_already_exists__|__OneOfClass_details_out_of_range__|__OneOfClass_details_permission_denied__|__OneOfClass_details_resource_conflict__|__OneOfClass_details_operation_aborted__|__OneOfClass_details_too_many_requests__|__OneOfClass_details_quota_failure__|__OneOfClass_details_internal_error__|None:
        """
        Additional message describing the error, if any.
        """
        
        field_name: str|None = super().which_field_in_oneof("details")
        match field_name:
            case "bad_request":
                return self.__OneOfClass_details_bad_request__(self)
            case "bad_resource_state":
                return self.__OneOfClass_details_bad_resource_state__(self)
            case "resource_not_found":
                return self.__OneOfClass_details_resource_not_found__(self)
            case "resource_already_exists":
                return self.__OneOfClass_details_resource_already_exists__(self)
            case "out_of_range":
                return self.__OneOfClass_details_out_of_range__(self)
            case "permission_denied":
                return self.__OneOfClass_details_permission_denied__(self)
            case "resource_conflict":
                return self.__OneOfClass_details_resource_conflict__(self)
            case "operation_aborted":
                return self.__OneOfClass_details_operation_aborted__(self)
            case "too_many_requests":
                return self.__OneOfClass_details_too_many_requests__(self)
            case "quota_failure":
                return self.__OneOfClass_details_quota_failure__(self)
            case "internal_error":
                return self.__OneOfClass_details_internal_error__(self)
            case None:
                return None
            case _:
                raise pb_classes.OneOfMatchError(field_name)
    
    def __init__(
        self,
        initial_message: message_1.Message|None = None,
        *,
        service: "builtins.str|None|unset.UnsetType" = unset.Unset,
        code: "builtins.str|None|unset.UnsetType" = unset.Unset,
        bad_request: "BadRequest|common_errors_pb2.BadRequest|None|unset.UnsetType" = unset.Unset,
        bad_resource_state: "BadResourceState|common_errors_pb2.BadResourceState|None|unset.UnsetType" = unset.Unset,
        resource_not_found: "ResourceNotFound|common_errors_pb2.ResourceNotFound|None|unset.UnsetType" = unset.Unset,
        resource_already_exists: "ResourceAlreadyExists|common_errors_pb2.ResourceAlreadyExists|None|unset.UnsetType" = unset.Unset,
        out_of_range: "OutOfRange|common_errors_pb2.OutOfRange|None|unset.UnsetType" = unset.Unset,
        permission_denied: "PermissionDenied|common_errors_pb2.PermissionDenied|None|unset.UnsetType" = unset.Unset,
        resource_conflict: "ResourceConflict|common_errors_pb2.ResourceConflict|None|unset.UnsetType" = unset.Unset,
        operation_aborted: "OperationAborted|common_errors_pb2.OperationAborted|None|unset.UnsetType" = unset.Unset,
        too_many_requests: "TooManyRequests|common_errors_pb2.TooManyRequests|None|unset.UnsetType" = unset.Unset,
        quota_failure: "QuotaFailure|common_errors_pb2.QuotaFailure|None|unset.UnsetType" = unset.Unset,
        internal_error: "InternalError|common_errors_pb2.InternalError|None|unset.UnsetType" = unset.Unset,
        retry_type: "ServiceError.RetryType|error_pb2.ServiceError.RetryType|None|unset.UnsetType" = unset.Unset,
    ) -> None:
        super().__init__(initial_message)
        if not isinstance(service, unset.UnsetType):
            self.service = service
        if not isinstance(code, unset.UnsetType):
            self.code = code
        if not isinstance(bad_request, unset.UnsetType):
            self.bad_request = bad_request
        if not isinstance(bad_resource_state, unset.UnsetType):
            self.bad_resource_state = bad_resource_state
        if not isinstance(resource_not_found, unset.UnsetType):
            self.resource_not_found = resource_not_found
        if not isinstance(resource_already_exists, unset.UnsetType):
            self.resource_already_exists = resource_already_exists
        if not isinstance(out_of_range, unset.UnsetType):
            self.out_of_range = out_of_range
        if not isinstance(permission_denied, unset.UnsetType):
            self.permission_denied = permission_denied
        if not isinstance(resource_conflict, unset.UnsetType):
            self.resource_conflict = resource_conflict
        if not isinstance(operation_aborted, unset.UnsetType):
            self.operation_aborted = operation_aborted
        if not isinstance(too_many_requests, unset.UnsetType):
            self.too_many_requests = too_many_requests
        if not isinstance(quota_failure, unset.UnsetType):
            self.quota_failure = quota_failure
        if not isinstance(internal_error, unset.UnsetType):
            self.internal_error = internal_error
        if not isinstance(retry_type, unset.UnsetType):
            self.retry_type = retry_type
    
    def __dir__(self) ->abc.Iterable[builtins.str]:
        return [
            "service",
            "code",
            "bad_request",
            "bad_resource_state",
            "resource_not_found",
            "resource_already_exists",
            "out_of_range",
            "permission_denied",
            "resource_conflict",
            "operation_aborted",
            "too_many_requests",
            "quota_failure",
            "internal_error",
            "retry_type",
            "details",
            "RetryType",
        ]
    
    @builtins.property
    def service(self) -> "builtins.str":
        """
        ID of Service which the error originated in. E.g. "dns".
        """
        
        return super()._get_field("service", explicit_presence=False,
        )
    @service.setter
    def service(self, value: "builtins.str|None") -> None:
        return super()._set_field("service",value,explicit_presence=False,
        )
    
    @builtins.property
    def code(self) -> "builtins.str":
        """
        Detailed error code, service-specific. E.g. "DnsZoneNotEmpty".
        Name of the exception, without Exception suffix if not set
        Example: for PermissionDeniedException -> code == PermissionDenied
        """
        
        return super()._get_field("code", explicit_presence=False,
        )
    @code.setter
    def code(self, value: "builtins.str|None") -> None:
        return super()._set_field("code",value,explicit_presence=False,
        )
    
    @builtins.property
    def bad_request(self) -> "BadRequest|None":
        return super()._get_field("bad_request", explicit_presence=True,
        wrap=BadRequest,
        )
    @bad_request.setter
    def bad_request(self, value: "BadRequest|common_errors_pb2.BadRequest|None") -> None:
        return super()._set_field("bad_request",value,explicit_presence=True,
        )
    
    @builtins.property
    def bad_resource_state(self) -> "BadResourceState|None":
        return super()._get_field("bad_resource_state", explicit_presence=True,
        wrap=BadResourceState,
        )
    @bad_resource_state.setter
    def bad_resource_state(self, value: "BadResourceState|common_errors_pb2.BadResourceState|None") -> None:
        return super()._set_field("bad_resource_state",value,explicit_presence=True,
        )
    
    @builtins.property
    def resource_not_found(self) -> "ResourceNotFound|None":
        return super()._get_field("resource_not_found", explicit_presence=True,
        wrap=ResourceNotFound,
        )
    @resource_not_found.setter
    def resource_not_found(self, value: "ResourceNotFound|common_errors_pb2.ResourceNotFound|None") -> None:
        return super()._set_field("resource_not_found",value,explicit_presence=True,
        )
    
    @builtins.property
    def resource_already_exists(self) -> "ResourceAlreadyExists|None":
        return super()._get_field("resource_already_exists", explicit_presence=True,
        wrap=ResourceAlreadyExists,
        )
    @resource_already_exists.setter
    def resource_already_exists(self, value: "ResourceAlreadyExists|common_errors_pb2.ResourceAlreadyExists|None") -> None:
        return super()._set_field("resource_already_exists",value,explicit_presence=True,
        )
    
    @builtins.property
    def out_of_range(self) -> "OutOfRange|None":
        return super()._get_field("out_of_range", explicit_presence=True,
        wrap=OutOfRange,
        )
    @out_of_range.setter
    def out_of_range(self, value: "OutOfRange|common_errors_pb2.OutOfRange|None") -> None:
        return super()._set_field("out_of_range",value,explicit_presence=True,
        )
    
    @builtins.property
    def permission_denied(self) -> "PermissionDenied|None":
        return super()._get_field("permission_denied", explicit_presence=True,
        wrap=PermissionDenied,
        )
    @permission_denied.setter
    def permission_denied(self, value: "PermissionDenied|common_errors_pb2.PermissionDenied|None") -> None:
        return super()._set_field("permission_denied",value,explicit_presence=True,
        )
    
    @builtins.property
    def resource_conflict(self) -> "ResourceConflict|None":
        return super()._get_field("resource_conflict", explicit_presence=True,
        wrap=ResourceConflict,
        )
    @resource_conflict.setter
    def resource_conflict(self, value: "ResourceConflict|common_errors_pb2.ResourceConflict|None") -> None:
        return super()._set_field("resource_conflict",value,explicit_presence=True,
        )
    
    @builtins.property
    def operation_aborted(self) -> "OperationAborted|None":
        return super()._get_field("operation_aborted", explicit_presence=True,
        wrap=OperationAborted,
        )
    @operation_aborted.setter
    def operation_aborted(self, value: "OperationAborted|common_errors_pb2.OperationAborted|None") -> None:
        return super()._set_field("operation_aborted",value,explicit_presence=True,
        )
    
    @builtins.property
    def too_many_requests(self) -> "TooManyRequests|None":
        return super()._get_field("too_many_requests", explicit_presence=True,
        wrap=TooManyRequests,
        )
    @too_many_requests.setter
    def too_many_requests(self, value: "TooManyRequests|common_errors_pb2.TooManyRequests|None") -> None:
        return super()._set_field("too_many_requests",value,explicit_presence=True,
        )
    
    @builtins.property
    def quota_failure(self) -> "QuotaFailure|None":
        return super()._get_field("quota_failure", explicit_presence=True,
        wrap=QuotaFailure,
        )
    @quota_failure.setter
    def quota_failure(self, value: "QuotaFailure|common_errors_pb2.QuotaFailure|None") -> None:
        return super()._set_field("quota_failure",value,explicit_presence=True,
        )
    
    @builtins.property
    def internal_error(self) -> "InternalError|None":
        return super()._get_field("internal_error", explicit_presence=True,
        wrap=InternalError,
        )
    @internal_error.setter
    def internal_error(self, value: "InternalError|common_errors_pb2.InternalError|None") -> None:
        return super()._set_field("internal_error",value,explicit_presence=True,
        )
    
    @builtins.property
    def retry_type(self) -> "ServiceError.RetryType":
        """
        Retry type tells how to provide retry, e.g.: just a single call or the whole logic before it.
        """
        
        return super()._get_field("retry_type", explicit_presence=False,
        wrap=ServiceError.RetryType,
        )
    @retry_type.setter
    def retry_type(self, value: "ServiceError.RetryType|error_pb2.ServiceError.RetryType|None") -> None:
        return super()._set_field("retry_type",value,explicit_presence=False,
        )
    
    __PY_TO_PB2__: builtins.dict[builtins.str,builtins.str] = {
        "service":"service",
        "code":"code",
        "bad_request":"bad_request",
        "bad_resource_state":"bad_resource_state",
        "resource_not_found":"resource_not_found",
        "resource_already_exists":"resource_already_exists",
        "out_of_range":"out_of_range",
        "permission_denied":"permission_denied",
        "resource_conflict":"resource_conflict",
        "operation_aborted":"operation_aborted",
        "too_many_requests":"too_many_requests",
        "quota_failure":"quota_failure",
        "internal_error":"internal_error",
        "retry_type":"retry_type",
        "details":"details",
        "RetryType":"RetryType",
    }
    
__all__ = [
    #@ local import names here @#
    "BadRequest",
    "BadResourceState",
    "ResourceNotFound",
    "ResourceAlreadyExists",
    "ResourceConflict",
    "OperationAborted",
    "OutOfRange",
    "PermissionDenied",
    "InternalError",
    "TooManyRequests",
    "QuotaFailure",
    "ServiceError",
]
