# coding: utf-8
# Copyright 2023 OpenSPG Authors
#
# 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.


"""
    knext

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from knext.common.rest.configuration import Configuration


class PropertyAdvancedConfig(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    openapi_types = {
        "multi_version_config": "MultiVersionConfig",
        "mounted_concept_config": "MountedConceptConfig",
        "property_group": "str",
        "constraint": "Constraint",
        "sub_properties": "list[SubProperty]",
        "semantics": "list[PredicateSemantic]",
        "logical_rule": "LogicalRule",
    }

    attribute_map = {
        "multi_version_config": "multiVersionConfig",
        "mounted_concept_config": "MountedConceptConfig",
        "property_group": "propertyGroup",
        "constraint": "constraint",
        "sub_properties": "subProperties",
        "semantics": "semantics",
        "logical_rule": "logicalRule",
    }

    def __init__(
        self,
        multi_version_config=None,
        mounted_concept_config=None,
        property_group=None,
        constraint=None,
        sub_properties=None,
        semantics=None,
        logical_rule=None,
        local_vars_configuration=None,
    ):  # noqa: E501
        """PropertyAdvancedConfig - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._multi_version_config = None
        self._mounted_concept_config = None
        self._property_group = None
        self._constraint = None
        self._sub_properties = None
        self._semantics = None
        self._logical_rule = None
        self.discriminator = None

        if multi_version_config is not None:
            self.multi_version_config = multi_version_config
        if mounted_concept_config is not None:
            self.mounted_concept_config = mounted_concept_config
        if property_group is not None:
            self.property_group = property_group
        if constraint is not None:
            self.constraint = constraint
        if sub_properties is not None:
            self.sub_properties = sub_properties
        if semantics is not None:
            self.semantics = semantics
        if logical_rule is not None:
            self.logical_rule = logical_rule

    @property
    def multi_version_config(self):
        """Gets the multi_version_config of this PropertyAdvancedConfig.  # noqa: E501


        :return: The multi_version_config of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: MultiVersionConfig
        """
        return self._multi_version_config

    @multi_version_config.setter
    def multi_version_config(self, multi_version_config):
        """Sets the multi_version_config of this PropertyAdvancedConfig.


        :param multi_version_config: The multi_version_config of this PropertyAdvancedConfig.  # noqa: E501
        :type: MultiVersionConfig
        """

        self._multi_version_config = multi_version_config

    @property
    def mounted_concept_config(self):
        """Gets the mounted_concept_config of this PropertyAdvancedConfig.  # noqa: E501


        :return: The mounted_concept_config of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: MountedConceptConfig
        """
        return self._mounted_concept_config

    @mounted_concept_config.setter
    def mounted_concept_config(self, mounted_concept_config):
        """Sets the mounted_concept_config of this PropertyAdvancedConfig.


        :param mounted_concept_config: The mounted_concept_config of this PropertyAdvancedConfig.  # noqa: E501
        :type: MountedConceptConfig
        """

        self._mounted_concept_config = mounted_concept_config

    @property
    def property_group(self):
        """Gets the property_group of this PropertyAdvancedConfig.  # noqa: E501


        :return: The property_group of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: str
        """
        return self._property_group

    @property_group.setter
    def property_group(self, property_group):
        """Sets the property_group of this PropertyAdvancedConfig.


        :param property_group: The property_group of this PropertyAdvancedConfig.  # noqa: E501
        :type: str
        """
        allowed_values = ["TIME", "SUBJECT", "OBJECT", "LOC"]  # noqa: E501
        if (
            self.local_vars_configuration.client_side_validation
            and property_group not in allowed_values
        ):  # noqa: E501
            raise ValueError(
                "Invalid value for `property_group` ({0}), must be one of {1}".format(  # noqa: E501
                    property_group, allowed_values
                )
            )

        self._property_group = property_group

    @property
    def constraint(self):
        """Gets the constraint of this PropertyAdvancedConfig.  # noqa: E501


        :return: The constraint of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: Constraint
        """
        return self._constraint

    @constraint.setter
    def constraint(self, constraint):
        """Sets the constraint of this PropertyAdvancedConfig.


        :param constraint: The constraint of this PropertyAdvancedConfig.  # noqa: E501
        :type: Constraint
        """

        self._constraint = constraint

    @property
    def sub_properties(self):
        """Gets the sub_properties of this PropertyAdvancedConfig.  # noqa: E501


        :return: The sub_properties of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: list[SubProperty]
        """
        return self._sub_properties

    @sub_properties.setter
    def sub_properties(self, sub_properties):
        """Sets the sub_properties of this PropertyAdvancedConfig.


        :param sub_properties: The sub_properties of this PropertyAdvancedConfig.  # noqa: E501
        :type: list[SubProperty]
        """

        self._sub_properties = sub_properties

    @property
    def semantics(self):
        """Gets the semantics of this PropertyAdvancedConfig.  # noqa: E501


        :return: The semantics of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: list[PredicateSemantic]
        """
        return self._semantics

    @semantics.setter
    def semantics(self, semantics):
        """Sets the semantics of this PropertyAdvancedConfig.


        :param semantics: The semantics of this PropertyAdvancedConfig.  # noqa: E501
        :type: list[PredicateSemantic]
        """

        self._semantics = semantics

    @property
    def logical_rule(self):
        """Gets the logical_rule of this PropertyAdvancedConfig.  # noqa: E501


        :return: The logical_rule of this PropertyAdvancedConfig.  # noqa: E501
        :rtype: LogicalRule
        """
        return self._logical_rule

    @logical_rule.setter
    def logical_rule(self, logical_rule):
        """Sets the logical_rule of this PropertyAdvancedConfig.


        :param logical_rule: The logical_rule of this PropertyAdvancedConfig.  # noqa: E501
        :type: LogicalRule
        """

        self._logical_rule = logical_rule

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(
                    map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)
                )
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(
                    map(
                        lambda item: (item[0], item[1].to_dict())
                        if hasattr(item[1], "to_dict")
                        else item,
                        value.items(),
                    )
                )
            else:
                result[attr] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, PropertyAdvancedConfig):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, PropertyAdvancedConfig):
            return True

        return self.to_dict() != other.to_dict()
