"""
   Python SDK for OpenFGA

   API version: 1.x
   Website: https://openfga.dev
   Documentation: https://openfga.dev/docs
   Support: https://openfga.dev/community
   License: [Apache-2.0](https://github.com/openfga/python-sdk/blob/main/LICENSE)

   NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT.
"""

try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint

from openfga_sdk.configuration import Configuration


class ListObjectsRequest:
    """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 = {
        "authorization_model_id": "str",
        "type": "str",
        "relation": "str",
        "user": "str",
        "contextual_tuples": "ContextualTupleKeys",
        "context": "object",
        "consistency": "ConsistencyPreference",
    }

    attribute_map = {
        "authorization_model_id": "authorization_model_id",
        "type": "type",
        "relation": "relation",
        "user": "user",
        "contextual_tuples": "contextual_tuples",
        "context": "context",
        "consistency": "consistency",
    }

    def __init__(
        self,
        authorization_model_id=None,
        type=None,
        relation=None,
        user=None,
        contextual_tuples=None,
        context=None,
        consistency=None,
        local_vars_configuration=None,
    ):
        """ListObjectsRequest - a model defined in OpenAPI"""
        if local_vars_configuration is None:
            local_vars_configuration = Configuration.get_default_copy()
        self.local_vars_configuration = local_vars_configuration

        self._authorization_model_id = None
        self._type = None
        self._relation = None
        self._user = None
        self._contextual_tuples = None
        self._context = None
        self._consistency = None
        self.discriminator = None

        if authorization_model_id is not None:
            self.authorization_model_id = authorization_model_id
        self.type = type
        self.relation = relation
        self.user = user
        if contextual_tuples is not None:
            self.contextual_tuples = contextual_tuples
        if context is not None:
            self.context = context
        if consistency is not None:
            self.consistency = consistency

    @property
    def authorization_model_id(self):
        """Gets the authorization_model_id of this ListObjectsRequest.


        :return: The authorization_model_id of this ListObjectsRequest.
        :rtype: str
        """
        return self._authorization_model_id

    @authorization_model_id.setter
    def authorization_model_id(self, authorization_model_id):
        """Sets the authorization_model_id of this ListObjectsRequest.


        :param authorization_model_id: The authorization_model_id of this ListObjectsRequest.
        :type authorization_model_id: str
        """

        self._authorization_model_id = authorization_model_id

    @property
    def type(self):
        """Gets the type of this ListObjectsRequest.


        :return: The type of this ListObjectsRequest.
        :rtype: str
        """
        return self._type

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


        :param type: The type of this ListObjectsRequest.
        :type type: str
        """
        if self.local_vars_configuration.client_side_validation and type is None:
            raise ValueError("Invalid value for `type`, must not be `None`")

        self._type = type

    @property
    def relation(self):
        """Gets the relation of this ListObjectsRequest.


        :return: The relation of this ListObjectsRequest.
        :rtype: str
        """
        return self._relation

    @relation.setter
    def relation(self, relation):
        """Sets the relation of this ListObjectsRequest.


        :param relation: The relation of this ListObjectsRequest.
        :type relation: str
        """
        if self.local_vars_configuration.client_side_validation and relation is None:
            raise ValueError("Invalid value for `relation`, must not be `None`")

        self._relation = relation

    @property
    def user(self):
        """Gets the user of this ListObjectsRequest.


        :return: The user of this ListObjectsRequest.
        :rtype: str
        """
        return self._user

    @user.setter
    def user(self, user):
        """Sets the user of this ListObjectsRequest.


        :param user: The user of this ListObjectsRequest.
        :type user: str
        """
        if self.local_vars_configuration.client_side_validation and user is None:
            raise ValueError("Invalid value for `user`, must not be `None`")
        if (
            self.local_vars_configuration.client_side_validation
            and user is not None
            and len(user) > 512
        ):
            raise ValueError(
                "Invalid value for `user`, length must be less than or equal to `512`"
            )
        if (
            self.local_vars_configuration.client_side_validation
            and user is not None
            and len(user) < 1
        ):
            raise ValueError(
                "Invalid value for `user`, length must be greater than or equal to `1`"
            )

        self._user = user

    @property
    def contextual_tuples(self):
        """Gets the contextual_tuples of this ListObjectsRequest.


        :return: The contextual_tuples of this ListObjectsRequest.
        :rtype: ContextualTupleKeys
        """
        return self._contextual_tuples

    @contextual_tuples.setter
    def contextual_tuples(self, contextual_tuples):
        """Sets the contextual_tuples of this ListObjectsRequest.


        :param contextual_tuples: The contextual_tuples of this ListObjectsRequest.
        :type contextual_tuples: ContextualTupleKeys
        """

        self._contextual_tuples = contextual_tuples

    @property
    def context(self):
        """Gets the context of this ListObjectsRequest.

        Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation.

        :return: The context of this ListObjectsRequest.
        :rtype: object
        """
        return self._context

    @context.setter
    def context(self, context):
        """Sets the context of this ListObjectsRequest.

        Additional request context that will be used to evaluate any ABAC conditions encountered in the query evaluation.

        :param context: The context of this ListObjectsRequest.
        :type context: object
        """

        self._context = context

    @property
    def consistency(self):
        """Gets the consistency of this ListObjectsRequest.


        :return: The consistency of this ListObjectsRequest.
        :rtype: ConsistencyPreference
        """
        return self._consistency

    @consistency.setter
    def consistency(self, consistency):
        """Sets the consistency of this ListObjectsRequest.


        :param consistency: The consistency of this ListObjectsRequest.
        :type consistency: ConsistencyPreference
        """

        self._consistency = consistency

    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 self.openapi_types.items():
            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, ListObjectsRequest):
            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, ListObjectsRequest):
            return True

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