# coding: utf-8

"""
    DigitalRebar Provision Server

    # An RestFUL API-driven Provisioner and DHCP server  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from drppy_client.configuration import Configuration


class Zone(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 = {
        'available': 'bool',
        'bundle': 'str',
        '_continue': 'bool',
        'created_at': 'datetime',
        'created_by': 'str',
        'description': 'str',
        'documentation': 'str',
        'endpoint': 'str',
        'errors': 'list[str]',
        'filters': 'list[ZoneFilter]',
        'forwarders': 'list[str]',
        'last_modified_at': 'datetime',
        'last_modified_by': 'str',
        'meta': 'Meta',
        'name': 'str',
        'origin': 'str',
        'priority': 'int',
        'read_only': 'bool',
        'records': 'list[ZoneRecord]',
        'ttl': 'int',
        'validated': 'bool'
    }

    attribute_map = {
        'available': 'Available',
        'bundle': 'Bundle',
        '_continue': 'Continue',
        'created_at': 'CreatedAt',
        'created_by': 'CreatedBy',
        'description': 'Description',
        'documentation': 'Documentation',
        'endpoint': 'Endpoint',
        'errors': 'Errors',
        'filters': 'Filters',
        'forwarders': 'Forwarders',
        'last_modified_at': 'LastModifiedAt',
        'last_modified_by': 'LastModifiedBy',
        'meta': 'Meta',
        'name': 'Name',
        'origin': 'Origin',
        'priority': 'Priority',
        'read_only': 'ReadOnly',
        'records': 'Records',
        'ttl': 'TTL',
        'validated': 'Validated'
    }

    def __init__(self, available=None, bundle=None, _continue=None, created_at=None, created_by=None, description=None, documentation=None, endpoint=None, errors=None, filters=None, forwarders=None, last_modified_at=None, last_modified_by=None, meta=None, name=None, origin=None, priority=None, read_only=None, records=None, ttl=None, validated=None, _configuration=None):  # noqa: E501
        """Zone - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._available = None
        self._bundle = None
        self.__continue = None
        self._created_at = None
        self._created_by = None
        self._description = None
        self._documentation = None
        self._endpoint = None
        self._errors = None
        self._filters = None
        self._forwarders = None
        self._last_modified_at = None
        self._last_modified_by = None
        self._meta = None
        self._name = None
        self._origin = None
        self._priority = None
        self._read_only = None
        self._records = None
        self._ttl = None
        self._validated = None
        self.discriminator = None

        if available is not None:
            self.available = available
        if bundle is not None:
            self.bundle = bundle
        if _continue is not None:
            self._continue = _continue
        if created_at is not None:
            self.created_at = created_at
        if created_by is not None:
            self.created_by = created_by
        if description is not None:
            self.description = description
        if documentation is not None:
            self.documentation = documentation
        if endpoint is not None:
            self.endpoint = endpoint
        if errors is not None:
            self.errors = errors
        if filters is not None:
            self.filters = filters
        if forwarders is not None:
            self.forwarders = forwarders
        if last_modified_at is not None:
            self.last_modified_at = last_modified_at
        if last_modified_by is not None:
            self.last_modified_by = last_modified_by
        if meta is not None:
            self.meta = meta
        if name is not None:
            self.name = name
        if origin is not None:
            self.origin = origin
        if priority is not None:
            self.priority = priority
        if read_only is not None:
            self.read_only = read_only
        if records is not None:
            self.records = records
        if ttl is not None:
            self.ttl = ttl
        if validated is not None:
            self.validated = validated

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

        Available tracks whether or not the model passed validation.  # noqa: E501

        :return: The available of this Zone.  # noqa: E501
        :rtype: bool
        """
        return self._available

    @available.setter
    def available(self, available):
        """Sets the available of this Zone.

        Available tracks whether or not the model passed validation.  # noqa: E501

        :param available: The available of this Zone.  # noqa: E501
        :type: bool
        """

        self._available = available

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

        Bundle tracks the name of the store containing this object. This field is read-only, and cannot be changed via the API.  # noqa: E501

        :return: The bundle of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._bundle

    @bundle.setter
    def bundle(self, bundle):
        """Sets the bundle of this Zone.

        Bundle tracks the name of the store containing this object. This field is read-only, and cannot be changed via the API.  # noqa: E501

        :param bundle: The bundle of this Zone.  # noqa: E501
        :type: str
        """

        self._bundle = bundle

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

        Continue indicates if this should be the stopping point  # noqa: E501

        :return: The _continue of this Zone.  # noqa: E501
        :rtype: bool
        """
        return self.__continue

    @_continue.setter
    def _continue(self, _continue):
        """Sets the _continue of this Zone.

        Continue indicates if this should be the stopping point  # noqa: E501

        :param _continue: The _continue of this Zone.  # noqa: E501
        :type: bool
        """

        self.__continue = _continue

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

        CreatedAt is the time that this object was created.  # noqa: E501

        :return: The created_at of this Zone.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Zone.

        CreatedAt is the time that this object was created.  # noqa: E501

        :param created_at: The created_at of this Zone.  # noqa: E501
        :type: datetime
        """

        self._created_at = created_at

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

        CreatedBy stores the value of the user that created this object. Note: This value is stored ONLY if the object was created by a user which means that `currentUserName` needs to be populated in the authBlob  # noqa: E501

        :return: The created_by of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._created_by

    @created_by.setter
    def created_by(self, created_by):
        """Sets the created_by of this Zone.

        CreatedBy stores the value of the user that created this object. Note: This value is stored ONLY if the object was created by a user which means that `currentUserName` needs to be populated in the authBlob  # noqa: E501

        :param created_by: The created_by of this Zone.  # noqa: E501
        :type: str
        """

        self._created_by = created_by

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

        Description is a string for providing a simple description  # noqa: E501

        :return: The description of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this Zone.

        Description is a string for providing a simple description  # noqa: E501

        :param description: The description of this Zone.  # noqa: E501
        :type: str
        """

        self._description = description

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

        Documentation is a string for providing additional in depth information.  # noqa: E501

        :return: The documentation of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._documentation

    @documentation.setter
    def documentation(self, documentation):
        """Sets the documentation of this Zone.

        Documentation is a string for providing additional in depth information.  # noqa: E501

        :param documentation: The documentation of this Zone.  # noqa: E501
        :type: str
        """

        self._documentation = documentation

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

        Endpoint tracks the owner of the object among DRP endpoints  # noqa: E501

        :return: The endpoint of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._endpoint

    @endpoint.setter
    def endpoint(self, endpoint):
        """Sets the endpoint of this Zone.

        Endpoint tracks the owner of the object among DRP endpoints  # noqa: E501

        :param endpoint: The endpoint of this Zone.  # noqa: E501
        :type: str
        """

        self._endpoint = endpoint

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

        If there are any errors in the validation process, they will be available here.  # noqa: E501

        :return: The errors of this Zone.  # noqa: E501
        :rtype: list[str]
        """
        return self._errors

    @errors.setter
    def errors(self, errors):
        """Sets the errors of this Zone.

        If there are any errors in the validation process, they will be available here.  # noqa: E501

        :param errors: The errors of this Zone.  # noqa: E501
        :type: list[str]
        """

        self._errors = errors

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

        Filters is a list of source IP filters for this zone  # noqa: E501

        :return: The filters of this Zone.  # noqa: E501
        :rtype: list[ZoneFilter]
        """
        return self._filters

    @filters.setter
    def filters(self, filters):
        """Sets the filters of this Zone.

        Filters is a list of source IP filters for this zone  # noqa: E501

        :param filters: The filters of this Zone.  # noqa: E501
        :type: list[ZoneFilter]
        """

        self._filters = filters

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

        Forwarders are the request forwarders when a fallthrough happens in this zone  # noqa: E501

        :return: The forwarders of this Zone.  # noqa: E501
        :rtype: list[str]
        """
        return self._forwarders

    @forwarders.setter
    def forwarders(self, forwarders):
        """Sets the forwarders of this Zone.

        Forwarders are the request forwarders when a fallthrough happens in this zone  # noqa: E501

        :param forwarders: The forwarders of this Zone.  # noqa: E501
        :type: list[str]
        """

        self._forwarders = forwarders

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

        LastModifiedAt is the time that this object was last modified.  # noqa: E501

        :return: The last_modified_at of this Zone.  # noqa: E501
        :rtype: datetime
        """
        return self._last_modified_at

    @last_modified_at.setter
    def last_modified_at(self, last_modified_at):
        """Sets the last_modified_at of this Zone.

        LastModifiedAt is the time that this object was last modified.  # noqa: E501

        :param last_modified_at: The last_modified_at of this Zone.  # noqa: E501
        :type: datetime
        """

        self._last_modified_at = last_modified_at

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

        LastModifiedBy stores the value of the user that last modified this object. NOTE: This value is populated ONLY if the object was modified by a user which means any actions done using machine tokens will not get tracked  # noqa: E501

        :return: The last_modified_by of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._last_modified_by

    @last_modified_by.setter
    def last_modified_by(self, last_modified_by):
        """Sets the last_modified_by of this Zone.

        LastModifiedBy stores the value of the user that last modified this object. NOTE: This value is populated ONLY if the object was modified by a user which means any actions done using machine tokens will not get tracked  # noqa: E501

        :param last_modified_by: The last_modified_by of this Zone.  # noqa: E501
        :type: str
        """

        self._last_modified_by = last_modified_by

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


        :return: The meta of this Zone.  # noqa: E501
        :rtype: Meta
        """
        return self._meta

    @meta.setter
    def meta(self, meta):
        """Sets the meta of this Zone.


        :param meta: The meta of this Zone.  # noqa: E501
        :type: Meta
        """

        self._meta = meta

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

        Name is the name of the zone.  # noqa: E501

        :return: The name of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Zone.

        Name is the name of the zone.  # noqa: E501

        :param name: The name of this Zone.  # noqa: E501
        :type: str
        """

        self._name = name

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

        Origin is the base name of the zone (e.g. rackn.test.)  # noqa: E501

        :return: The origin of this Zone.  # noqa: E501
        :rtype: str
        """
        return self._origin

    @origin.setter
    def origin(self, origin):
        """Sets the origin of this Zone.

        Origin is the base name of the zone (e.g. rackn.test.)  # noqa: E501

        :param origin: The origin of this Zone.  # noqa: E501
        :type: str
        """

        self._origin = origin

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

        Priority is the numeric priority from low to high when evalulating requests  # noqa: E501

        :return: The priority of this Zone.  # noqa: E501
        :rtype: int
        """
        return self._priority

    @priority.setter
    def priority(self, priority):
        """Sets the priority of this Zone.

        Priority is the numeric priority from low to high when evalulating requests  # noqa: E501

        :param priority: The priority of this Zone.  # noqa: E501
        :type: int
        """

        self._priority = priority

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

        ReadOnly tracks if the store for this object is read-only. This flag is informational, and cannot be changed via the API.  # noqa: E501

        :return: The read_only of this Zone.  # noqa: E501
        :rtype: bool
        """
        return self._read_only

    @read_only.setter
    def read_only(self, read_only):
        """Sets the read_only of this Zone.

        ReadOnly tracks if the store for this object is read-only. This flag is informational, and cannot be changed via the API.  # noqa: E501

        :param read_only: The read_only of this Zone.  # noqa: E501
        :type: bool
        """

        self._read_only = read_only

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

        Records contains the data to return  # noqa: E501

        :return: The records of this Zone.  # noqa: E501
        :rtype: list[ZoneRecord]
        """
        return self._records

    @records.setter
    def records(self, records):
        """Sets the records of this Zone.

        Records contains the data to return  # noqa: E501

        :param records: The records of this Zone.  # noqa: E501
        :type: list[ZoneRecord]
        """

        self._records = records

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

        TTL of the record - if 0 => uses 3600 as default  # noqa: E501

        :return: The ttl of this Zone.  # noqa: E501
        :rtype: int
        """
        return self._ttl

    @ttl.setter
    def ttl(self, ttl):
        """Sets the ttl of this Zone.

        TTL of the record - if 0 => uses 3600 as default  # noqa: E501

        :param ttl: The ttl of this Zone.  # noqa: E501
        :type: int
        """

        self._ttl = ttl

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

        Validated tracks whether or not the model has been validated.  # noqa: E501

        :return: The validated of this Zone.  # noqa: E501
        :rtype: bool
        """
        return self._validated

    @validated.setter
    def validated(self, validated):
        """Sets the validated of this Zone.

        Validated tracks whether or not the model has been validated.  # noqa: E501

        :param validated: The validated of this Zone.  # noqa: E501
        :type: bool
        """

        self._validated = validated

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

        for attr, _ in six.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
        if issubclass(Zone, dict):
            for key, value in self.items():
                result[key] = 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, Zone):
            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, Zone):
            return True

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