# coding: utf-8

"""
    Rosbag Bazaar API

    API to access the Rosbag Bazaar service

    OpenAPI spec version: 0.0.0
    Contact: hhendrik@student.ethz.ch
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class Bag(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 = {
        'store': 'str',
        'store_data': 'object',
        'name': 'str',
        'size': 'int',
        'processed': 'bool',
        'time_discovered': 'datetime',
        'time_recorded': 'datetime',
        'duration': 'float',
        'topics': 'list[Topic]'
    }

    attribute_map = {
        'store': 'store',
        'store_data': 'store_data',
        'name': 'name',
        'size': 'size',
        'processed': 'processed',
        'time_discovered': 'time_discovered',
        'time_recorded': 'time_recorded',
        'duration': 'duration',
        'topics': 'topics'
    }

    def __init__(self, store=None, store_data=None, name=None, size=None, processed=None, time_discovered=None, time_recorded=None, duration=None, topics=None):
        """
        Bag - a model defined in Swagger
        """

        self._store = None
        self._store_data = None
        self._name = None
        self._size = None
        self._processed = None
        self._time_discovered = None
        self._time_recorded = None
        self._duration = None
        self._topics = None

        self.store = store
        if store_data is not None:
          self.store_data = store_data
        self.name = name
        self.size = size
        self.processed = processed
        self.time_discovered = time_discovered
        if time_recorded is not None:
          self.time_recorded = time_recorded
        if duration is not None:
          self.duration = duration
        if topics is not None:
          self.topics = topics

    @property
    def store(self):
        """
        Gets the store of this Bag.
        The store that stores this rosbag

        :return: The store of this Bag.
        :rtype: str
        """
        return self._store

    @store.setter
    def store(self, store):
        """
        Sets the store of this Bag.
        The store that stores this rosbag

        :param store: The store of this Bag.
        :type: str
        """
        if store is None:
            raise ValueError("Invalid value for `store`, must not be `None`")

        self._store = store

    @property
    def store_data(self):
        """
        Gets the store_data of this Bag.
        Data that is specific to the type of rosbag store.

        :return: The store_data of this Bag.
        :rtype: object
        """
        return self._store_data

    @store_data.setter
    def store_data(self, store_data):
        """
        Sets the store_data of this Bag.
        Data that is specific to the type of rosbag store.

        :param store_data: The store_data of this Bag.
        :type: object
        """

        self._store_data = store_data

    @property
    def name(self):
        """
        Gets the name of this Bag.
        The name of this rosbag

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

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

        :param name: The name of this Bag.
        :type: str
        """
        if name is None:
            raise ValueError("Invalid value for `name`, must not be `None`")

        self._name = name

    @property
    def size(self):
        """
        Gets the size of this Bag.
        Filesize of this rosbag in bytes

        :return: The size of this Bag.
        :rtype: int
        """
        return self._size

    @size.setter
    def size(self, size):
        """
        Sets the size of this Bag.
        Filesize of this rosbag in bytes

        :param size: The size of this Bag.
        :type: int
        """
        if size is None:
            raise ValueError("Invalid value for `size`, must not be `None`")

        self._size = size

    @property
    def processed(self):
        """
        Gets the processed of this Bag.
        Is this rosbag processed already

        :return: The processed of this Bag.
        :rtype: bool
        """
        return self._processed

    @processed.setter
    def processed(self, processed):
        """
        Sets the processed of this Bag.
        Is this rosbag processed already

        :param processed: The processed of this Bag.
        :type: bool
        """
        if processed is None:
            raise ValueError("Invalid value for `processed`, must not be `None`")

        self._processed = processed

    @property
    def time_discovered(self):
        """
        Gets the time_discovered of this Bag.
        Time this rosbag was discovered

        :return: The time_discovered of this Bag.
        :rtype: datetime
        """
        return self._time_discovered

    @time_discovered.setter
    def time_discovered(self, time_discovered):
        """
        Sets the time_discovered of this Bag.
        Time this rosbag was discovered

        :param time_discovered: The time_discovered of this Bag.
        :type: datetime
        """
        if time_discovered is None:
            raise ValueError("Invalid value for `time_discovered`, must not be `None`")

        self._time_discovered = time_discovered

    @property
    def time_recorded(self):
        """
        Gets the time_recorded of this Bag.
        Time this rosbag was recorded

        :return: The time_recorded of this Bag.
        :rtype: datetime
        """
        return self._time_recorded

    @time_recorded.setter
    def time_recorded(self, time_recorded):
        """
        Sets the time_recorded of this Bag.
        Time this rosbag was recorded

        :param time_recorded: The time_recorded of this Bag.
        :type: datetime
        """

        self._time_recorded = time_recorded

    @property
    def duration(self):
        """
        Gets the duration of this Bag.
        Duration of this rosbag in seconds

        :return: The duration of this Bag.
        :rtype: float
        """
        return self._duration

    @duration.setter
    def duration(self, duration):
        """
        Sets the duration of this Bag.
        Duration of this rosbag in seconds

        :param duration: The duration of this Bag.
        :type: float
        """

        self._duration = duration

    @property
    def topics(self):
        """
        Gets the topics of this Bag.

        :return: The topics of this Bag.
        :rtype: list[Topic]
        """
        return self._topics

    @topics.setter
    def topics(self, topics):
        """
        Sets the topics of this Bag.

        :param topics: The topics of this Bag.
        :type: list[Topic]
        """

        self._topics = topics

    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, Bag):
            return False

        return self.__dict__ == other.__dict__

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