# coding: utf-8

"""
    Selling Partner API for Tokens 

    The Selling Partner API for Tokens provides a secure way to access a customer's PII (Personally Identifiable Information). You can call the Tokens API to get a Restricted Data Token (RDT) for one or more restricted resources that you specify. The RDT authorizes subsequent calls to restricted operations that correspond to the restricted resources that you specified.  For more information, see the [Tokens API Use Case Guide](doc:tokens-api-use-case-guide).

    The version of the OpenAPI document: 2021-03-01
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import pprint
import re  # noqa: F401

import six

from spapi.configuration import Configuration


class CreateRestrictedDataTokenRequest(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 = {
        'target_application': 'str',
        'restricted_resources': 'List[RestrictedResource]',
    }

    attribute_map = {
        'target_application': 'targetApplication',
        'restricted_resources': 'restrictedResources',
    }

    def __init__(self, target_application=None, restricted_resources=None, _configuration=None):  # noqa: E501
        """CreateRestrictedDataTokenRequest - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._target_application = None
        self._restricted_resources = None
        self.discriminator = None

        if target_application is not None:
            self.target_application = target_application
        self.restricted_resources = restricted_resources

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

        The application ID for the target application to which access is being delegated.  # noqa: E501

        :return: The target_application of this CreateRestrictedDataTokenRequest.  # noqa: E501
        :rtype: str
        """
        return self._target_application

    @target_application.setter
    def target_application(self, target_application):
        """Sets the target_application of this CreateRestrictedDataTokenRequest.

        The application ID for the target application to which access is being delegated.  # noqa: E501

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

        self._target_application = target_application

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

        A list of restricted resources. Maximum: 50  # noqa: E501

        :return: The restricted_resources of this CreateRestrictedDataTokenRequest.  # noqa: E501
        :rtype: List[RestrictedResource]
        """
        return self._restricted_resources

    @restricted_resources.setter
    def restricted_resources(self, restricted_resources):
        """Sets the restricted_resources of this CreateRestrictedDataTokenRequest.

        A list of restricted resources. Maximum: 50  # noqa: E501

        :param restricted_resources: The restricted_resources of this CreateRestrictedDataTokenRequest.  # noqa: E501
        :type: List[RestrictedResource]
        """
        if self._configuration.client_side_validation and restricted_resources is None:
            raise ValueError("Invalid value for `restricted_resources`, must not be `None`")  # noqa: E501

        self._restricted_resources = restricted_resources

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

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