mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
15 lines
364 B
Python
15 lines
364 B
Python
from dataclasses import dataclass
|
|
from typing import Mapping
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class MagicPlanConfig:
|
|
customer_id: str
|
|
api_key: str
|
|
|
|
@classmethod
|
|
def from_env(cls, env: Mapping[str, str]) -> "MagicPlanConfig":
|
|
return cls(
|
|
customer_id=env["MAGICPLAN_CUSTOMER_ID"],
|
|
api_key=env["MAGICPLAN_API_KEY"],
|
|
)
|