# coding: utf-8

"""
    Knetik Platform API Documentation latest 

    This is the spec for the Knetik API.  Use this in conjunction with the documentation found at https://knetikcloud.com.

    OpenAPI spec version: latest 
    Contact: support@knetik.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class PropertyFieldResource(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """


    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'description': 'str',
        'inner_type': 'str',
        'inner_type_fields': 'list[PropertyFieldResource]',
        'name': 'str',
        'required': 'bool',
        'type': 'str',
        'valid_values': 'list[str]'
    }

    attribute_map = {
        'description': 'description',
        'inner_type': 'inner_type',
        'inner_type_fields': 'inner_type_fields',
        'name': 'name',
        'required': 'required',
        'type': 'type',
        'valid_values': 'valid_values'
    }

    def __init__(self, description=None, inner_type=None, inner_type_fields=None, name=None, required=None, type=None, valid_values=None):
        """
        PropertyFieldResource - a model defined in Swagger
        """

        self._description = None
        self._inner_type = None
        self._inner_type_fields = None
        self._name = None
        self._required = None
        self._type = None
        self._valid_values = None
        self.discriminator = None

        if description is not None:
          self.description = description
        if inner_type is not None:
          self.inner_type = inner_type
        if inner_type_fields is not None:
          self.inner_type_fields = inner_type_fields
        if name is not None:
          self.name = name
        if required is not None:
          self.required = required
        if type is not None:
          self.type = type
        if valid_values is not None:
          self.valid_values = valid_values

    @property
    def description(self):
        """
        Gets the description of this PropertyFieldResource.
        A description of the field

        :return: The description of this PropertyFieldResource.
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """
        Sets the description of this PropertyFieldResource.
        A description of the field

        :param description: The description of this PropertyFieldResource.
        :type: str
        """

        self._description = description

    @property
    def inner_type(self):
        """
        Gets the inner_type of this PropertyFieldResource.
        The type of values within a 'list' type field

        :return: The inner_type of this PropertyFieldResource.
        :rtype: str
        """
        return self._inner_type

    @inner_type.setter
    def inner_type(self, inner_type):
        """
        Sets the inner_type of this PropertyFieldResource.
        The type of values within a 'list' type field

        :param inner_type: The inner_type of this PropertyFieldResource.
        :type: str
        """
        allowed_values = ["integer", "number", "bool", "string", "enumeration", "list", "object", "definition"]
        if inner_type not in allowed_values:
            raise ValueError(
                "Invalid value for `inner_type` ({0}), must be one of {1}"
                .format(inner_type, allowed_values)
            )

        self._inner_type = inner_type

    @property
    def inner_type_fields(self):
        """
        Gets the inner_type_fields of this PropertyFieldResource.
        A description of fields within objects within a 'list' type field, when inner_type is 'object'

        :return: The inner_type_fields of this PropertyFieldResource.
        :rtype: list[PropertyFieldResource]
        """
        return self._inner_type_fields

    @inner_type_fields.setter
    def inner_type_fields(self, inner_type_fields):
        """
        Sets the inner_type_fields of this PropertyFieldResource.
        A description of fields within objects within a 'list' type field, when inner_type is 'object'

        :param inner_type_fields: The inner_type_fields of this PropertyFieldResource.
        :type: list[PropertyFieldResource]
        """

        self._inner_type_fields = inner_type_fields

    @property
    def name(self):
        """
        Gets the name of this PropertyFieldResource.
        The name of the field

        :return: The name of this PropertyFieldResource.
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """
        Sets the name of this PropertyFieldResource.
        The name of the field

        :param name: The name of this PropertyFieldResource.
        :type: str
        """

        self._name = name

    @property
    def required(self):
        """
        Gets the required of this PropertyFieldResource.
        Whether the field is required

        :return: The required of this PropertyFieldResource.
        :rtype: bool
        """
        return self._required

    @required.setter
    def required(self, required):
        """
        Sets the required of this PropertyFieldResource.
        Whether the field is required

        :param required: The required of this PropertyFieldResource.
        :type: bool
        """

        self._required = required

    @property
    def type(self):
        """
        Gets the type of this PropertyFieldResource.
        The type of the field

        :return: The type of this PropertyFieldResource.
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """
        Sets the type of this PropertyFieldResource.
        The type of the field

        :param type: The type of this PropertyFieldResource.
        :type: str
        """
        allowed_values = ["integer", "number", "bool", "string", "enumeration", "list", "object", "definition"]
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type` ({0}), must be one of {1}"
                .format(type, allowed_values)
            )

        self._type = type

    @property
    def valid_values(self):
        """
        Gets the valid_values of this PropertyFieldResource.
        A list of valid values for 'enum' type fields

        :return: The valid_values of this PropertyFieldResource.
        :rtype: list[str]
        """
        return self._valid_values

    @valid_values.setter
    def valid_values(self, valid_values):
        """
        Sets the valid_values of this PropertyFieldResource.
        A list of valid values for 'enum' type fields

        :param valid_values: The valid_values of this PropertyFieldResource.
        :type: list[str]
        """

        self._valid_values = valid_values

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

        for attr, _ in iteritems(self.swagger_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 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, PropertyFieldResource):
            return False

        return self.__dict__ == other.__dict__

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