# coding: utf-8

"""
    Trackside Software TeamDB API v2.0

    This API enables you to access TeamDB data  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from teamdbapi.configuration import Configuration


class Version(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 = {
        'id': 'str',
        'name': 'str',
        'description': 'str',
        'created_date': 'datetime',
        'reference_files': 'str',
        'target_id': 'str',
        'auto_generate_assembly_id': 'str',
        'last_update_date_utc': 'datetime',
        'last_update_user': 'str',
        'replication_filter': 'str'
    }

    attribute_map = {
        'id': 'Id',
        'name': 'Name',
        'description': 'Description',
        'created_date': 'CreatedDate',
        'reference_files': 'ReferenceFiles',
        'target_id': 'TargetId',
        'auto_generate_assembly_id': 'AutoGenerateAssemblyId',
        'last_update_date_utc': 'LastUpdateDateUtc',
        'last_update_user': 'LastUpdateUser',
        'replication_filter': 'ReplicationFilter'
    }

    def __init__(self, id=None, name=None, description=None, created_date=None, reference_files=None, target_id=None, auto_generate_assembly_id=None, last_update_date_utc=None, last_update_user=None, replication_filter=None, _configuration=None):  # noqa: E501
        """Version - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._name = None
        self._description = None
        self._created_date = None
        self._reference_files = None
        self._target_id = None
        self._auto_generate_assembly_id = None
        self._last_update_date_utc = None
        self._last_update_user = None
        self._replication_filter = None
        self.discriminator = None

        self.id = id
        self.name = name
        if description is not None:
            self.description = description
        self.created_date = created_date
        self.reference_files = reference_files
        self.target_id = target_id
        if auto_generate_assembly_id is not None:
            self.auto_generate_assembly_id = auto_generate_assembly_id
        if last_update_date_utc is not None:
            self.last_update_date_utc = last_update_date_utc
        if last_update_user is not None:
            self.last_update_user = last_update_user
        if replication_filter is not None:
            self.replication_filter = replication_filter

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

        The unique version Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Version.  # noqa: E501

        :return: The id of this Version.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Version.

        The unique version Id.  Set the Id to Guid.Empty (00000000-0000-0000-0000-000000000000) if you want to create a new Version.  # noqa: E501

        :param id: The id of this Version.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        The version name  # noqa: E501

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

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

        The version name  # noqa: E501

        :param name: The name of this Version.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                name is not None and len(name) < 1):
            raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`")  # noqa: E501

        self._name = name

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

        The version description  # noqa: E501

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

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

        The version description  # noqa: E501

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

        self._description = description

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

        The version creation date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

        :return: The created_date of this Version.  # noqa: E501
        :rtype: datetime
        """
        return self._created_date

    @created_date.setter
    def created_date(self, created_date):
        """Sets the created_date of this Version.

        The version creation date.  The date must be an UTC date time. Here is an example : 2018-06-05T12:36:34.168Z  # noqa: E501

        :param created_date: The created_date of this Version.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and created_date is None:
            raise ValueError("Invalid value for `created_date`, must not be `None`")  # noqa: E501

        self._created_date = created_date

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

        The path to the file used to create the version.  In json, you have to double the \\ in the path. For example : C:\\\\\\\\MyFolder\\\\\\\\MyFile.m  # noqa: E501

        :return: The reference_files of this Version.  # noqa: E501
        :rtype: str
        """
        return self._reference_files

    @reference_files.setter
    def reference_files(self, reference_files):
        """Sets the reference_files of this Version.

        The path to the file used to create the version.  In json, you have to double the \\ in the path. For example : C:\\\\\\\\MyFolder\\\\\\\\MyFile.m  # noqa: E501

        :param reference_files: The reference_files of this Version.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and reference_files is None:
            raise ValueError("Invalid value for `reference_files`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                reference_files is not None and len(reference_files) < 1):
            raise ValueError("Invalid value for `reference_files`, length must be greater than or equal to `1`")  # noqa: E501

        self._reference_files = reference_files

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

        The target unique id to which the version belongs to.  # noqa: E501

        :return: The target_id of this Version.  # noqa: E501
        :rtype: str
        """
        return self._target_id

    @target_id.setter
    def target_id(self, target_id):
        """Sets the target_id of this Version.

        The target unique id to which the version belongs to.  # noqa: E501

        :param target_id: The target_id of this Version.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and target_id is None:
            raise ValueError("Invalid value for `target_id`, must not be `None`")  # noqa: E501

        self._target_id = target_id

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

        The assembly unique Id used as reference when AutoGenerateAssembly is activated on the parent target.  Otherwise, set the property to Guid.Empty (00000000-0000-0000-0000-000000000000).  # noqa: E501

        :return: The auto_generate_assembly_id of this Version.  # noqa: E501
        :rtype: str
        """
        return self._auto_generate_assembly_id

    @auto_generate_assembly_id.setter
    def auto_generate_assembly_id(self, auto_generate_assembly_id):
        """Sets the auto_generate_assembly_id of this Version.

        The assembly unique Id used as reference when AutoGenerateAssembly is activated on the parent target.  Otherwise, set the property to Guid.Empty (00000000-0000-0000-0000-000000000000).  # noqa: E501

        :param auto_generate_assembly_id: The auto_generate_assembly_id of this Version.  # noqa: E501
        :type: str
        """

        self._auto_generate_assembly_id = auto_generate_assembly_id

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

        The last utc date time when the properties of the version have been updated  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_date_utc of this Version.  # noqa: E501
        :rtype: datetime
        """
        return self._last_update_date_utc

    @last_update_date_utc.setter
    def last_update_date_utc(self, last_update_date_utc):
        """Sets the last_update_date_utc of this Version.

        The last utc date time when the properties of the version have been updated  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_date_utc: The last_update_date_utc of this Version.  # noqa: E501
        :type: datetime
        """

        self._last_update_date_utc = last_update_date_utc

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

        The name of the last user having updated the assembly.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :return: The last_update_user of this Version.  # noqa: E501
        :rtype: str
        """
        return self._last_update_user

    @last_update_user.setter
    def last_update_user(self, last_update_user):
        """Sets the last_update_user of this Version.

        The name of the last user having updated the assembly.  This field will be automatically updated from the server side each time you update the object.  # noqa: E501

        :param last_update_user: The last_update_user of this Version.  # noqa: E501
        :type: str
        """

        self._last_update_user = last_update_user

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

        The level of the filter used for the replication  # noqa: E501

        :return: The replication_filter of this Version.  # noqa: E501
        :rtype: str
        """
        return self._replication_filter

    @replication_filter.setter
    def replication_filter(self, replication_filter):
        """Sets the replication_filter of this Version.

        The level of the filter used for the replication  # noqa: E501

        :param replication_filter: The replication_filter of this Version.  # noqa: E501
        :type: str
        """
        allowed_values = ["NotForReplication", "ForReplication"]  # noqa: E501
        if (self._configuration.client_side_validation and
                replication_filter not in allowed_values):
            raise ValueError(
                "Invalid value for `replication_filter` ({0}), must be one of {1}"  # noqa: E501
                .format(replication_filter, allowed_values)
            )

        self._replication_filter = replication_filter

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

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