2021-07-03 13:58:46 +08:00
|
|
|
|
from typing import Optional
|
|
|
|
|
|
2021-10-02 17:35:10 +08:00
|
|
|
|
from pydantic import Field, BaseModel
|
2021-07-03 13:58:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Config(BaseModel):
|
|
|
|
|
"""
|
2021-10-02 17:35:10 +08:00
|
|
|
|
飞书配置类
|
2021-07-03 13:58:46 +08:00
|
|
|
|
|
|
|
|
|
:配置项:
|
|
|
|
|
|
|
|
|
|
- ``app_id`` / ``feishu_app_id``: 飞书开放平台后台“凭证与基础信息”处给出的 App ID
|
|
|
|
|
- ``app_secret`` / ``feishu_app_secret``: 飞书开放平台后台“凭证与基础信息”处给出的 App Secret
|
|
|
|
|
- ``encrypt_key`` / ``feishu_encrypt_key``: 飞书开放平台后台“事件订阅”处设置的 Encrypt Key
|
|
|
|
|
- ``verification_token`` / ``feishu_verification_token``: 飞书开放平台后台“事件订阅”处设置的 Verification Token
|
|
|
|
|
- ``tenant_access_token`` / ``feishu_tenant_access_token``: 请求飞书 API 后返回的租户密钥
|
2021-08-16 17:30:52 +08:00
|
|
|
|
- ``is_lark`` / ``feishu_is_lark``: 是否使用Lark(飞书海外版),默认为 false
|
2021-08-14 13:04:15 +08:00
|
|
|
|
|
2021-07-03 13:58:46 +08:00
|
|
|
|
"""
|
|
|
|
|
app_id: Optional[str] = Field(default=None, alias="feishu_app_id")
|
|
|
|
|
app_secret: Optional[str] = Field(default=None, alias="feishu_app_secret")
|
|
|
|
|
encrypt_key: Optional[str] = Field(default=None, alias="feishu_encrypt_key")
|
|
|
|
|
verification_token: Optional[str] = Field(default=None,
|
|
|
|
|
alias="feishu_verification_token")
|
|
|
|
|
tenant_access_token: Optional[str] = Field(
|
|
|
|
|
default=None, alias="feishu_tenant_access_token")
|
2021-08-16 17:30:52 +08:00
|
|
|
|
is_lark: Optional[str] = Field(default=False, alias="feishu_is_lark")
|
2021-07-03 13:58:46 +08:00
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
extra = "ignore"
|
|
|
|
|
allow_population_by_field_name = True
|