# coding: utf-8

"""
    PeerTube

    # Introduction  The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO) which generates a client SDK in the language of your choice - we generate some client SDKs automatically:  - [Python](https://framagit.org/framasoft/peertube/clients/python) - [Go](https://framagit.org/framasoft/peertube/clients/go) - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)  See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.  # Authentication  When you sign up for an account, you are given the possibility to generate sessions, and authenticate using this session token. One session token can currently be used at a time.  ## Roles  Accounts are given permissions based on their role. There are three roles on PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/#/admin-managing-users?id=roles) for a detail of their permissions.  # Errors  The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format.  ``` {   \"code\": \"unauthorized_request\", // example inner error code   \"error\": \"Token is invalid.\" // example exposed error message } ```   # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from peertube.configuration import Configuration


class UpdateMe(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 = {
        'password': 'str',
        'email': 'str',
        'display_nsfw': 'str',
        'auto_play_video': 'bool'
    }

    attribute_map = {
        'password': 'password',
        'email': 'email',
        'display_nsfw': 'displayNSFW',
        'auto_play_video': 'autoPlayVideo'
    }

    def __init__(self, password=None, email=None, display_nsfw=None, auto_play_video=None, local_vars_configuration=None):  # noqa: E501
        """UpdateMe - 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._password = None
        self._email = None
        self._display_nsfw = None
        self._auto_play_video = None
        self.discriminator = None

        self.password = password
        self.email = email
        self.display_nsfw = display_nsfw
        self.auto_play_video = auto_play_video

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

        Your new password  # noqa: E501

        :return: The password of this UpdateMe.  # noqa: E501
        :rtype: str
        """
        return self._password

    @password.setter
    def password(self, password):
        """Sets the password of this UpdateMe.

        Your new password  # noqa: E501

        :param password: The password of this UpdateMe.  # noqa: E501
        :type password: str
        """
        if self.local_vars_configuration.client_side_validation and password is None:  # noqa: E501
            raise ValueError("Invalid value for `password`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                password is not None and len(password) > 255):
            raise ValueError("Invalid value for `password`, length must be less than or equal to `255`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                password is not None and len(password) < 6):
            raise ValueError("Invalid value for `password`, length must be greater than or equal to `6`")  # noqa: E501

        self._password = password

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

        Your new email  # noqa: E501

        :return: The email of this UpdateMe.  # noqa: E501
        :rtype: str
        """
        return self._email

    @email.setter
    def email(self, email):
        """Sets the email of this UpdateMe.

        Your new email  # noqa: E501

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

        self._email = email

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

        Your new displayNSFW  # noqa: E501

        :return: The display_nsfw of this UpdateMe.  # noqa: E501
        :rtype: str
        """
        return self._display_nsfw

    @display_nsfw.setter
    def display_nsfw(self, display_nsfw):
        """Sets the display_nsfw of this UpdateMe.

        Your new displayNSFW  # noqa: E501

        :param display_nsfw: The display_nsfw of this UpdateMe.  # noqa: E501
        :type display_nsfw: str
        """
        if self.local_vars_configuration.client_side_validation and display_nsfw is None:  # noqa: E501
            raise ValueError("Invalid value for `display_nsfw`, must not be `None`")  # noqa: E501
        allowed_values = ["true", "false", "both"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and display_nsfw not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `display_nsfw` ({0}), must be one of {1}"  # noqa: E501
                .format(display_nsfw, allowed_values)
            )

        self._display_nsfw = display_nsfw

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

        Your new autoPlayVideo  # noqa: E501

        :return: The auto_play_video of this UpdateMe.  # noqa: E501
        :rtype: bool
        """
        return self._auto_play_video

    @auto_play_video.setter
    def auto_play_video(self, auto_play_video):
        """Sets the auto_play_video of this UpdateMe.

        Your new autoPlayVideo  # noqa: E501

        :param auto_play_video: The auto_play_video of this UpdateMe.  # noqa: E501
        :type auto_play_video: bool
        """
        if self.local_vars_configuration.client_side_validation and auto_play_video is None:  # noqa: E501
            raise ValueError("Invalid value for `auto_play_video`, must not be `None`")  # noqa: E501

        self._auto_play_video = auto_play_video

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

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