# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20220509


from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class OlvmErrorHandling(object):
    """
    Error Handling in OLVM
    """

    #: A constant which can be used with the on_error property of a OlvmErrorHandling.
    #: This constant has a value of "DO_NOT_MIGRATE"
    ON_ERROR_DO_NOT_MIGRATE = "DO_NOT_MIGRATE"

    #: A constant which can be used with the on_error property of a OlvmErrorHandling.
    #: This constant has a value of "MIGRATE"
    ON_ERROR_MIGRATE = "MIGRATE"

    #: A constant which can be used with the on_error property of a OlvmErrorHandling.
    #: This constant has a value of "MIGRATE_HIGHLY_AVAILABLE"
    ON_ERROR_MIGRATE_HIGHLY_AVAILABLE = "MIGRATE_HIGHLY_AVAILABLE"

    def __init__(self, **kwargs):
        """
        Initializes a new OlvmErrorHandling object with values from keyword arguments.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param on_error:
            The value to assign to the on_error property of this OlvmErrorHandling.
            Allowed values for this property are: "DO_NOT_MIGRATE", "MIGRATE", "MIGRATE_HIGHLY_AVAILABLE"
        :type on_error: str

        """
        self.swagger_types = {
            'on_error': 'str'
        }
        self.attribute_map = {
            'on_error': 'onError'
        }
        self._on_error = None

    @property
    def on_error(self):
        """
        Gets the on_error of this OlvmErrorHandling.
        Migrate on error

        Allowed values for this property are: "DO_NOT_MIGRATE", "MIGRATE", "MIGRATE_HIGHLY_AVAILABLE"


        :return: The on_error of this OlvmErrorHandling.
        :rtype: str
        """
        return self._on_error

    @on_error.setter
    def on_error(self, on_error):
        """
        Sets the on_error of this OlvmErrorHandling.
        Migrate on error


        :param on_error: The on_error of this OlvmErrorHandling.
        :type: str
        """
        allowed_values = ["DO_NOT_MIGRATE", "MIGRATE", "MIGRATE_HIGHLY_AVAILABLE"]
        if not value_allowed_none_or_none_sentinel(on_error, allowed_values):
            raise ValueError(
                f"Invalid value for `on_error`, must be None or one of {allowed_values}"
            )
        self._on_error = on_error

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
