# coding: utf-8

"""
Alteryx Server API V3

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

OpenAPI spec version: 3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

from src.server_client.configuration import Configuration


class Subscription(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 = {
        "name": "str",
        "api_key": "str",
        "api_secret": "str",
        "active": "bool",
        "expiration_date": "str",
        "exp_date": "datetime",
        "date_updated": "datetime",
        "api_enabled": "bool",
        "can_share_schedules": "bool",
        "credential_id": "str",
        "credentials": "list[SubscriptionCredential]",
        "data_connections": "list[SubscriptionDataConnection]",
        "id": "str",
    }

    attribute_map = {
        "name": "name",
        "api_key": "apiKey",
        "api_secret": "apiSecret",
        "active": "active",
        "expiration_date": "expirationDate",
        "exp_date": "expDate",
        "date_updated": "dateUpdated",
        "api_enabled": "apiEnabled",
        "can_share_schedules": "canShareSchedules",
        "credential_id": "credentialId",
        "credentials": "credentials",
        "data_connections": "dataConnections",
        "id": "id",
    }

    def __init__(
        self,
        name=None,
        api_key=None,
        api_secret=None,
        active=None,
        expiration_date=None,
        exp_date=None,
        date_updated=None,
        api_enabled=None,
        can_share_schedules=None,
        credential_id=None,
        credentials=None,
        data_connections=None,
        id=None,
        _configuration=None,
    ):  # noqa: E501
        """Subscription - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._name = None
        self._api_key = None
        self._api_secret = None
        self._active = None
        self._expiration_date = None
        self._exp_date = None
        self._date_updated = None
        self._api_enabled = None
        self._can_share_schedules = None
        self._credential_id = None
        self._credentials = None
        self._data_connections = None
        self._id = None
        self.discriminator = None

        if name is not None:
            self.name = name
        if api_key is not None:
            self.api_key = api_key
        if api_secret is not None:
            self.api_secret = api_secret
        if active is not None:
            self.active = active
        if expiration_date is not None:
            self.expiration_date = expiration_date
        if exp_date is not None:
            self.exp_date = exp_date
        if date_updated is not None:
            self.date_updated = date_updated
        if api_enabled is not None:
            self.api_enabled = api_enabled
        if can_share_schedules is not None:
            self.can_share_schedules = can_share_schedules
        if credential_id is not None:
            self.credential_id = credential_id
        if credentials is not None:
            self.credentials = credentials
        if data_connections is not None:
            self.data_connections = data_connections
        if id is not None:
            self.id = id

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


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

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


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

        self._name = name

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


        :return: The api_key of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._api_key

    @api_key.setter
    def api_key(self, api_key):
        """Sets the api_key of this Subscription.


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

        self._api_key = api_key

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


        :return: The api_secret of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._api_secret

    @api_secret.setter
    def api_secret(self, api_secret):
        """Sets the api_secret of this Subscription.


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

        self._api_secret = api_secret

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


        :return: The active of this Subscription.  # noqa: E501
        :rtype: bool
        """
        return self._active

    @active.setter
    def active(self, active):
        """Sets the active of this Subscription.


        :param active: The active of this Subscription.  # noqa: E501
        :type: bool
        """

        self._active = active

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


        :return: The expiration_date of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._expiration_date

    @expiration_date.setter
    def expiration_date(self, expiration_date):
        """Sets the expiration_date of this Subscription.


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

        self._expiration_date = expiration_date

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


        :return: The exp_date of this Subscription.  # noqa: E501
        :rtype: datetime
        """
        return self._exp_date

    @exp_date.setter
    def exp_date(self, exp_date):
        """Sets the exp_date of this Subscription.


        :param exp_date: The exp_date of this Subscription.  # noqa: E501
        :type: datetime
        """

        self._exp_date = exp_date

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


        :return: The date_updated of this Subscription.  # noqa: E501
        :rtype: datetime
        """
        return self._date_updated

    @date_updated.setter
    def date_updated(self, date_updated):
        """Sets the date_updated of this Subscription.


        :param date_updated: The date_updated of this Subscription.  # noqa: E501
        :type: datetime
        """

        self._date_updated = date_updated

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


        :return: The api_enabled of this Subscription.  # noqa: E501
        :rtype: bool
        """
        return self._api_enabled

    @api_enabled.setter
    def api_enabled(self, api_enabled):
        """Sets the api_enabled of this Subscription.


        :param api_enabled: The api_enabled of this Subscription.  # noqa: E501
        :type: bool
        """

        self._api_enabled = api_enabled

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


        :return: The can_share_schedules of this Subscription.  # noqa: E501
        :rtype: bool
        """
        return self._can_share_schedules

    @can_share_schedules.setter
    def can_share_schedules(self, can_share_schedules):
        """Sets the can_share_schedules of this Subscription.


        :param can_share_schedules: The can_share_schedules of this Subscription.  # noqa: E501
        :type: bool
        """

        self._can_share_schedules = can_share_schedules

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


        :return: The credential_id of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._credential_id

    @credential_id.setter
    def credential_id(self, credential_id):
        """Sets the credential_id of this Subscription.


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

        self._credential_id = credential_id

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


        :return: The credentials of this Subscription.  # noqa: E501
        :rtype: list[SubscriptionCredential]
        """
        return self._credentials

    @credentials.setter
    def credentials(self, credentials):
        """Sets the credentials of this Subscription.


        :param credentials: The credentials of this Subscription.  # noqa: E501
        :type: list[SubscriptionCredential]
        """

        self._credentials = credentials

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


        :return: The data_connections of this Subscription.  # noqa: E501
        :rtype: list[SubscriptionDataConnection]
        """
        return self._data_connections

    @data_connections.setter
    def data_connections(self, data_connections):
        """Sets the data_connections of this Subscription.


        :param data_connections: The data_connections of this Subscription.  # noqa: E501
        :type: list[SubscriptionDataConnection]
        """

        self._data_connections = data_connections

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


        :return: The id of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._id

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


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

        self._id = id

    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
        if issubclass(Subscription, dict):
            for key, value in self.items():
                result[key] = 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, Subscription):
            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, Subscription):
            return True

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