# coding: utf-8

"""
    Lookup/Ibis web service API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 1.2
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import pprint
import re  # noqa: F401
import json


from typing import Optional
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr

class AttributeScheme(BaseModel):
    """
    Class representing an attribute scheme. This may apply to attributes of people or institutions.
    """
    schemeid: Optional[StrictStr] = Field(None, description="The unique identifier of the attribute scheme.")
    precedence: Optional[StrictInt] = Field(None, description="The attribute scheme's precedence. Methods that return or display attributes sort the results primarily in order of increasing values of attribute scheme precedence.")
    ldap_name: Optional[StrictStr] = Field(None, alias="ldapName", description="The name of the attribute scheme in LDAP, if it is exported to LDAP. Note that many attributes are not exported to LDAP, in which case this name is typically just equal to the scheme's ID.")
    display_name: Optional[StrictStr] = Field(None, alias="displayName", description="The display name for labelling attributes in this scheme.")
    data_type: Optional[StrictStr] = Field(None, alias="dataType", description="The attribute scheme's datatype.")
    multi_valued: Optional[StrictBool] = Field(None, alias="multiValued", description="Flag indicating whether attributes in this scheme can be multi-valued.")
    multi_lined: Optional[StrictBool] = Field(None, alias="multiLined", description="Flag for textual attributes schemes indicating whether they are multi-lined.")
    searchable: Optional[StrictBool] = Field(None, description="Flag indicating whether attributes of this scheme are searched by the default search functionality.")
    regexp: Optional[StrictStr] = Field(None, description="For textual attributes, an optional regular expression that all attributes in this scheme match.")
    __properties = ["schemeid", "precedence", "ldapName", "displayName", "dataType", "multiValued", "multiLined", "searchable", "regexp"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> AttributeScheme:
        """Create an instance of AttributeScheme from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> AttributeScheme:
        """Create an instance of AttributeScheme from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return AttributeScheme.parse_obj(obj)

        _obj = AttributeScheme.parse_obj({
            "schemeid": obj.get("schemeid"),
            "precedence": obj.get("precedence"),
            "ldap_name": obj.get("ldapName"),
            "display_name": obj.get("displayName"),
            "data_type": obj.get("dataType"),
            "multi_valued": obj.get("multiValued"),
            "multi_lined": obj.get("multiLined"),
            "searchable": obj.get("searchable"),
            "regexp": obj.get("regexp")
        })
        return _obj


