[docs]classConfig(BaseModel):model_config=ConfigDict(extra="forbid")pac_token:str|None=Nonepac_token_home_secret_toml_path:str|None=Nonecache_expire:int=30*24*3600@model_validator(mode="after")defcheck_pac_token(self):ifself.pac_tokenisNoneandself.pac_token_home_secret_toml_pathisNone:raiseValueError("Must provide pac_token or pac_token_home_secret_toml_path")returnself@classmethoddefload(cls,path:Path)->"Config":# pragma: no coverreturncls.model_validate(json.loads(path.read_text()))defdump(self,path:Path):# pragma: no coverpath.write_text(self.model_dump_json(indent=4))@cached_propertydefgh(self):ifself.pac_tokenisnotNone:pac_token=self.pac_tokenelifself.pac_token_home_secret_toml_pathisnotNone:pac_token=hs.v(self.pac_token_home_secret_toml_path)else:raiseValueError("Must provide pac_token or pac_token_home_secret_toml")returnGithub(auth=Auth.Token(pac_token))