"""
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.
"""

import pprint

from inspect import getfullargspec

from openfga_sdk.configuration import Configuration


class Store:
    """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: dict[str, str] = {
        "id": "str",
        "name": "str",
        "created_at": "datetime",
        "updated_at": "datetime",
        "deleted_at": "datetime",
    }

    attribute_map: dict[str, str] = {
        "id": "id",
        "name": "name",
        "created_at": "created_at",
        "updated_at": "updated_at",
        "deleted_at": "deleted_at",
    }

    def __init__(
        self,
        id=None,
        name=None,
        created_at=None,
        updated_at=None,
        deleted_at=None,
        local_vars_configuration=None,
    ):
        """Store - 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._id = None
        self._name = None
        self._created_at = None
        self._updated_at = None
        self._deleted_at = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.created_at = created_at
        self.updated_at = updated_at
        if deleted_at is not None:
            self.deleted_at = deleted_at

    @property
    def id(self):
        """Gets the id of this Store.


        :return: The id of this Store.
        :rtype: str
        """
        return self._id

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


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

        self._id = id

    @property
    def name(self):
        """Gets the name of this Store.


        :return: The name of this Store.
        :rtype: str
        """
        return self._name

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


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

        self._name = name

    @property
    def created_at(self):
        """Gets the created_at of this Store.


        :return: The created_at of this Store.
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this Store.


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

        self._created_at = created_at

    @property
    def updated_at(self):
        """Gets the updated_at of this Store.


        :return: The updated_at of this Store.
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this Store.


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

        self._updated_at = updated_at

    @property
    def deleted_at(self):
        """Gets the deleted_at of this Store.


        :return: The deleted_at of this Store.
        :rtype: datetime
        """
        return self._deleted_at

    @deleted_at.setter
    def deleted_at(self, deleted_at):
        """Sets the deleted_at of this Store.


        :param deleted_at: The deleted_at of this Store.
        :type deleted_at: datetime
        """

        self._deleted_at = deleted_at

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

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