# coding: utf-8

"""
    STACKL

    stackl  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from stackl_client.configuration import Configuration


class StackInstance(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    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 = {
        'name': 'str',
        'deleted': 'bool',
        'instance_params': 'object',
        'instance_secrets': 'object',
        'services': 'dict(str, list[StackInstanceService])',
        'stack_infrastructure_template': 'str',
        'stack_application_template': 'str',
        'status': 'list[StackInstanceStatus]',
        'type': 'str',
        'category': 'str'
    }

    attribute_map = {
        'name': 'name',
        'deleted': 'deleted',
        'instance_params': 'instance_params',
        'instance_secrets': 'instance_secrets',
        'services': 'services',
        'stack_infrastructure_template': 'stack_infrastructure_template',
        'stack_application_template': 'stack_application_template',
        'status': 'status',
        'type': 'type',
        'category': 'category'
    }

    def __init__(self, name=None, deleted=False, instance_params=None, instance_secrets=None, services=None, stack_infrastructure_template=None, stack_application_template=None, status=None, type='stack_instance', category='items', local_vars_configuration=None):  # noqa: E501
        """StackInstance - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._name = None
        self._deleted = None
        self._instance_params = None
        self._instance_secrets = None
        self._services = None
        self._stack_infrastructure_template = None
        self._stack_application_template = None
        self._status = None
        self._type = None
        self._category = None
        self.discriminator = None

        self.name = name
        if deleted is not None:
            self.deleted = deleted
        if instance_params is not None:
            self.instance_params = instance_params
        if instance_secrets is not None:
            self.instance_secrets = instance_secrets
        if services is not None:
            self.services = services
        self.stack_infrastructure_template = stack_infrastructure_template
        self.stack_application_template = stack_application_template
        if status is not None:
            self.status = status
        if type is not None:
            self.type = type
        if category is not None:
            self.category = category

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


        :return: The name of this StackInstance.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this StackInstance.


        :param name: The name of this StackInstance.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501
            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501

        self._name = name

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


        :return: The deleted of this StackInstance.  # noqa: E501
        :rtype: bool
        """
        return self._deleted

    @deleted.setter
    def deleted(self, deleted):
        """Sets the deleted of this StackInstance.


        :param deleted: The deleted of this StackInstance.  # noqa: E501
        :type: bool
        """

        self._deleted = deleted

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


        :return: The instance_params of this StackInstance.  # noqa: E501
        :rtype: object
        """
        return self._instance_params

    @instance_params.setter
    def instance_params(self, instance_params):
        """Sets the instance_params of this StackInstance.


        :param instance_params: The instance_params of this StackInstance.  # noqa: E501
        :type: object
        """

        self._instance_params = instance_params

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


        :return: The instance_secrets of this StackInstance.  # noqa: E501
        :rtype: object
        """
        return self._instance_secrets

    @instance_secrets.setter
    def instance_secrets(self, instance_secrets):
        """Sets the instance_secrets of this StackInstance.


        :param instance_secrets: The instance_secrets of this StackInstance.  # noqa: E501
        :type: object
        """

        self._instance_secrets = instance_secrets

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


        :return: The services of this StackInstance.  # noqa: E501
        :rtype: dict(str, list[StackInstanceService])
        """
        return self._services

    @services.setter
    def services(self, services):
        """Sets the services of this StackInstance.


        :param services: The services of this StackInstance.  # noqa: E501
        :type: dict(str, list[StackInstanceService])
        """

        self._services = services

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


        :return: The stack_infrastructure_template of this StackInstance.  # noqa: E501
        :rtype: str
        """
        return self._stack_infrastructure_template

    @stack_infrastructure_template.setter
    def stack_infrastructure_template(self, stack_infrastructure_template):
        """Sets the stack_infrastructure_template of this StackInstance.


        :param stack_infrastructure_template: The stack_infrastructure_template of this StackInstance.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and stack_infrastructure_template is None:  # noqa: E501
            raise ValueError("Invalid value for `stack_infrastructure_template`, must not be `None`")  # noqa: E501

        self._stack_infrastructure_template = stack_infrastructure_template

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


        :return: The stack_application_template of this StackInstance.  # noqa: E501
        :rtype: str
        """
        return self._stack_application_template

    @stack_application_template.setter
    def stack_application_template(self, stack_application_template):
        """Sets the stack_application_template of this StackInstance.


        :param stack_application_template: The stack_application_template of this StackInstance.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and stack_application_template is None:  # noqa: E501
            raise ValueError("Invalid value for `stack_application_template`, must not be `None`")  # noqa: E501

        self._stack_application_template = stack_application_template

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


        :return: The status of this StackInstance.  # noqa: E501
        :rtype: list[StackInstanceStatus]
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this StackInstance.


        :param status: The status of this StackInstance.  # noqa: E501
        :type: list[StackInstanceStatus]
        """

        self._status = status

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


        :return: The type of this StackInstance.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this StackInstance.


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

        self._type = type

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


        :return: The category of this StackInstance.  # noqa: E501
        :rtype: str
        """
        return self._category

    @category.setter
    def category(self, category):
        """Sets the category of this StackInstance.


        :param category: The category of this StackInstance.  # noqa: E501
        :type: str
        """

        self._category = category

    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, StackInstance):
            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, StackInstance):
            return True

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