Source code for nipyapi.registry.models.current_user

# coding: utf-8

"""
    Apache NiFi Registry REST API

    The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components.

    OpenAPI spec version: 1.19.0
    Contact: dev@nifi.apache.org
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


[docs]class CurrentUser(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_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. """ swagger_types = { 'identity': 'str', 'anonymous': 'bool', 'login_supported': 'bool', 'resource_permissions': 'ResourcePermissions', 'oidclogin_supported': 'bool' } attribute_map = { 'identity': 'identity', 'anonymous': 'anonymous', 'login_supported': 'loginSupported', 'resource_permissions': 'resourcePermissions', 'oidclogin_supported': 'oidcloginSupported' } def __init__(self, identity=None, anonymous=None, login_supported=None, resource_permissions=None, oidclogin_supported=None): """ CurrentUser - a model defined in Swagger """ self._identity = None self._anonymous = None self._login_supported = None self._resource_permissions = None self._oidclogin_supported = None if identity is not None: self.identity = identity if anonymous is not None: self.anonymous = anonymous if login_supported is not None: self.login_supported = login_supported if resource_permissions is not None: self.resource_permissions = resource_permissions if oidclogin_supported is not None: self.oidclogin_supported = oidclogin_supported @property def identity(self): """ Gets the identity of this CurrentUser. The identity of the current user :return: The identity of this CurrentUser. :rtype: str """ return self._identity @identity.setter def identity(self, identity): """ Sets the identity of this CurrentUser. The identity of the current user :param identity: The identity of this CurrentUser. :type: str """ self._identity = identity @property def anonymous(self): """ Gets the anonymous of this CurrentUser. Indicates if the current user is anonymous :return: The anonymous of this CurrentUser. :rtype: bool """ return self._anonymous @anonymous.setter def anonymous(self, anonymous): """ Sets the anonymous of this CurrentUser. Indicates if the current user is anonymous :param anonymous: The anonymous of this CurrentUser. :type: bool """ self._anonymous = anonymous @property def login_supported(self): """ Gets the login_supported of this CurrentUser. Indicates if the NiFi Registry instance supports logging in :return: The login_supported of this CurrentUser. :rtype: bool """ return self._login_supported @login_supported.setter def login_supported(self, login_supported): """ Sets the login_supported of this CurrentUser. Indicates if the NiFi Registry instance supports logging in :param login_supported: The login_supported of this CurrentUser. :type: bool """ self._login_supported = login_supported @property def resource_permissions(self): """ Gets the resource_permissions of this CurrentUser. The access that the current user has to top level resources :return: The resource_permissions of this CurrentUser. :rtype: ResourcePermissions """ return self._resource_permissions @resource_permissions.setter def resource_permissions(self, resource_permissions): """ Sets the resource_permissions of this CurrentUser. The access that the current user has to top level resources :param resource_permissions: The resource_permissions of this CurrentUser. :type: ResourcePermissions """ self._resource_permissions = resource_permissions @property def oidclogin_supported(self): """ Gets the oidclogin_supported of this CurrentUser. Indicates if the NiFi Registry instance supports logging in with an OIDC provider :return: The oidclogin_supported of this CurrentUser. :rtype: bool """ return self._oidclogin_supported @oidclogin_supported.setter def oidclogin_supported(self, oidclogin_supported): """ Sets the oidclogin_supported of this CurrentUser. Indicates if the NiFi Registry instance supports logging in with an OIDC provider :param oidclogin_supported: The oidclogin_supported of this CurrentUser. :type: bool """ self._oidclogin_supported = oidclogin_supported
[docs] def to_dict(self): """ Returns the model properties as a dict """ result = {} for attr, _ in iteritems(self.swagger_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
[docs] def to_str(self): """ Returns the string representation of the model """ return 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, CurrentUser): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other