# coding: utf-8

"""
    Event Notification Service

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

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


import pprint
import re  # noqa: F401

import six

from libica.openapi.libens.configuration import Configuration


class Subscription(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 = {
        'id': 'str',
        'urn': 'str',
        'type': 'str',
        'actions': 'list[str]',
        'filter_expression': 'str',
        'name': 'str',
        'description': 'str',
        'delivery_target': 'DeliveryTarget',
        'match_identities': 'list[str]',
        'acl': 'list[str]',
        'tenant_id': 'str',
        'created_by_user_id': 'str',
        'time_created': 'datetime',
        'deleted_by_user_id': 'str',
        'time_deleted': 'datetime',
        'is_deleted': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'urn': 'urn',
        'type': 'type',
        'actions': 'actions',
        'filter_expression': 'filterExpression',
        'name': 'name',
        'description': 'description',
        'delivery_target': 'deliveryTarget',
        'match_identities': 'matchIdentities',
        'acl': 'acl',
        'tenant_id': 'tenantId',
        'created_by_user_id': 'createdByUserId',
        'time_created': 'timeCreated',
        'deleted_by_user_id': 'deletedByUserId',
        'time_deleted': 'timeDeleted',
        'is_deleted': 'isDeleted'
    }

    def __init__(self, id=None, urn=None, type=None, actions=None, filter_expression=None, name=None, description=None, delivery_target=None, match_identities=None, acl=None, tenant_id=None, created_by_user_id=None, time_created=None, deleted_by_user_id=None, time_deleted=None, is_deleted=None, local_vars_configuration=None):  # noqa: E501
        """Subscription - 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._id = None
        self._urn = None
        self._type = None
        self._actions = None
        self._filter_expression = None
        self._name = None
        self._description = None
        self._delivery_target = None
        self._match_identities = None
        self._acl = None
        self._tenant_id = None
        self._created_by_user_id = None
        self._time_created = None
        self._deleted_by_user_id = None
        self._time_deleted = None
        self._is_deleted = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if urn is not None:
            self.urn = urn
        if type is not None:
            self.type = type
        if actions is not None:
            self.actions = actions
        if filter_expression is not None:
            self.filter_expression = filter_expression
        if name is not None:
            self.name = name
        if description is not None:
            self.description = description
        if delivery_target is not None:
            self.delivery_target = delivery_target
        if match_identities is not None:
            self.match_identities = match_identities
        if acl is not None:
            self.acl = acl
        if tenant_id is not None:
            self.tenant_id = tenant_id
        if created_by_user_id is not None:
            self.created_by_user_id = created_by_user_id
        if time_created is not None:
            self.time_created = time_created
        if deleted_by_user_id is not None:
            self.deleted_by_user_id = deleted_by_user_id
        if time_deleted is not None:
            self.time_deleted = time_deleted
        if is_deleted is not None:
            self.is_deleted = is_deleted

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

        Unique id of the 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.

        Unique id of the subscription  # noqa: E501

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

        self._id = id

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

        URN of the subscription  # noqa: E501

        :return: The urn of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._urn

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

        URN of the subscription  # noqa: E501

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

        self._urn = urn

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

        Type of event the subscription matches  # noqa: E501

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

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

        Type of event the subscription matches  # noqa: E501

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

        self._type = type

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

        Types of actions the subscription matches for the event type  # noqa: E501

        :return: The actions of this Subscription.  # noqa: E501
        :rtype: list[str]
        """
        return self._actions

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

        Types of actions the subscription matches for the event type  # noqa: E501

        :param actions: The actions of this Subscription.  # noqa: E501
        :type: list[str]
        """

        self._actions = actions

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

        JSON-structured filter expression for events matching the subscription  # noqa: E501

        :return: The filter_expression of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._filter_expression

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

        JSON-structured filter expression for events matching the subscription  # noqa: E501

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

        self._filter_expression = filter_expression

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

        Name of the 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.

        Name of the subscription  # noqa: E501

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

        self._name = name

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

        Optional description for the subscription  # noqa: E501

        :return: The description of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._description

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

        Optional description for the subscription  # noqa: E501

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

        self._description = description

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


        :return: The delivery_target of this Subscription.  # noqa: E501
        :rtype: DeliveryTarget
        """
        return self._delivery_target

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


        :param delivery_target: The delivery_target of this Subscription.  # noqa: E501
        :type: DeliveryTarget
        """

        self._delivery_target = delivery_target

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

        ACL Identities for events the subscription matches  # noqa: E501

        :return: The match_identities of this Subscription.  # noqa: E501
        :rtype: list[str]
        """
        return self._match_identities

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

        ACL Identities for events the subscription matches  # noqa: E501

        :param match_identities: The match_identities of this Subscription.  # noqa: E501
        :type: list[str]
        """

        self._match_identities = match_identities

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

        The list of identities that have access to this subscription  # noqa: E501

        :return: The acl of this Subscription.  # noqa: E501
        :rtype: list[str]
        """
        return self._acl

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

        The list of identities that have access to this subscription  # noqa: E501

        :param acl: The acl of this Subscription.  # noqa: E501
        :type: list[str]
        """

        self._acl = acl

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

        Tenant id of the subscription owner  # noqa: E501

        :return: The tenant_id of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._tenant_id

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

        Tenant id of the subscription owner  # noqa: E501

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

        self._tenant_id = tenant_id

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

        User id for the creator of the subscription  # noqa: E501

        :return: The created_by_user_id of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._created_by_user_id

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

        User id for the creator of the subscription  # noqa: E501

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

        self._created_by_user_id = created_by_user_id

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

        Timestamp when the subscription was created  # noqa: E501

        :return: The time_created of this Subscription.  # noqa: E501
        :rtype: datetime
        """
        return self._time_created

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

        Timestamp when the subscription was created  # noqa: E501

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

        self._time_created = time_created

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

        Id of the user who deleted the subscription, if applicable  # noqa: E501

        :return: The deleted_by_user_id of this Subscription.  # noqa: E501
        :rtype: str
        """
        return self._deleted_by_user_id

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

        Id of the user who deleted the subscription, if applicable  # noqa: E501

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

        self._deleted_by_user_id = deleted_by_user_id

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

        Timestamp when the subscription was deleted, if applicable  # noqa: E501

        :return: The time_deleted of this Subscription.  # noqa: E501
        :rtype: datetime
        """
        return self._time_deleted

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

        Timestamp when the subscription was deleted, if applicable  # noqa: E501

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

        self._time_deleted = time_deleted

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

        Whether or not the subscription has been deleted  # noqa: E501

        :return: The is_deleted of this Subscription.  # noqa: E501
        :rtype: bool
        """
        return self._is_deleted

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

        Whether or not the subscription has been deleted  # noqa: E501

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

        self._is_deleted = is_deleted

    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, 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()
