Source code for swagger_server.models.role_create

# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime  # noqa: F401

from typing import List, Dict  # noqa: F401

from swagger_server.models.base_model_ import Model
from swagger_server.models.role_label import RoleLabel  # noqa: F401,E501
from swagger_server import util


[docs]class RoleCreate(Model): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self, label: RoleLabel=None, requires_2fa: bool=True, description: str=None): # noqa: E501 """RoleCreate - a model defined in Swagger :param label: The label of this RoleCreate. # noqa: E501 :type label: RoleLabel :param requires_2fa: The requires_2fa of this RoleCreate. # noqa: E501 :type requires_2fa: bool :param description: The description of this RoleCreate. # noqa: E501 :type description: str """ self.swagger_types = { 'label': RoleLabel, 'requires_2fa': bool, 'description': str } self.attribute_map = { 'label': 'label', 'requires_2fa': 'requires_2fa', 'description': 'description' } self._label = label self._requires_2fa = requires_2fa self._description = description
[docs] @classmethod def from_dict(cls, dikt) -> 'RoleCreate': """Returns the dict as a model :param dikt: A dict. :type: dict :return: The role_create of this RoleCreate. # noqa: E501 :rtype: RoleCreate """ return util.deserialize_model(dikt, cls)
@property def label(self) -> RoleLabel: """Gets the label of this RoleCreate. :return: The label of this RoleCreate. :rtype: RoleLabel """ return self._label @label.setter def label(self, label: RoleLabel): """Sets the label of this RoleCreate. :param label: The label of this RoleCreate. :type label: RoleLabel """ if label is None: raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 self._label = label @property def requires_2fa(self) -> bool: """Gets the requires_2fa of this RoleCreate. :return: The requires_2fa of this RoleCreate. :rtype: bool """ return self._requires_2fa @requires_2fa.setter def requires_2fa(self, requires_2fa: bool): """Sets the requires_2fa of this RoleCreate. :param requires_2fa: The requires_2fa of this RoleCreate. :type requires_2fa: bool """ self._requires_2fa = requires_2fa @property def description(self) -> str: """Gets the description of this RoleCreate. :return: The description of this RoleCreate. :rtype: str """ return self._description @description.setter def description(self, description: str): """Sets the description of this RoleCreate. :param description: The description of this RoleCreate. :type description: str """ self._description = description