# coding: utf-8

"""
    用户全部 API 文档

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

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

class UpdateProfileRequest(BaseModel):
    """
    UpdateProfileRequest
    """ # noqa: E501
    avatar: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="用户头像的链接或路径，长度不能超过255个字符")
    data: Optional[StrictStr] = Field(default=None, description="用户的其他数据，可以是序列化后的对象或JSON字符串")
    nick_name: Optional[Annotated[str, Field(min_length=4, strict=True, max_length=32)]] = Field(default=None, description="用户的昵称，长度不能超过50个字符", alias="nickName")
    interest_tags: Optional[StrictStr] = Field(default=None, description="兴趣标签", alias="interestTags")
    biography: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="个人简介，长度不能超过500个字符")
    gender: Optional[Annotated[str, Field(strict=True, max_length=15)]] = Field(default=None, description="性别，长度不能超过15个字符")
    birthday: Optional[datetime] = Field(default=None, description="生日")
    occupation: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="职业，长度不能超过50个字符")
    education: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="学历，长度不能超过50个字符")
    contact: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="联系方式，长度不能超过255个字符")
    languages: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="语言，长度不能超过50个字符")
    social_links: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="社交网络链接，长度不能超过255个字符", alias="socialLinks")
    relationship_status: Optional[Annotated[str, Field(strict=True, max_length=20)]] = Field(default=None, description="婚姻状态，长度不能超过20个字符", alias="relationshipStatus")
    company: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="公司，长度不能超过100个字符")
    industry: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="行业，长度不能超过50个字符")
    company_position: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field(default=None, description="行业职位，长度不能超过50个字符", alias="companyPosition")
    private_settings: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="私密设置，长度不能超过500个字符", alias="privateSettings")
    enable2_fa_auth: Optional[StrictBool] = Field(default=None, description="是否启用二步验证", alias="enable2FAAuth")
    enable_user_name_sign_in: Optional[StrictBool] = Field(default=None, description="是否启用账号登录", alias="enableUserNameSignIn")
    enable_email_sign_in: Optional[StrictBool] = Field(default=None, description="是否启用邮箱登录", alias="enableEmailSignIn")
    enable_phone_sign_in: Optional[StrictBool] = Field(default=None, description="是否启用手机登录", alias="enablePhoneSignIn")
    enable_union_id_sign_in: Optional[StrictBool] = Field(default=None, description="是否启用UnionID登录", alias="enableUnionIDSignIn")
    enable_o_auth: Optional[StrictBool] = Field(default=None, description="是否启用OAuth2登录", alias="enableOAuth")
    __properties: ClassVar[List[str]] = ["avatar", "data", "nickName", "interestTags", "biography", "gender", "birthday", "occupation", "education", "contact", "languages", "socialLinks", "relationshipStatus", "company", "industry", "companyPosition", "privateSettings", "enable2FAAuth", "enableUserNameSignIn", "enableEmailSignIn", "enablePhoneSignIn", "enableUnionIDSignIn", "enableOAuth"]

    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 UpdateProfileRequest 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 avatar (nullable) is None
        # and model_fields_set contains the field
        if self.avatar is None and "avatar" in self.model_fields_set:
            _dict['avatar'] = None

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return _dict

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

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

        _obj = cls.model_validate({
            "avatar": obj.get("avatar"),
            "data": obj.get("data"),
            "nickName": obj.get("nickName"),
            "interestTags": obj.get("interestTags"),
            "biography": obj.get("biography"),
            "gender": obj.get("gender"),
            "birthday": obj.get("birthday"),
            "occupation": obj.get("occupation"),
            "education": obj.get("education"),
            "contact": obj.get("contact"),
            "languages": obj.get("languages"),
            "socialLinks": obj.get("socialLinks"),
            "relationshipStatus": obj.get("relationshipStatus"),
            "company": obj.get("company"),
            "industry": obj.get("industry"),
            "companyPosition": obj.get("companyPosition"),
            "privateSettings": obj.get("privateSettings"),
            "enable2FAAuth": obj.get("enable2FAAuth"),
            "enableUserNameSignIn": obj.get("enableUserNameSignIn"),
            "enableEmailSignIn": obj.get("enableEmailSignIn"),
            "enablePhoneSignIn": obj.get("enablePhoneSignIn"),
            "enableUnionIDSignIn": obj.get("enableUnionIDSignIn"),
            "enableOAuth": obj.get("enableOAuth")
        })
        return _obj


