# coding: utf-8
try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from aoc.configuration import Configuration


class TemplateCloudInit(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 = {
        'user_data': 'str',
        'public_keys': 'list[str]',
        'hostname': 'str',
        'networks': 'list[CloudInitNetWork]',
        'nameservers': 'list[str]',
        'default_user_password': 'str'
    }

    attribute_map = {
        'user_data': 'user_data',
        'public_keys': 'public_keys',
        'hostname': 'hostname',
        'networks': 'networks',
        'nameservers': 'nameservers',
        'default_user_password': 'default_user_password'
    }

    def __init__(self, **kwargs):  # noqa: E501
        """TemplateCloudInit - a model defined in OpenAPI"""  # noqa: E501
        self.local_vars_configuration = kwargs.get("local_vars_configuration", Configuration.get_default_copy())

        self._user_data = None
        self._public_keys = None
        self._hostname = None
        self._networks = None
        self._nameservers = None
        self._default_user_password = None
        self.discriminator = None

        if "user_data" in kwargs:
            self.user_data = kwargs["user_data"]
        if "public_keys" in kwargs:
            self.public_keys = kwargs["public_keys"]
        if "hostname" in kwargs:
            self.hostname = kwargs["hostname"]
        if "networks" in kwargs:
            self.networks = kwargs["networks"]
        if "nameservers" in kwargs:
            self.nameservers = kwargs["nameservers"]
        if "default_user_password" in kwargs:
            self.default_user_password = kwargs["default_user_password"]

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


        :return: The user_data of this TemplateCloudInit.  # noqa: E501
        :rtype: str
        """
        return self._user_data

    @user_data.setter
    def user_data(self, user_data):
        """Sets the user_data of this TemplateCloudInit.


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

        self._user_data = user_data

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


        :return: The public_keys of this TemplateCloudInit.  # noqa: E501
        :rtype: list[str]
        """
        return self._public_keys

    @public_keys.setter
    def public_keys(self, public_keys):
        """Sets the public_keys of this TemplateCloudInit.


        :param public_keys: The public_keys of this TemplateCloudInit.  # noqa: E501
        :type public_keys: list[str]
        """

        self._public_keys = public_keys

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


        :return: The hostname of this TemplateCloudInit.  # noqa: E501
        :rtype: str
        """
        return self._hostname

    @hostname.setter
    def hostname(self, hostname):
        """Sets the hostname of this TemplateCloudInit.


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

        self._hostname = hostname

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


        :return: The networks of this TemplateCloudInit.  # noqa: E501
        :rtype: list[CloudInitNetWork]
        """
        return self._networks

    @networks.setter
    def networks(self, networks):
        """Sets the networks of this TemplateCloudInit.


        :param networks: The networks of this TemplateCloudInit.  # noqa: E501
        :type networks: list[CloudInitNetWork]
        """

        self._networks = networks

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


        :return: The nameservers of this TemplateCloudInit.  # noqa: E501
        :rtype: list[str]
        """
        return self._nameservers

    @nameservers.setter
    def nameservers(self, nameservers):
        """Sets the nameservers of this TemplateCloudInit.


        :param nameservers: The nameservers of this TemplateCloudInit.  # noqa: E501
        :type nameservers: list[str]
        """

        self._nameservers = nameservers

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


        :return: The default_user_password of this TemplateCloudInit.  # noqa: E501
        :rtype: str
        """
        return self._default_user_password

    @default_user_password.setter
    def default_user_password(self, default_user_password):
        """Sets the default_user_password of this TemplateCloudInit.


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

        self._default_user_password = default_user_password

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, TemplateCloudInit):
            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, TemplateCloudInit):
            return True

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