Types
flowerhub_portal_api_client.types
Data models and typed results for the Flowerhub client.
AgreementResult
Bases: StandardResult
Result for electricity agreement fetch.
Fields:
- status_code: HTTP status code
- agreement: Parsed ElectricityAgreement or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
AssetFetchResult
Bases: StandardResult
Result for asset fetch.
Fields:
- status_code: HTTP status code
- asset_info: Raw asset payload dict or None
- flowerhub_status: Parsed FlowerHubStatus or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
AssetIdResult
Bases: StandardResult
Result for asset ID discovery.
Fields: - status_code: HTTP status code - asset_id: Parsed integer asset id or None - json: Raw response payload - text: Raw response text - error: Error message when not raising, else None
AssetInfo
dataclass
Asset information with serial number and model.
AssetModel
dataclass
Asset model with manufacturer info.
AssetOwnerDetails
dataclass
Complete asset owner details.
Mirrors the response of GET /asset-owner/{assetOwnerId}.
AssetOwnerDetailsResult
Bases: StandardResult
Result for asset owner details fetch.
Fields:
- status_code: HTTP status code
- details: Parsed AssetOwnerDetails or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
AssetOwnerProfile
dataclass
Profile details for an asset owner.
Mirrors the response of GET /asset-owner/{assetOwnerId}/profile.
Compensation
dataclass
Compensation status and message.
ConsumptionResult
Bases: StandardResult
Result for consumption fetch.
Fields:
- status_code: HTTP status code
- consumption: List of parsed ConsumptionRecord or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
InvoicesResult
Bases: StandardResult
Result for invoices fetch.
Fields:
- status_code: HTTP status code
- invoices: List of parsed Invoice or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
ProfileResult
Bases: StandardResult
Result for asset owner profile fetch.
Fields:
- status_code: HTTP status code
- profile: Parsed AssetOwnerProfile or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
Revenue
dataclass
Revenue summary for the last invoice of an asset.
Mirrors GET /asset/{assetId}/revenue.
RevenueResult
Bases: StandardResult
Result for asset revenue fetch.
Fields:
- status_code: HTTP status code
- revenue: Parsed Revenue or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
SimpleDistributor
dataclass
Minimal distributor info (id and name only).
SimpleInstaller
dataclass
Minimal installer info (id and name only).
StandardResult
Bases: TypedDict
Base result with common fields returned by most endpoints.
This serves as a structural baseline to make responses more consistent without removing endpoint-specific parsed data.
Fields: - status_code: HTTP status code - json: Raw response payload - text: Raw response text - error: Error message when not raising, else None
UptimeAvailableMonthsResult
Bases: StandardResult
Result for uptime available months fetch.
Fields:
- status_code: HTTP status code
- months: List of parsed UptimeMonth or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
UptimeHistoryEntry
dataclass
Monthly uptime ratio entry.
Represents uptime ratio (percentage) for a given month.
UptimeHistoryResult
Bases: StandardResult
Result for uptime monthly ratio history fetch.
Fields:
- status_code: HTTP status code
- history: List of parsed UptimeHistoryEntry or None
- json: Raw response payload
- text: Raw response text
- error: Error message when not raising, else None
UptimeMonth
dataclass
Available uptime month item.
Represents a single month entry with machine-readable value and human label.
UptimePieResult
Bases: StandardResult
Result for uptime pie-chart endpoint.
Fields: - status_code: HTTP status code - uptime: Uptime duration in seconds, or None - downtime: Downtime duration in seconds, or None - noData: No-data duration in seconds, or None - uptime_ratio_total: Uptime percentage (0-100) of entire period including noData, or None - uptime_ratio_actual: Uptime percentage (0-100) of measured data only (excludes noData), or None - json: Raw response payload - text: Raw response text - error: Error message when not raising, else None