# coding: utf-8

"""
    XingChen 开放接口定义

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

    The version of the OpenAPI document: v2
    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, Field, StrictInt

class CharacterPermissionConfig(BaseModel):
    """
    角色权限配置  # noqa: E501
    """
    is_public: StrictInt = Field(..., alias="isPublic", description="是否可查看角色属性(0:不公开;1:公开)")
    allow_chat: StrictInt = Field(..., alias="allowChat", description="允许在平台和其他用户聊天(0:不允许,1:允许)")
    allow_api: StrictInt = Field(..., alias="allowApi", description="允许其他用户通过api调用(0:不允许,1:允许)")
    __properties = ["isPublic", "allowChat", "allowApi"]

    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) -> CharacterPermissionConfig:
        """Create an instance of CharacterPermissionConfig 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) -> CharacterPermissionConfig:
        """Create an instance of CharacterPermissionConfig from a dict"""
        if obj is None:
            return None

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

        _obj = CharacterPermissionConfig.parse_obj({
            "is_public": obj.get("isPublic"),
            "allow_chat": obj.get("allowChat"),
            "allow_api": obj.get("allowApi")
        })
        return _obj


