# coding: utf-8

"""
    Salt Edge Account Information API

    API Reference for services  # noqa: E501

    OpenAPI spec version: 5.0.0
    Contact: support@saltedge.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

class Consent(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 = {
        'id': 'str',
        'connection_id': 'str',
        'customer_id': 'str',
        'scopes': 'list[str]',
        'period_days': 'int',
        'expires_at': 'datetime',
        'from_date': 'date',
        'to_date': 'date',
        'collected_by': 'str',
        'revoked_at': 'datetime',
        'revoke_reason': 'str',
        'created_at': 'datetime',
        'updated_at': 'datetime'
    }

    attribute_map = {
        'id': 'id',
        'connection_id': 'connection_id',
        'customer_id': 'customer_id',
        'scopes': 'scopes',
        'period_days': 'period_days',
        'expires_at': 'expires_at',
        'from_date': 'from_date',
        'to_date': 'to_date',
        'collected_by': 'collected_by',
        'revoked_at': 'revoked_at',
        'revoke_reason': 'revoke_reason',
        'created_at': 'created_at',
        'updated_at': 'updated_at'
    }

    def __init__(self, id=None, connection_id=None, customer_id=None, scopes=None, period_days=None, expires_at=None, from_date=None, to_date=None, collected_by=None, revoked_at=None, revoke_reason=None, created_at=None, updated_at=None):  # noqa: E501
        """Consent - a model defined in Swagger"""  # noqa: E501
        self._id = None
        self._connection_id = None
        self._customer_id = None
        self._scopes = None
        self._period_days = None
        self._expires_at = None
        self._from_date = None
        self._to_date = None
        self._collected_by = None
        self._revoked_at = None
        self._revoke_reason = None
        self._created_at = None
        self._updated_at = None
        self.discriminator = None
        self.id = id
        self.connection_id = connection_id
        self.customer_id = customer_id
        self.scopes = scopes
        self.period_days = period_days
        self.expires_at = expires_at
        self.from_date = from_date
        self.to_date = to_date
        self.collected_by = collected_by
        self.revoked_at = revoked_at
        self.revoke_reason = revoke_reason
        self.created_at = created_at
        self.updated_at = updated_at

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

        the `id` of the consent  # noqa: E501

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

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

        the `id` of the consent  # noqa: E501

        :param id: The id of this Consent.  # noqa: E501
        :type: str
        """
        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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

        the `id` of the [connection](#connections)  # noqa: E501

        :return: The connection_id of this Consent.  # noqa: E501
        :rtype: str
        """
        return self._connection_id

    @connection_id.setter
    def connection_id(self, connection_id):
        """Sets the connection_id of this Consent.

        the `id` of the [connection](#connections)  # noqa: E501

        :param connection_id: The connection_id of this Consent.  # noqa: E501
        :type: str
        """
        if connection_id is None:
            raise ValueError("Invalid value for `connection_id`, must not be `None`")  # noqa: E501

        self._connection_id = connection_id

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

        the `id` of the [customer](#customers)  # noqa: E501

        :return: The customer_id of this Consent.  # noqa: E501
        :rtype: str
        """
        return self._customer_id

    @customer_id.setter
    def customer_id(self, customer_id):
        """Sets the customer_id of this Consent.

        the `id` of the [customer](#customers)  # noqa: E501

        :param customer_id: The customer_id of this Consent.  # noqa: E501
        :type: str
        """
        if customer_id is None:
            raise ValueError("Invalid value for `customer_id`, must not be `None`")  # noqa: E501

        self._customer_id = customer_id

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

        data that is allowed to be fetched.  # noqa: E501

        :return: The scopes of this Consent.  # noqa: E501
        :rtype: list[str]
        """
        return self._scopes

    @scopes.setter
    def scopes(self, scopes):
        """Sets the scopes of this Consent.

        data that is allowed to be fetched.  # noqa: E501

        :param scopes: The scopes of this Consent.  # noqa: E501
        :type: list[str]
        """
        if scopes is None:
            raise ValueError("Invalid value for `scopes`, must not be `None`")  # noqa: E501
        allowed_values = ["account_details", "holder_information", "transactions_details"]  # noqa: E501
        if not set(scopes).issubset(set(allowed_values)):
            raise ValueError(
                "Invalid values for `scopes` [{0}], must be a subset of [{1}]"  # noqa: E501
                .format(", ".join(map(str, set(scopes) - set(allowed_values))),  # noqa: E501
                        ", ".join(map(str, allowed_values)))
            )

        self._scopes = scopes

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

        the period the consent will be valid for  # noqa: E501

        :return: The period_days of this Consent.  # noqa: E501
        :rtype: int
        """
        return self._period_days

    @period_days.setter
    def period_days(self, period_days):
        """Sets the period_days of this Consent.

        the period the consent will be valid for  # noqa: E501

        :param period_days: The period_days of this Consent.  # noqa: E501
        :type: int
        """
        if period_days is None:
            raise ValueError("Invalid value for `period_days`, must not be `None`")  # noqa: E501

        self._period_days = period_days

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

        the date when the consent will expire  # noqa: E501

        :return: The expires_at of this Consent.  # noqa: E501
        :rtype: datetime
        """
        return self._expires_at

    @expires_at.setter
    def expires_at(self, expires_at):
        """Sets the expires_at of this Consent.

        the date when the consent will expire  # noqa: E501

        :param expires_at: The expires_at of this Consent.  # noqa: E501
        :type: datetime
        """
        if expires_at is None:
            raise ValueError("Invalid value for `expires_at`, must not be `None`")  # noqa: E501

        self._expires_at = expires_at

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

        the date from which the data has been allowed to be fetched  # noqa: E501

        :return: The from_date of this Consent.  # noqa: E501
        :rtype: date
        """
        return self._from_date

    @from_date.setter
    def from_date(self, from_date):
        """Sets the from_date of this Consent.

        the date from which the data has been allowed to be fetched  # noqa: E501

        :param from_date: The from_date of this Consent.  # noqa: E501
        :type: date
        """
        if from_date is None:
            raise ValueError("Invalid value for `from_date`, must not be `None`")  # noqa: E501

        self._from_date = from_date

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

        the date until which the data has been allowed to be fetched  # noqa: E501

        :return: The to_date of this Consent.  # noqa: E501
        :rtype: date
        """
        return self._to_date

    @to_date.setter
    def to_date(self, to_date):
        """Sets the to_date of this Consent.

        the date until which the data has been allowed to be fetched  # noqa: E501

        :param to_date: The to_date of this Consent.  # noqa: E501
        :type: date
        """
        if to_date is None:
            raise ValueError("Invalid value for `to_date`, must not be `None`")  # noqa: E501

        self._to_date = to_date

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

        entity who collected the consent.  # noqa: E501

        :return: The collected_by of this Consent.  # noqa: E501
        :rtype: str