# coding: utf-8

"""
    CodeChef API

    CodeChef API to support different applications.  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from codechef_client.models.rank_list_problem_score import RankListProblemScore  # noqa: F401,E501


class RankList(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 = {
        'rank': 'str',
        'username': 'str',
        'total_time': 'str',
        'penalty': 'int',
        'country': 'str',
        'country_code': 'str',
        'institution': 'str',
        'institution_type': 'str',
        'contest_code': 'str',
        'total_score': 'int',
        'problem_score': 'RankListProblemScore'
    }

    attribute_map = {
        'rank': 'rank',
        'username': 'username',
        'total_time': 'totalTime',
        'penalty': 'penalty',
        'country': 'country',
        'country_code': 'countryCode',
        'institution': 'institution',
        'institution_type': 'institutionType',
        'contest_code': 'contestCode',
        'total_score': 'totalScore',
        'problem_score': 'problemScore'
    }

    def __init__(self, rank=None, username=None, total_time=None, penalty=None, country=None, country_code=None, institution=None, institution_type=None, contest_code=None, total_score=None, problem_score=None):  # noqa: E501
        """RankList - a model defined in Swagger"""  # noqa: E501

        self._rank = None
        self._username = None
        self._total_time = None
        self._penalty = None
        self._country = None
        self._country_code = None
        self._institution = None
        self._institution_type = None
        self._contest_code = None
        self._total_score = None
        self._problem_score = None
        self.discriminator = None

        if rank is not None:
            self.rank = rank
        if username is not None:
            self.username = username
        if total_time is not None:
            self.total_time = total_time
        if penalty is not None:
            self.penalty = penalty
        if country is not None:
            self.country = country
        if country_code is not None:
            self.country_code = country_code
        if institution is not None:
            self.institution = institution
        if institution_type is not None:
            self.institution_type = institution_type
        if contest_code is not None:
            self.contest_code = contest_code
        if total_score is not None:
            self.total_score = total_score
        if problem_score is not None:
            self.problem_score = problem_score

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

        Contest code  # noqa: E501

        :return: The rank of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._rank

    @rank.setter
    def rank(self, rank):
        """Sets the rank of this RankList.

        Contest code  # noqa: E501

        :param rank: The rank of this RankList.  # noqa: E501
        :type: str
        """

        self._rank = rank

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

        Username  # noqa: E501

        :return: The username of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._username

    @username.setter
    def username(self, username):
        """Sets the username of this RankList.

        Username  # noqa: E501

        :param username: The username of this RankList.  # noqa: E501
        :type: str
        """

        self._username = username

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

        Total time  # noqa: E501

        :return: The total_time of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._total_time

    @total_time.setter
    def total_time(self, total_time):
        """Sets the total_time of this RankList.

        Total time  # noqa: E501

        :param total_time: The total_time of this RankList.  # noqa: E501
        :type: str
        """

        self._total_time = total_time

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

        Penalty  # noqa: E501

        :return: The penalty of this RankList.  # noqa: E501
        :rtype: int
        """
        return self._penalty

    @penalty.setter
    def penalty(self, penalty):
        """Sets the penalty of this RankList.

        Penalty  # noqa: E501

        :param penalty: The penalty of this RankList.  # noqa: E501
        :type: int
        """

        self._penalty = penalty

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

        Country to which the user belongs.  # noqa: E501

        :return: The country of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._country

    @country.setter
    def country(self, country):
        """Sets the country of this RankList.

        Country to which the user belongs.  # noqa: E501

        :param country: The country of this RankList.  # noqa: E501
        :type: str
        """

        self._country = country

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

        Code of the country eg: IN for India  # noqa: E501

        :return: The country_code of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._country_code

    @country_code.setter
    def country_code(self, country_code):
        """Sets the country_code of this RankList.

        Code of the country eg: IN for India  # noqa: E501

        :param country_code: The country_code of this RankList.  # noqa: E501
        :type: str
        """

        self._country_code = country_code

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

        Institution to which the user belongs.  # noqa: E501

        :return: The institution of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._institution

    @institution.setter
    def institution(self, institution):
        """Sets the institution of this RankList.

        Institution to which the user belongs.  # noqa: E501

        :param institution: The institution of this RankList.  # noqa: E501
        :type: str
        """

        self._institution = institution

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

        Whether institution type is school, college, organization.  # noqa: E501

        :return: The institution_type of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._institution_type

    @institution_type.setter
    def institution_type(self, institution_type):
        """Sets the institution_type of this RankList.

        Whether institution type is school, college, organization.  # noqa: E501

        :param institution_type: The institution_type of this RankList.  # noqa: E501
        :type: str
        """

        self._institution_type = institution_type

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

        Contest code eg. JAN13  # noqa: E501

        :return: The contest_code of this RankList.  # noqa: E501
        :rtype: str
        """
        return self._contest_code

    @contest_code.setter
    def contest_code(self, contest_code):
        """Sets the contest_code of this RankList.

        Contest code eg. JAN13  # noqa: E501

        :param contest_code: The contest_code of this RankList.  # noqa: E501
        :type: str
        """

        self._contest_code = contest_code

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

        Total score earned by user  # noqa: E501

        :return: The total_score of this RankList.  # noqa: E501
        :rtype: int
        """
        return self._total_score

    @total_score.setter
    def total_score(self, total_score):
        """Sets the total_score of this RankList.

        Total score earned by user  # noqa: E501

        :param total_score: The total_score of this RankList.  # noqa: E501
        :type: int
        """

        self._total_score = total_score

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


        :return: The problem_score of this RankList.  # noqa: E501
        :rtype: RankListProblemScore
        """
        return self._problem_score

    @problem_score.setter
    def problem_score(self, problem_score):
        """Sets the problem_score of this RankList.


        :param problem_score: The problem_score of this RankList.  # noqa: E501
        :type: RankListProblemScore
        """

        self._problem_score = problem_score

    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

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

        return self.__dict__ == other.__dict__

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