# coding: utf-8

"""
Copyright 2016 SmartBear Software

    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.
    See the License for the specific language governing permissions and
    limitations under the License.

    Ref: https://github.com/swagger-api/swagger-codegen
"""

from pprint import pformat
from six import iteritems
import re


class FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'attribute_exists': 'bool',
            'begins_with': 'bool',
            'case_sensitive': 'bool',
            'field': 'str',
            'operator': 'str',
            'type': 'str',
            'units': 'str',
            'use_relative_time': 'bool',
            'value': 'str'
        }

        self.attribute_map = {
            'attribute_exists': 'attribute_exists',
            'begins_with': 'begins_with',
            'case_sensitive': 'case_sensitive',
            'field': 'field',
            'operator': 'operator',
            'type': 'type',
            'units': 'units',
            'use_relative_time': 'use_relative_time',
            'value': 'value'
        }

        self._attribute_exists = None
        self._begins_with = None
        self._case_sensitive = None
        self._field = None
        self._operator = None
        self._type = None
        self._units = None
        self._use_relative_time = None
        self._value = None

    @property
    def attribute_exists(self):
        """
        Gets the attribute_exists of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Indicates whether the existence of an attribute indicates a match (valid only with 'type' = 'custom_attribute')

        :return: The attribute_exists of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: bool
        """
        return self._attribute_exists

    @attribute_exists.setter
    def attribute_exists(self, attribute_exists):
        """
        Sets the attribute_exists of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Indicates whether the existence of an attribute indicates a match (valid only with 'type' = 'custom_attribute')

        :param attribute_exists: The attribute_exists of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: bool
        """
        
        self._attribute_exists = attribute_exists

    @property
    def begins_with(self):
        """
        Gets the begins_with of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        True to match files recursively under the given path. (valid only with 'type' = 'path')

        :return: The begins_with of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: bool
        """
        return self._begins_with

    @begins_with.setter
    def begins_with(self, begins_with):
        """
        Sets the begins_with of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        True to match files recursively under the given path. (valid only with 'type' = 'path')

        :param begins_with: The begins_with of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: bool
        """
        
        self._begins_with = begins_with

    @property
    def case_sensitive(self):
        """
        Gets the case_sensitive of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        True to indicate case sensitivity when comparing file attributes (valid only with 'type' = 'name' or 'type' = 'path')

        :return: The case_sensitive of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: bool
        """
        return self._case_sensitive

    @case_sensitive.setter
    def case_sensitive(self, case_sensitive):
        """
        Sets the case_sensitive of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        True to indicate case sensitivity when comparing file attributes (valid only with 'type' = 'name' or 'type' = 'path')

        :param case_sensitive: The case_sensitive of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: bool
        """
        
        self._case_sensitive = case_sensitive

    @property
    def field(self):
        """
        Gets the field of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        File attribute field name to be compared in a custom comparison (valid only with 'type' = 'custom_attribute')

        :return: The field of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: str
        """
        return self._field

    @field.setter
    def field(self, field):
        """
        Sets the field of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        File attribute field name to be compared in a custom comparison (valid only with 'type' = 'custom_attribute')

        :param field: The field of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: str
        """
        
        self._field = field

    @property
    def operator(self):
        """
        Gets the operator of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The comparison operator to use while comparing an attribute with its value

        :return: The operator of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: str
        """
        return self._operator

    @operator.setter
    def operator(self, operator):
        """
        Sets the operator of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The comparison operator to use while comparing an attribute with its value

        :param operator: The operator of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: str
        """
        allowed_values = ["==", "!=", ">", ">=", "<", "<=", "!"]
        if operator is not None and operator not in allowed_values:
            raise ValueError(
                "Invalid value for `operator`, must be one of {0}"
                .format(allowed_values)
            )

        self._operator = operator

    @property
    def type(self):
        """
        Gets the type of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The file attribute to be compared to a given value

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

    @type.setter
    def type(self, type):
        """
        Sets the type of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The file attribute to be compared to a given value

        :param type: The type of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: str
        """
        allowed_values = ["name", "path", "link_count", "accessed_time", "birth_time", "changed_time", "metadata_changed_time", "size", "file_type", "custom_attribute"]
        if type not in allowed_values:
            raise ValueError(
                "Invalid value for `type`, must be one of {0}"
                .format(allowed_values)
            )

        self._type = type

    @property
    def units(self):
        """
        Gets the units of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Size unit value. One of 'B','KB','MB','GB','TB','PB','EB' (valid only with 'type' = 'size')

        :return: The units of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: str
        """
        return self._units

    @units.setter
    def units(self, units):
        """
        Sets the units of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Size unit value. One of 'B','KB','MB','GB','TB','PB','EB' (valid only with 'type' = 'size')

        :param units: The units of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: str
        """
        
        self._units = units

    @property
    def use_relative_time(self):
        """
        Gets the use_relative_time of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Whether time units refer to a calendar date and time (e.g., Jun 3, 2009) or a relative duration (e.g., 2 weeks) (valid only with 'type' in {accessed_time, birth_time, changed_time or metadata_changed_time}

        :return: The use_relative_time of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: bool
        """
        return self._use_relative_time

    @use_relative_time.setter
    def use_relative_time(self, use_relative_time):
        """
        Sets the use_relative_time of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        Whether time units refer to a calendar date and time (e.g., Jun 3, 2009) or a relative duration (e.g., 2 weeks) (valid only with 'type' in {accessed_time, birth_time, changed_time or metadata_changed_time}

        :param use_relative_time: The use_relative_time of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: bool
        """
        
        self._use_relative_time = use_relative_time

    @property
    def value(self):
        """
        Gets the value of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The value to be compared against a file attribute

        :return: The value of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :rtype: str
        """
        return self._value

    @value.setter
    def value(self, value):
        """
        Sets the value of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        The value to be compared against a file attribute

        :param value: The value of this FilepoolPolicyFileMatchingPatternOrCriteriaItemAndCriteriaItem.
        :type: str
        """
        
        self._value = value

    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
        """
        return self.__dict__ == other.__dict__

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

