# coding: utf-8

from __future__ import absolute_import
from typing import List, Dict

import pandas

from .base_model_ import Model
from ..util import deserialize_model


class Phenotype(Model):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """

    def __init__(
        self,
        id: str = None,
        consortium: str = None,
        outcome: str = None,
        full_name: str = None,
        typ: str = None,
        ref: str = None,
        ref_link: str = None,
        data_link: str = None,
        data_path: str = None,
    ):
        """
        Phenotype - a model defined in Swagger

        :param id: dataset ID.
        :type id: str
        :param consortium: dataset consortium.
        :type consortium: str
        :param outcome: dataset outcome
        :type outcome: str
        :param full_name: dataset full name
        :type full_name: str
        :param typ: dataset type
        :type typ: str
        :param ref: dataset bibliographic reference
        :type ref: str
        :param ref_link: dataset bibliographic reference link
        :type ref_link: str
        :param data_link: dataset link
        :type data_link: str
        :param data_path: dataset path
        :type data_path: str
        """
        self.swagger_types = {
            "id": str,
            "consortium": str,
            "outcome": str,
            "full_name": str,
            "type": str,
            "ref": str,
            "ref_link": str,
            "data_link": str,
            "data_path": str,
        }

        self.attribute_map = {
            "id": "id",
            "consortium": "consortium",
            "outcome": "outcome",
            "full_name": "full_name",
            "type": "type",
            "ref": "ref",
            "ref_link": "ref_link",
            "data_link": "data_link",
            "data_path": "data_path",
        }

        self._id = id
        self._consortium = consortium
        self._outcome = outcome
        self._full_name = full_name
        self._type = typ
        self._ref = ref
        self._ref_link = ref_link
        self._data_link = data_link
        self._data_path = data_path

    @classmethod
    def from_dict(cls, dikt) -> "Phenotype":
        """
        Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The Phenotype of this Phenotype.
        :rtype: Phenotype
        """
        return deserialize_model(dikt, cls)

    @property
    def id(self) -> str:
        """
        Gets the id of this Phenotype.

        :return: The id of this Phenotype.
        :rtype: str
        """
        return self._id

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

        :param id: The id of this Phenotype.
        :type id: str
        """

        self._id = id

    @property
    def consortium(self) -> str:
        """
        Gets the consortium of this Phenotype dataset.

        :return: The consortium of this Phenotype dataset.
        :rtype: str
        """
        return self._consortium

    @consortium.setter
    def consortium(self, consortium: str):
        """
        Sets the consortium of this Phenotype dataset.

        :param consortium: The consortium of this Phenotype dataset.
        :type consortium: str
        """

        self._consortium = consortium

    @property
    def outcome(self) -> str:
        """
        Gets the outcome of this Phenotype dataset.

        :return: The outcome of this Phenotype dataset.
        :rtype: str
        """
        return self._outcome

    @outcome.setter
    def outcome(self, outcome: str):
        """
        Sets the outcome of this Phenotype dataset.

        :param outcome: The outcome of this Phenotype dataset.
        :type outcome: str
        """

        self._outcome = outcome

    @property
    def full_name(self) -> str:
        """
        Gets the full name of this Phenotype dataset.

        :return: The full name of this Phenotype dataset.
        :rtype: str
        """
        return self._full_name

    @full_name.setter
    def full_name(self, full_name: str):
        """
        Sets the full name of this Phenotype dataset.

        :param full_name: The full name of this Phenotype dataset.
        :type full_name: str
        """

        self._full_name = full_name

    @property
    def type(self) -> str:
        """
        Gets the type of this Phenotype dataset.

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

    @type.setter
    def type(self, typ: str):
        """
        Sets the type of this Phenotype dataset.

        :param typ: The type of this Phenotype dataset.
        :type typ: str
        """

        self._type = typ

    @property
    def ref(self) -> str:
        """
        Gets the bibliographic reference for this Phenotype dataset.

        :return: The bibliographic reference of this Phenotype dataset.
        :rtype: str
        """
        return self._ref

    @ref.setter
    def ref(self, ref: str):
        """
        Sets the bibliographic reference of this Phenotype dataset.

        :param ref: The bibliographic reference of this Phenotype dataset.
        :type ref: str
        """

        self._ref = ref

    @property
    def ref_link(self) -> str:
        """
        Gets the bibliographic reference link for this Phenotype dataset.

        :return: The bibliographic reference link for this Phenotype dataset.
        :rtype: str
        """
        return self._ref_link

    @ref_link.setter
    def ref_link(self, ref_link: str):
        """
        Sets the bibliographic reference link for this Phenotype dataset.

        :param ref: The bibliographic reference link for this Phenotype dataset.
        :type ref: str
        """

        self._ref_link = ref_link

    @property
    def data_link(self) -> str:
        """
        Gets the data link for this Phenotype dataset.

        :return: The data link for this Phenotype dataset.
        :rtype: str
        """
        return self._data_link

    @data_link.setter
    def data_link(self, data_link: str):
        """
        Sets the data link for this Phenotype dataset.

        :param data_link: The data link for this Phenotype dataset.
        :type data_link: str
        """

        self._data_link = data_link

    @property
    def data_path(self) -> str:
        """
        Gets the data path for this Phenotype dataset.

        :return: The data path for this Phenotype dataset.
        :rtype: str
        """
        return self._data_path

    @data_path.setter
    def data_path(self, data_path: str):
        """
        Sets the data path for this Phenotype dataset.

        :param data_path: The data path for this Phenotype dataset.
        :type data_path: str
        """

        self._data_path = data_path


def get_available_phenotypes(init_file_path: str):
    phenolist_dataframe = pandas.read_hdf(init_file_path, "PhenoList")
    phenotypes = []
    for index, row in phenolist_dataframe.iterrows():
        phenotype = Phenotype(
            id=row["ID"],
            consortium=row["Consortium"],
            outcome=row["Outcome"],
            ref=row["Reference"],
            full_name=row["FullName"],
            typ=row["Type"],
            ref_link=row["ReferenceLink"],
            data_link=row["dataLink"],
            data_path=row["internalDataLink"],
        )
        phenotypes.append(phenotype)
    return phenotypes
