# coding: utf-8

"""
    Agilicus API

    Agilicus API endpoints  # noqa: E501

    The version of the OpenAPI document: 2021.04.08
    Contact: dev@agilicus.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from agilicus_api.configuration import Configuration


class ApplicationAuthenticationConfig(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 = {
        'application_handles_authentication': 'bool',
        'session_secret': 'str'
    }

    attribute_map = {
        'application_handles_authentication': 'application_handles_authentication',
        'session_secret': 'session_secret'
    }

    def __init__(self, application_handles_authentication=None, session_secret=None, local_vars_configuration=None):  # noqa: E501
        """ApplicationAuthenticationConfig - 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._application_handles_authentication = None
        self._session_secret = None
        self.discriminator = None

        if application_handles_authentication is not None:
            self.application_handles_authentication = application_handles_authentication
        if session_secret is not None:
            self.session_secret = session_secret

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

        Whether the application should be forwarded requests when a user is unauthenticated so that the application can trigger authentication. If true, unauthenticated user requests will be forwarded to the application with a header indicating the user is unauthenticated. If false unauthenticated users will be denied and no traffic will reach the application.   # noqa: E501

        :return: The application_handles_authentication of this ApplicationAuthenticationConfig.  # noqa: E501
        :rtype: bool
        """
        return self._application_handles_authentication

    @application_handles_authentication.setter
    def application_handles_authentication(self, application_handles_authentication):
        """Sets the application_handles_authentication of this ApplicationAuthenticationConfig.

        Whether the application should be forwarded requests when a user is unauthenticated so that the application can trigger authentication. If true, unauthenticated user requests will be forwarded to the application with a header indicating the user is unauthenticated. If false unauthenticated users will be denied and no traffic will reach the application.   # noqa: E501

        :param application_handles_authentication: The application_handles_authentication of this ApplicationAuthenticationConfig.  # noqa: E501
        :type: bool
        """

        self._application_handles_authentication = application_handles_authentication

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

        A string which may be used to cipher session data -- e.g. a session cookie. This value will be passed to a running application in the `SESSION_SECRET` environment variable. If that variable is present in the instance's configured environment, the environment's configuration will take precedence. This value is automatically generated when an instance is created if not provided. It may be changed later. If the value is `\"\"` then the environment variable will not be provisioned. The automatically generated value is a base64-encoded series of random bytes. Aside from the base64 encoding, the value has no meaning.   # noqa: E501

        :return: The session_secret of this ApplicationAuthenticationConfig.  # noqa: E501
        :rtype: str
        """
        return self._session_secret

    @session_secret.setter
    def session_secret(self, session_secret):
        """Sets the session_secret of this ApplicationAuthenticationConfig.

        A string which may be used to cipher session data -- e.g. a session cookie. This value will be passed to a running application in the `SESSION_SECRET` environment variable. If that variable is present in the instance's configured environment, the environment's configuration will take precedence. This value is automatically generated when an instance is created if not provided. It may be changed later. If the value is `\"\"` then the environment variable will not be provisioned. The automatically generated value is a base64-encoded series of random bytes. Aside from the base64 encoding, the value has no meaning.   # noqa: E501

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

        self._session_secret = session_secret

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

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