# coding: utf-8

"""
    Curia Platform API

    These are the docs for the curia platform API. To test, generate an authorization token first.  # noqa: E501

    OpenAPI spec version: 3.10.4
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class Population(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',
        'last_updated_by': 'str',
        'created_by': 'str',
        'created_at': 'datetime',
        'updated_at': 'datetime',
        'archived_at': 'datetime',
        'version': 'float',
        'population_store_id': 'str',
        'primary_key': 'str',
        'partion_key': 'list[str]',
        'population_store': 'PopulationStore',
        'model_populations': 'list[ModelPopulation]',
        'outcomes': 'list[OutcomeDefinition]',
        'interventions': 'list[InterventionDefinition]',
        'cohorts': 'list[CohortDefinition]',
        'organization_id': 'str',
        'organization': 'Organization'
    }

    attribute_map = {
        'id': 'id',
        'last_updated_by': 'lastUpdatedBy',
        'created_by': 'createdBy',
        'created_at': 'createdAt',
        'updated_at': 'updatedAt',
        'archived_at': 'archivedAt',
        'version': 'version',
        'population_store_id': 'populationStoreId',
        'primary_key': 'primaryKey',
        'partion_key': 'partionKey',
        'population_store': 'populationStore',
        'model_populations': 'modelPopulations',
        'outcomes': 'outcomes',
        'interventions': 'interventions',
        'cohorts': 'cohorts',
        'organization_id': 'organizationId',
        'organization': 'organization'
    }

    def __init__(self, id=None, last_updated_by=None, created_by=None, created_at=None, updated_at=None, archived_at=None, version=None, population_store_id=None, primary_key=None, partion_key=None, population_store=None, model_populations=None, outcomes=None, interventions=None, cohorts=None, organization_id=None, organization=None):  # noqa: E501
        """Population - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._last_updated_by = None
        self._created_by = None
        self._created_at = None
        self._updated_at = None
        self._archived_at = None
        self._version = None
        self._population_store_id = None
        self._primary_key = None
        self._partion_key = None
        self._population_store = None
        self._model_populations = None
        self._outcomes = None
        self._interventions = None
        self._cohorts = None
        self._organization_id = None
        self._organization = None
        self.discriminator = None
        if id is not None:
            self.id = id
        if last_updated_by is not None:
            self.last_updated_by = last_updated_by
        if created_by is not None:
            self.created_by = created_by
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        if archived_at is not None:
            self.archived_at = archived_at
        if version is not None:
            self.version = version
        self.population_store_id = population_store_id
        if primary_key is not None:
            self.primary_key = primary_key
        if partion_key is not None:
            self.partion_key = partion_key
        if population_store is not None:
            self.population_store = population_store
        if model_populations is not None:
            self.model_populations = model_populations
        if outcomes is not None:
            self.outcomes = outcomes
        if interventions is not None:
            self.interventions = interventions
        if cohorts is not None:
            self.cohorts = cohorts
        self.organization_id = organization_id
        if organization is not None:
            self.organization = organization

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


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

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


        :param id: The id of this Population.  # noqa: E501
        :type: str
        """

        self._id = id

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


        :return: The last_updated_by of this Population.  # noqa: E501
        :rtype: str
        """
        return self._last_updated_by

    @last_updated_by.setter
    def last_updated_by(self, last_updated_by):
        """Sets the last_updated_by of this Population.


        :param last_updated_by: The last_updated_by of this Population.  # noqa: E501
        :type: str
        """

        self._last_updated_by = last_updated_by

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


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

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


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

        self._created_by = created_by

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


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

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


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

        self._created_at = created_at

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


        :return: The updated_at of this Population.  # noqa: E501
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this Population.


        :param updated_at: The updated_at of this Population.  # noqa: E501
        :type: datetime
        """

        self._updated_at = updated_at

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


        :return: The archived_at of this Population.  # noqa: E501
        :rtype: datetime
        """
        return self._archived_at

    @archived_at.setter
    def archived_at(self, archived_at):
        """Sets the archived_at of this Population.


        :param archived_at: The archived_at of this Population.  # noqa: E501
        :type: datetime
        """

        self._archived_at = archived_at

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


        :return: The version of this Population.  # noqa: E501
        :rtype: float
        """
        return self._version

    @version.setter
    def version(self, version):
        """Sets the version of this Population.


        :param version: The version of this Population.  # noqa: E501
        :type: float
        """

        self._version = version

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


        :return: The population_store_id of this Population.  # noqa: E501
        :rtype: str
        """
        return self._population_store_id

    @population_store_id.setter
    def population_store_id(self, population_store_id):
        """Sets the population_store_id of this Population.


        :param population_store_id: The population_store_id of this Population.  # noqa: E501
        :type: str
        """
        if population_store_id is None:
            raise ValueError("Invalid value for `population_store_id`, must not be `None`")  # noqa: E501

        self._population_store_id = population_store_id

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


        :return: The primary_key of this Population.  # noqa: E501
        :rtype: str
        """
        return self._primary_key

    @primary_key.setter
    def primary_key(self, primary_key):
        """Sets the primary_key of this Population.


        :param primary_key: The primary_key of this Population.  # noqa: E501
        :type: str
        """

        self._primary_key = primary_key

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


        :return: The partion_key of this Population.  # noqa: E501
        :rtype: list[str]
        """
        return self._partion_key

    @partion_key.setter
    def partion_key(self, partion_key):
        """Sets the partion_key of this Population.


        :param partion_key: The partion_key of this Population.  # noqa: E501
        :type: list[str]
        """

        self._partion_key = partion_key

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


        :return: The population_store of this Population.  # noqa: E501
        :rtype: PopulationStore
        """
        return self._population_store

    @population_store.setter
    def population_store(self, population_store):
        """Sets the population_store of this Population.


        :param population_store: The population_store of this Population.  # noqa: E501
        :type: PopulationStore
        """

        self._population_store = population_store

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


        :return: The model_populations of this Population.  # noqa: E501
        :rtype: list[ModelPopulation]
        """
        return self._model_populations

    @model_populations.setter
    def model_populations(self, model_populations):
        """Sets the model_populations of this Population.


        :param model_populations: The model_populations of this Population.  # noqa: E501
        :type: list[ModelPopulation]
        """

        self._model_populations = model_populations

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


        :return: The outcomes of this Population.  # noqa: E501
        :rtype: list[OutcomeDefinition]
        """
        return self._outcomes

    @outcomes.setter
    def outcomes(self, outcomes):
        """Sets the outcomes of this Population.


        :param outcomes: The outcomes of this Population.  # noqa: E501
        :type: list[OutcomeDefinition]
        """

        self._outcomes = outcomes

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


        :return: The interventions of this Population.  # noqa: E501
        :rtype: list[InterventionDefinition]
        """
        return self._interventions

    @interventions.setter
    def interventions(self, interventions):
        """Sets the interventions of this Population.


        :param interventions: The interventions of this Population.  # noqa: E501
        :type: list[InterventionDefinition]
        """

        self._interventions = interventions

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


        :return: The cohorts of this Population.  # noqa: E501
        :rtype: list[CohortDefinition]
        """
        return self._cohorts

    @cohorts.setter
    def cohorts(self, cohorts):
        """Sets the cohorts of this Population.


        :param cohorts: The cohorts of this Population.  # noqa: E501
        :type: list[CohortDefinition]
        """

        self._cohorts = cohorts

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


        :return: The organization_id of this Population.  # noqa: E501
        :rtype: str
        """
        return self._organization_id

    @organization_id.setter
    def organization_id(self, organization_id):
        """Sets the organization_id of this Population.


        :param organization_id: The organization_id of this Population.  # noqa: E501
        :type: str
        """
        if organization_id is None:
            raise ValueError("Invalid value for `organization_id`, must not be `None`")  # noqa: E501

        self._organization_id = organization_id

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


        :return: The organization of this Population.  # noqa: E501
        :rtype: Organization
        """
        return self._organization

    @organization.setter
    def organization(self, organization):
        """Sets the organization of this Population.


        :param organization: The organization of this Population.  # noqa: E501
        :type: Organization
        """

        self._organization = organization

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

        return self.__dict__ == other.__dict__

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