inttegro.balance
Models, requests, and enums for the Inttegro balance resource.
The primary returned object is inttegro.balance.Balance. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK.
1"""Models, requests, and enums for the Inttegro balance resource. 2 3The primary returned object is ``inttegro.balance.Balance``. Related request types, nested response shapes, and string-backed enums are exported from this singular namespace. Public members load lazily, so importing one resource does not eagerly import the entire SDK.""" 4 5from importlib import import_module 6from typing import TYPE_CHECKING, Any 7 8if TYPE_CHECKING: 9 from .balance import Balance as Balance 10 from .currency_snapshot import CurrencySnapshot as CurrencySnapshot 11 from .currency_snapshot_refund import CurrencySnapshotRefund as CurrencySnapshotRefund 12 from .currency_snapshot_reserved import CurrencySnapshotReserved as CurrencySnapshotReserved 13 from .lookup_request import LookupRequest as LookupRequest 14 from .snapshot_response import SnapshotResponse as SnapshotResponse 15 from .value import Value as Value 16 17 18_EXPORTS: dict[str, tuple[str, str]] = { 19 "Balance": ("inttegro.balance.balance", "Balance"), 20 "CurrencySnapshot": ("inttegro.balance.currency_snapshot", "CurrencySnapshot"), 21 "CurrencySnapshotRefund": ("inttegro.balance.currency_snapshot_refund", "CurrencySnapshotRefund"), 22 "CurrencySnapshotReserved": ("inttegro.balance.currency_snapshot_reserved", "CurrencySnapshotReserved"), 23 "LookupRequest": ("inttegro.balance.lookup_request", "LookupRequest"), 24 "SnapshotResponse": ("inttegro.balance.snapshot_response", "SnapshotResponse"), 25 "Value": ("inttegro.balance.value", "Value"), 26} 27 28__all__ = [ 29 "Balance", 30 "CurrencySnapshot", 31 "CurrencySnapshotRefund", 32 "CurrencySnapshotReserved", 33 "LookupRequest", 34 "SnapshotResponse", 35 "Value", 36] 37 38 39def __getattr__(name: str) -> Any: 40 """Load a public resource type on first access.""" 41 try: 42 module_name, attribute_name = _EXPORTS[name] 43 except KeyError: 44 raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None 45 value = getattr(import_module(module_name), attribute_name) 46 globals()[name] = value 47 return value
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Balance(ApiModel): 14 """The latest GHS balance snapshot for the application. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``BalanceSnapshot``. 23 """ 24 ghs: CurrencyBalanceSnapshot = field(init=False) 25 """The ghs associated with this balance. Required. Python type: ``CurrencyBalanceSnapshot``; wire name: ``ghs``; JSON type: object (CurrencyBalanceSnapshot)"""
The latest GHS balance snapshot for the application.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: BalanceSnapshot.
The ghs associated with this balance. Required. Python type: CurrencyBalanceSnapshot; wire name: ghs; JSON type: object (CurrencyBalanceSnapshot)
13@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 14class CurrencySnapshot(ApiModel): 15 """Typed currency snapshot data in the balance resource namespace. 16 17 Instances are immutable API responses. ``from_dict()`` decodes nested 18 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 19 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 20 Fields not returned by the API remain absent and can still be queried 21 through mapping-style access. 22 23 API contract schema: ``CurrencyBalanceSnapshot``. 24 """ 25 available: BalanceValue = field(init=False) 26 """The available associated with this currency snapshot. Required. Python type: ``BalanceValue``; wire name: ``available``; JSON type: object (BalanceValue)""" 27 includes_transactions_before: datetime = field(init=False) 28 """The snapshot includes transactions created before this timestamp. Required. Python type: ``datetime``; wire name: ``includes_transactions_before``; JSON type: string (date-time)""" 29 pending: BalanceValue = field(init=False) 30 """The pending associated with this currency snapshot. Required. Python type: ``BalanceValue``; wire name: ``pending``; JSON type: object (BalanceValue)""" 31 refund: CurrencyBalanceSnapshotRefund = field(init=False) 32 """Funds assigned to refund activity at the snapshot cutoff. Required. Python type: ``CurrencyBalanceSnapshotRefund``; wire name: ``refund``; JSON type: object""" 33 reserved: CurrencyBalanceSnapshotReserved = field(init=False) 34 """Funds held back from payout at the snapshot cutoff. Required. Python type: ``CurrencyBalanceSnapshotReserved``; wire name: ``reserved``; JSON type: object"""
Typed currency snapshot data in the balance resource namespace.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: CurrencyBalanceSnapshot.
The available associated with this currency snapshot. Required. Python type: BalanceValue; wire name: available; JSON type: object (BalanceValue)
The snapshot includes transactions created before this timestamp. Required. Python type: datetime; wire name: includes_transactions_before; JSON type: string (date-time)
The pending associated with this currency snapshot. Required. Python type: BalanceValue; wire name: pending; JSON type: object (BalanceValue)
Funds assigned to refund activity at the snapshot cutoff. Required. Python type: CurrencyBalanceSnapshotRefund; wire name: refund; JSON type: object
Funds held back from payout at the snapshot cutoff. Required. Python type: CurrencyBalanceSnapshotReserved; wire name: reserved; JSON type: object
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class CurrencySnapshotRefund(ApiModel): 14 """Funds assigned to refund activity at the snapshot cutoff. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``CurrencyBalanceSnapshotRefund``. 23 """ 24 amount: int = field(init=False) 25 """Amount in the currency's smallest unit. Required. Python type: ``int``; wire name: ``amount``; JSON type: integer. Constraints: minimum 0"""
Funds assigned to refund activity at the snapshot cutoff.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: CurrencyBalanceSnapshotRefund.
Amount in the currency's smallest unit. Required. Python type: int; wire name: amount; JSON type: integer. Constraints: minimum 0
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class CurrencySnapshotReserved(ApiModel): 14 """Funds assigned to refund activity at the snapshot cutoff. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``CurrencyBalanceSnapshotReserved``. 23 """ 24 amount: int = field(init=False) 25 """Amount in the currency's smallest unit. Required. Python type: ``int``; wire name: ``amount``; JSON type: integer. Constraints: minimum 0"""
Funds assigned to refund activity at the snapshot cutoff.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: CurrencyBalanceSnapshotReserved.
Amount in the currency's smallest unit. Required. Python type: int; wire name: amount; JSON type: integer. Constraints: minimum 0
12@dataclass(frozen=True, slots=True, kw_only=True) 13class LookupRequest(ApiRequest): 14 """Parameters accepted by the lookup request operation. 15 16 This is an immutable, keyword-only request object. ``to_dict()`` uses 17 the documented wire names, omits fields left as ``UNSET``, serializes 18 string-backed enums by value, and requires timezone-aware datetimes. 19 20 API contract schema: ``LookupBalancesRequest``. 21 """ 22 pass
Parameters accepted by the lookup request operation.
This is an immutable, keyword-only request object. to_dict() uses
the documented wire names, omits fields left as UNSET, serializes
string-backed enums by value, and requires timezone-aware datetimes.
API contract schema: LookupBalancesRequest.
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class SnapshotResponse(ApiModel): 14 """Typed response returned by the snapshot operation. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``BalanceSnapshotResponse``. 23 """ 24 balances: BalanceSnapshot = field(init=False) 25 """The latest GHS balance snapshot for the application. Required. Python type: ``BalanceSnapshot``; wire name: ``balances``; JSON type: object (BalanceSnapshot)"""
Typed response returned by the snapshot operation.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: BalanceSnapshotResponse.
12@dataclass(frozen=True, slots=True, init=False, repr=False, eq=False) 13class Value(ApiModel): 14 """Typed value data in the balance resource namespace. 15 16 Instances are immutable API responses. ``from_dict()`` decodes nested 17 objects, string-backed enums, and timezone-aware ISO-8601 timestamps; 18 ``to_dict()`` returns the corresponding JSON-compatible wire shape. 19 Fields not returned by the API remain absent and can still be queried 20 through mapping-style access. 21 22 API contract schema: ``BalanceValue``. 23 """ 24 amount: int = field(init=False) 25 """Amount in the currency's smallest unit. Required. Python type: ``int``; wire name: ``amount``; JSON type: integer. Constraints: minimum 0"""
Typed value data in the balance resource namespace.
Instances are immutable API responses. from_dict() decodes nested
objects, string-backed enums, and timezone-aware ISO-8601 timestamps;
to_dict() returns the corresponding JSON-compatible wire shape.
Fields not returned by the API remain absent and can still be queried
through mapping-style access.
API contract schema: BalanceValue.
Amount in the currency's smallest unit. Required. Python type: int; wire name: amount; JSON type: integer. Constraints: minimum 0