# coding: utf-8

"""
    fluid

    client for fluid  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from fluid.configuration import Configuration


class AffinityStrategy(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 = {
        'depend_on': 'ObjectRef',
        'policy': 'str',
        'prefers': 'list[Prefer]',
        'requires': 'list[Require]'
    }

    attribute_map = {
        'depend_on': 'dependOn',
        'policy': 'policy',
        'prefers': 'prefers',
        'requires': 'requires'
    }

    def __init__(self, depend_on=None, policy=None, prefers=None, requires=None, local_vars_configuration=None):  # noqa: E501
        """AffinityStrategy - 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._depend_on = None
        self._policy = None
        self._prefers = None
        self._requires = None
        self.discriminator = None

        if depend_on is not None:
            self.depend_on = depend_on
        if policy is not None:
            self.policy = policy
        if prefers is not None:
            self.prefers = prefers
        if requires is not None:
            self.requires = requires

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


        :return: The depend_on of this AffinityStrategy.  # noqa: E501
        :rtype: ObjectRef
        """
        return self._depend_on

    @depend_on.setter
    def depend_on(self, depend_on):
        """Sets the depend_on of this AffinityStrategy.


        :param depend_on: The depend_on of this AffinityStrategy.  # noqa: E501
        :type: ObjectRef
        """

        self._depend_on = depend_on

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

        Policy one of: \"\", \"Require\", \"Prefer\"  # noqa: E501

        :return: The policy of this AffinityStrategy.  # noqa: E501
        :rtype: str
        """
        return self._policy

    @policy.setter
    def policy(self, policy):
        """Sets the policy of this AffinityStrategy.

        Policy one of: \"\", \"Require\", \"Prefer\"  # noqa: E501

        :param policy: The policy of this AffinityStrategy.  # noqa: E501
        :type: str
        """

        self._policy = policy

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


        :return: The prefers of this AffinityStrategy.  # noqa: E501
        :rtype: list[Prefer]
        """
        return self._prefers

    @prefers.setter
    def prefers(self, prefers):
        """Sets the prefers of this AffinityStrategy.


        :param prefers: The prefers of this AffinityStrategy.  # noqa: E501
        :type: list[Prefer]
        """

        self._prefers = prefers

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


        :return: The requires of this AffinityStrategy.  # noqa: E501
        :rtype: list[Require]
        """
        return self._requires

    @requires.setter
    def requires(self, requires):
        """Sets the requires of this AffinityStrategy.


        :param requires: The requires of this AffinityStrategy.  # noqa: E501
        :type: list[Require]
        """

        self._requires = requires

    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, AffinityStrategy):
            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, AffinityStrategy):
            return True

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