# coding: utf-8

"""
    Teambition Open API

    Teambition Open API

    The version of the OpenAPI document: 1.0.0
    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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class SearchOrgMembersResponseResultInner(BaseModel):
    """
    SearchOrgMembersResponseResultInner
    """ # noqa: E501
    member_id: Optional[StrictStr] = Field(default=None, description="企业成员 ID", alias="memberId")
    user_id: Optional[StrictStr] = Field(default=None, description="用户 ID", alias="userId")
    is_disabled: Optional[StrictInt] = Field(default=None, description="成员账号是否被停用：0 启用，1 停用", alias="isDisabled")
    role: Optional[StrictInt] = Field(default=None, description="成员角色，取值为：-1: 外部成员, 0: 成员, 1: 管理员, 2: 拥有者")
    joined_team_ids: Optional[List[StrictStr]] = Field(default=None, description="企业成员加入的部门 Id 列表", alias="joinedTeamIds")
    joined_team_paths: Optional[List[StrictStr]] = Field(default=None, description="企业成员加入的部门到根部门路径信息, 使用空格拼接成字符串", alias="joinedTeamPaths")
    avatar_url: Optional[StrictStr] = Field(default=None, description="用户头像", alias="avatarUrl")
    birthday: Optional[StrictStr] = Field(default=None, description="出生日期")
    city: Optional[StrictStr] = Field(default=None, description="工作地点（城市）")
    province: Optional[StrictStr] = Field(default=None, description="工作地点（省份）")
    country: Optional[StrictStr] = Field(default=None, description="工作地点（国家）")
    email: Optional[StrictStr] = Field(default=None, description="电子邮箱")
    entry_time: Optional[StrictStr] = Field(default=None, description="入职时间", alias="entryTime")
    name: Optional[StrictStr] = Field(default=None, description="成员名称")
    phone: Optional[StrictStr] = Field(default=None, description="联系电话")
    title: Optional[StrictStr] = Field(default=None, description="职位")
    pinyin: Optional[StrictStr] = Field(default=None, description="成员名称的拼音")
    py: Optional[StrictStr] = Field(default=None, description="成员名称的拼音简写")
    staff_type: Optional[StrictStr] = Field(default=None, description="员工类型", alias="staffType")
    employee_number: Optional[StrictStr] = Field(default=None, description="员工工号", alias="employeeNumber")
    __properties: ClassVar[List[str]] = ["memberId", "userId", "isDisabled", "role", "joinedTeamIds", "joinedTeamPaths", "avatarUrl", "birthday", "city", "province", "country", "email", "entryTime", "name", "phone", "title", "pinyin", "py", "staffType", "employeeNumber"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

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

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of SearchOrgMembersResponseResultInner from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "memberId": obj.get("memberId"),
            "userId": obj.get("userId"),
            "isDisabled": obj.get("isDisabled"),
            "role": obj.get("role"),
            "joinedTeamIds": obj.get("joinedTeamIds"),
            "joinedTeamPaths": obj.get("joinedTeamPaths"),
            "avatarUrl": obj.get("avatarUrl"),
            "birthday": obj.get("birthday"),
            "city": obj.get("city"),
            "province": obj.get("province"),
            "country": obj.get("country"),
            "email": obj.get("email"),
            "entryTime": obj.get("entryTime"),
            "name": obj.get("name"),
            "phone": obj.get("phone"),
            "title": obj.get("title"),
            "pinyin": obj.get("pinyin"),
            "py": obj.get("py"),
            "staffType": obj.get("staffType"),
            "employeeNumber": obj.get("employeeNumber")
        })
        return _obj


