|
| 1 | +from __future__ import annotations |
| 2 | + |
| 3 | +"""A class representing the SubscriptionPriceConnectionPageInfo type from the GraphQL Tibber API.""" |
| 4 | +from typing import TYPE_CHECKING |
| 5 | + |
| 6 | + |
| 7 | +class SubscriptionPriceConnectionPageInfo: |
| 8 | + def __init__(self, data: dict, tibber_client: "Account"): |
| 9 | + self.cache: dict = data or {} |
| 10 | + self.tibber_client: "Account" = tibber_client |
| 11 | + |
| 12 | + @property |
| 13 | + def end_cursor(self) -> str: |
| 14 | + return self.cache.get("endCursor") |
| 15 | + |
| 16 | + @property |
| 17 | + def has_next_page(self) -> bool: |
| 18 | + return self.cache.get("hasNextPage") |
| 19 | + |
| 20 | + @property |
| 21 | + def has_previous_page(self) -> bool: |
| 22 | + return self.cache.get("hasPreviousPage") |
| 23 | + |
| 24 | + @property |
| 25 | + def start_cursor(self) -> str: |
| 26 | + return self.cache.get("startCursor") |
| 27 | + |
| 28 | + @property |
| 29 | + def resolution(self) -> str: |
| 30 | + return self.cache.get("resolution") |
| 31 | + |
| 32 | + @property |
| 33 | + def currency(self) -> str: |
| 34 | + return self.cache.get("currency") |
| 35 | + |
| 36 | + @property |
| 37 | + def count(self) -> int: |
| 38 | + return self.cache.get("count") |
| 39 | + |
| 40 | + @property |
| 41 | + def precision(self) -> int: |
| 42 | + return self.cache.get("precision") |
| 43 | + |
| 44 | + @property |
| 45 | + def min_energy(self) -> float: |
| 46 | + return self.cache.get("minEnergy") |
| 47 | + |
| 48 | + @property |
| 49 | + def min_total(self) -> float: |
| 50 | + return self.cache.get("minTotal") |
| 51 | + |
| 52 | + @property |
| 53 | + def max_energy(self) -> float: |
| 54 | + return self.cache.get("maxEnergy") |
| 55 | + |
| 56 | + @property |
| 57 | + def max_total(self) -> float: |
| 58 | + return self.cache.get("maxTotal") |
0 commit comments