blob: e012741aa779947de17aeb13ea0b3497f819e909 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from decimal import Decimal
from pydantic import BaseModel, ConfigDict, Field
class AMTAccount(BaseModel):
model_config = ConfigDict(extra="ignore", validate_assignment=True)
# Remaining available AWS Billing usage if you have enabled AWS Billing.
available_balance: Decimal = Field()
onhold_balance: Decimal = Field(default=Decimal(0))
# --- Properties ---
@property
def is_healthy(self) -> bool:
# A healthy account is one with at least $2,500 worth of
# credit available to it
return self.available_balance >= 2_500
|