# coding: utf-8

"""
    Tator REST API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.6.5
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from ..configuration import Configuration


class Applet(object):
    """
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'categories': 'list[str]',
        'description': 'str',
        'html_file': 'str',
        'id': 'int',
        'name': 'str',
        'project': 'int',
        'rendered': 'str',
        'template': 'int',
        'tparams': 'list[Parameter]'
    }

    attribute_map = {
        'categories': 'categories',
        'description': 'description',
        'html_file': 'html_file',
        'id': 'id',
        'name': 'name',
        'project': 'project',
        'rendered': 'rendered',
        'template': 'template',
        'tparams': 'tparams'
    }

    def __init__(self, categories=None, description=None, html_file=None, id=None, name=None, project=None, rendered=None, template=None, tparams=[], local_vars_configuration=None):  # noqa: E501
        """Applet - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._categories = None
        self._description = None
        self._html_file = None
        self._id = None
        self._name = None
        self._project = None
        self._rendered = None
        self._template = None
        self._tparams = None
        self.discriminator = None

        if categories is not None:
            self.categories = categories
        if description is not None:
            self.description = description
        if html_file is not None:
            self.html_file = html_file
        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if project is not None:
            self.project = project
        if rendered is not None:
            self.rendered = rendered
        self.template = template
        if tparams is not None:
            self.tparams = tparams

    @property
    def categories(self):
        """
        List of categories the applet belongs to

        :return: The categories of this Applet. 
        :rtype: list[str]
        """
        return self._categories

    @categories.setter
    def categories(self, categories):
        """
        List of categories the applet belongs to

        :param categories: The categories of this Applet.
        :type: list[str]
        """

        self._categories = categories

    @property
    def description(self):
        """
        Description of applet

        :return: The description of this Applet. 
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """
        Description of applet

        :param description: The description of this Applet.
        :type: str
        """

        self._description = description

    @property
    def html_file(self):
        """
        Server URL to applet HTML file

        :return: The html_file of this Applet. 
        :rtype: str
        """
        return self._html_file

    @html_file.setter
    def html_file(self, html_file):
        """
        Server URL to applet HTML file

        :param html_file: The html_file of this Applet.
        :type: str
        """

        self._html_file = html_file

    @property
    def id(self):
        """
        Unique integer identifying the applet

        :return: The id of this Applet. 
        :rtype: int
        """
        return self._id

    @id.setter
    def id(self, id):
        """
        Unique integer identifying the applet

        :param id: The id of this Applet.
        :type: int
        """

        self._id = id

    @property
    def name(self):
        """
        Name of applet

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

    @name.setter
    def name(self, name):
        """
        Name of applet

        :param name: The name of this Applet.
        :type: str
        """

        self._name = name

    @property
    def project(self):
        """
        Unique integer identifying the project associated with the applet

        :return: The project of this Applet. 
        :rtype: int
        """
        return self._project

    @project.setter
    def project(self, project):
        """
        Unique integer identifying the project associated with the applet

        :param project: The project of this Applet.
        :type: int
        """

        self._project = project

    @property
    def rendered(self):
        """
        HTML format text containing rendered applet template. Only filled for single retrievals (not lists).

        :return: The rendered of this Applet. 
        :rtype: str
        """
        return self._rendered

    @rendered.setter
    def rendered(self, rendered):
        """
        HTML format text containing rendered applet template. Only filled for single retrievals (not lists).

        :param rendered: The rendered of this Applet.
        :type: str
        """

        self._rendered = rendered

    @property
    def template(self):
        """
        Unique integer identifying a hosted template. If set, `html_file` is ignored.

        :return: The template of this Applet. 
        :rtype: int
        """
        return self._template

    @template.setter
    def template(self, template):
        """
        Unique integer identifying a hosted template. If set, `html_file` is ignored.

        :param template: The template of this Applet.
        :type: int
        """

        self._template = template

    @property
    def tparams(self):
        """
        Template parameters used for rendering hosted template, if set.

        :return: The tparams of this Applet. 
        :rtype: list[Parameter]
        """
        return self._tparams

    @tparams.setter
    def tparams(self, tparams):
        """
        Template parameters used for rendering hosted template, if set.

        :param tparams: The tparams of this Applet.
        :type: list[Parameter]
        """

        self._tparams = tparams

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.openapi_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, Applet):
            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, Applet):
            return True

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