# coding: utf-8

"""
    Agilicus API

    Agilicus API endpoints  # noqa: E501

    The version of the OpenAPI document: 2021.04.15
    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 UpstreamGroupMappingEntry(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 = {
        'priority': 'int',
        'upstream_group_name': 'str',
        'upstream_name_is_a_guid': 'bool',
        'agilicus_group_name': 'str',
        'group_org_id': 'str'
    }

    attribute_map = {
        'priority': 'priority',
        'upstream_group_name': 'upstream_group_name',
        'upstream_name_is_a_guid': 'upstream_name_is_a_guid',
        'agilicus_group_name': 'agilicus_group_name',
        'group_org_id': 'group_org_id'
    }

    def __init__(self, priority=None, upstream_group_name=None, upstream_name_is_a_guid=None, agilicus_group_name=None, group_org_id=None, local_vars_configuration=None):  # noqa: E501
        """UpstreamGroupMappingEntry - 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._priority = None
        self._upstream_group_name = None
        self._upstream_name_is_a_guid = None
        self._agilicus_group_name = None
        self._group_org_id = None
        self.discriminator = None

        self.priority = priority
        self.upstream_group_name = upstream_group_name
        if upstream_name_is_a_guid is not None:
            self.upstream_name_is_a_guid = upstream_name_is_a_guid
        self.agilicus_group_name = agilicus_group_name
        if group_org_id is not None:
            self.group_org_id = group_org_id

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

        The priority of the mapping entry. A lower number indicates a higher priority.  # noqa: E501

        :return: The priority of this UpstreamGroupMappingEntry.  # noqa: E501
        :rtype: int
        """
        return self._priority

    @priority.setter
    def priority(self, priority):
        """Sets the priority of this UpstreamGroupMappingEntry.

        The priority of the mapping entry. A lower number indicates a higher priority.  # noqa: E501

        :param priority: The priority of this UpstreamGroupMappingEntry.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and priority is None:  # noqa: E501
            raise ValueError("Invalid value for `priority`, must not be `None`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                priority is not None and priority < 1):  # noqa: E501
            raise ValueError("Invalid value for `priority`, must be a value greater than or equal to `1`")  # noqa: E501

        self._priority = priority

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

        The name of the group in your upstream identity provider that you want to map. This can be in the form of a regular expression capture group. The example value will capture all groups starting with 'Company Team' and will use the value in the agilicus_group_name. For example Company Team HR Group will be mapped to Agilicus HR Group when the agilicus_group_name is specified with a matching capture group   # noqa: E501

        :return: The upstream_group_name of this UpstreamGroupMappingEntry.  # noqa: E501
        :rtype: str
        """
        return self._upstream_group_name

    @upstream_group_name.setter
    def upstream_group_name(self, upstream_group_name):
        """Sets the upstream_group_name of this UpstreamGroupMappingEntry.

        The name of the group in your upstream identity provider that you want to map. This can be in the form of a regular expression capture group. The example value will capture all groups starting with 'Company Team' and will use the value in the agilicus_group_name. For example Company Team HR Group will be mapped to Agilicus HR Group when the agilicus_group_name is specified with a matching capture group   # noqa: E501

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

        self._upstream_group_name = upstream_group_name

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

        Indicates that the supplied upstream_group_name will be found in the list of group IDs  # noqa: E501

        :return: The upstream_name_is_a_guid of this UpstreamGroupMappingEntry.  # noqa: E501
        :rtype: bool
        """
        return self._upstream_name_is_a_guid

    @upstream_name_is_a_guid.setter
    def upstream_name_is_a_guid(self, upstream_name_is_a_guid):
        """Sets the upstream_name_is_a_guid of this UpstreamGroupMappingEntry.

        Indicates that the supplied upstream_group_name will be found in the list of group IDs  # noqa: E501

        :param upstream_name_is_a_guid: The upstream_name_is_a_guid of this UpstreamGroupMappingEntry.  # noqa: E501
        :type: bool
        """

        self._upstream_name_is_a_guid = upstream_name_is_a_guid

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

        The name of the group in the Agilicus system that you want to map to. If the upstream_group_name is a capture group this field can contain those captured values. The match groups are specified by a { followed by the match number followed by a closing } ie {0}   # noqa: E501

        :return: The agilicus_group_name of this UpstreamGroupMappingEntry.  # noqa: E501
        :rtype: str
        """
        return self._agilicus_group_name

    @agilicus_group_name.setter
    def agilicus_group_name(self, agilicus_group_name):
        """Sets the agilicus_group_name of this UpstreamGroupMappingEntry.

        The name of the group in the Agilicus system that you want to map to. If the upstream_group_name is a capture group this field can contain those captured values. The match groups are specified by a { followed by the match number followed by a closing } ie {0}   # noqa: E501

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

        self._agilicus_group_name = agilicus_group_name

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

        The org id that this group mapping applies to. Only mappings whose org id matches the org id that the user logged into will be mapped. If no scope is specified the org id of the issuer is assumed.  # noqa: E501

        :return: The group_org_id of this UpstreamGroupMappingEntry.  # noqa: E501
        :rtype: str
        """
        return self._group_org_id

    @group_org_id.setter
    def group_org_id(self, group_org_id):
        """Sets the group_org_id of this UpstreamGroupMappingEntry.

        The org id that this group mapping applies to. Only mappings whose org id matches the org id that the user logged into will be mapped. If no scope is specified the org id of the issuer is assumed.  # noqa: E501

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

        self._group_org_id = group_org_id

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

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