# coding: utf-8

"""
    LINE WORKS Talk API

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

    The version of the OpenAPI document: 1.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, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class Member(BaseModel):
    """
    Member
    """ # noqa: E501
    user_no: StrictInt = Field(alias="userNo")
    name: StrictStr
    i18n_name: Optional[StrictStr] = Field(alias="i18nName")
    i18n_names: Optional[List[Any]] = Field(alias="i18nNames")
    nick_name: Optional[StrictStr] = Field(alias="nickName")
    position: Optional[StrictStr]
    i18n_positions: Optional[List[Any]] = Field(alias="i18nPositions")
    group_name: Optional[StrictStr] = Field(alias="groupName")
    i18n_group_names: Optional[List[Any]] = Field(alias="i18nGroupNames")
    group_position: Optional[StrictStr] = Field(alias="groupPosition")
    i18n_group_positions: Optional[List[Any]] = Field(alias="i18nGroupPositions")
    photo_hash: Optional[StrictStr] = Field(alias="photoHash")
    join: StrictBool
    join_time: StrictInt = Field(alias="joinTime")
    update_time: StrictInt = Field(alias="updateTime")
    domain_id: Optional[StrictInt] = Field(alias="domainId")
    property_flag: StrictInt = Field(alias="propertyFlag")
    domain_name: Optional[StrictStr] = Field(alias="domainName")
    i18n_domain_names: Optional[List[Any]] = Field(alias="i18nDomainNames")
    service_type: StrictStr = Field(alias="serviceType")
    relation_status: StrictStr = Field(alias="relationStatus")
    tenant_id: StrictInt = Field(alias="tenantId")
    guest: StrictBool
    __properties: ClassVar[List[str]] = ["userNo", "name", "i18nName", "i18nNames", "nickName", "position", "i18nPositions", "groupName", "i18nGroupNames", "groupPosition", "i18nGroupPositions", "photoHash", "join", "joinTime", "updateTime", "domainId", "propertyFlag", "domainName", "i18nDomainNames", "serviceType", "relationStatus", "tenantId", "guest"]

    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 Member 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,
        )
        # set to None if i18n_name (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_name is None and "i18n_name" in self.model_fields_set:
            _dict['i18nName'] = None

        # set to None if i18n_names (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_names is None and "i18n_names" in self.model_fields_set:
            _dict['i18nNames'] = None

        # set to None if nick_name (nullable) is None
        # and model_fields_set contains the field
        if self.nick_name is None and "nick_name" in self.model_fields_set:
            _dict['nickName'] = None

        # set to None if position (nullable) is None
        # and model_fields_set contains the field
        if self.position is None and "position" in self.model_fields_set:
            _dict['position'] = None

        # set to None if i18n_positions (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_positions is None and "i18n_positions" in self.model_fields_set:
            _dict['i18nPositions'] = None

        # set to None if group_name (nullable) is None
        # and model_fields_set contains the field
        if self.group_name is None and "group_name" in self.model_fields_set:
            _dict['groupName'] = None

        # set to None if i18n_group_names (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_group_names is None and "i18n_group_names" in self.model_fields_set:
            _dict['i18nGroupNames'] = None

        # set to None if group_position (nullable) is None
        # and model_fields_set contains the field
        if self.group_position is None and "group_position" in self.model_fields_set:
            _dict['groupPosition'] = None

        # set to None if i18n_group_positions (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_group_positions is None and "i18n_group_positions" in self.model_fields_set:
            _dict['i18nGroupPositions'] = None

        # set to None if photo_hash (nullable) is None
        # and model_fields_set contains the field
        if self.photo_hash is None and "photo_hash" in self.model_fields_set:
            _dict['photoHash'] = None

        # set to None if domain_id (nullable) is None
        # and model_fields_set contains the field
        if self.domain_id is None and "domain_id" in self.model_fields_set:
            _dict['domainId'] = None

        # set to None if domain_name (nullable) is None
        # and model_fields_set contains the field
        if self.domain_name is None and "domain_name" in self.model_fields_set:
            _dict['domainName'] = None

        # set to None if i18n_domain_names (nullable) is None
        # and model_fields_set contains the field
        if self.i18n_domain_names is None and "i18n_domain_names" in self.model_fields_set:
            _dict['i18nDomainNames'] = None

        return _dict

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

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

        _obj = cls.model_validate({
            "userNo": obj.get("userNo"),
            "name": obj.get("name"),
            "i18nName": obj.get("i18nName"),
            "i18nNames": obj.get("i18nNames"),
            "nickName": obj.get("nickName"),
            "position": obj.get("position"),
            "i18nPositions": obj.get("i18nPositions"),
            "groupName": obj.get("groupName"),
            "i18nGroupNames": obj.get("i18nGroupNames"),
            "groupPosition": obj.get("groupPosition"),
            "i18nGroupPositions": obj.get("i18nGroupPositions"),
            "photoHash": obj.get("photoHash"),
            "join": obj.get("join"),
            "joinTime": obj.get("joinTime"),
            "updateTime": obj.get("updateTime"),
            "domainId": obj.get("domainId"),
            "propertyFlag": obj.get("propertyFlag"),
            "domainName": obj.get("domainName"),
            "i18nDomainNames": obj.get("i18nDomainNames"),
            "serviceType": obj.get("serviceType"),
            "relationStatus": obj.get("relationStatus"),
            "tenantId": obj.get("tenantId"),
            "guest": obj.get("guest")
        })
        return _obj


