Interface Connection.Interface.Balance

Interface Index (Compact) | Summary | Description | Signals | Properties | Types

Signals

BalanceChanged ((ius): Balance)

Properties

AccountBalance (ius) ( Currency_Amount) Read only
ManageCreditURI s Read only

Types

Currency_Amount Struct (ius)
Added in 0.19.0. (as stable API)
Objects implementing this interface must also implement:

Description

In many real-time communication services the user can pay for certain services, typically calls to the PSTN, in advance. In (at least) Skype, it's possible to query the current balance in a machine-readable way.

Signals

(Permalink)

BalanceChanged ((ius): Balance)

Parameters

Emitted when the user's balance has changed.

Properties

Accessed using the org.freedesktop.DBus.Properties interface.
(Permalink)

AccountBalance — (ius) (Currency_Amount)

Read only

The user's balance on the account corresponding to this Connection. A negative amount may be possible on some services, and indicates that the user owes money to the service provider.

On initial connection, this property may have an unknown value, represented by Amount = 0, Scale = 2**32 - 1 (the largest possible 32-bit unsigned integer) and Currency = "".

(Permalink)

ManageCreditURI — s

Read only
Added in 0.22.2.
A URI the user may visit via the web browser to manage and top-up their account balance. This property is not guaranteed to be well-defined until the connection becomes Connected; there is no change notification.
Rationale:
Different protocols and even servers or gateways (e.g. SIP and XMPP PSTN gateways) will have a different website used to manage a user's account balance. This property enables the client to provide that to the user. A Connection Manager MAY set this itself (because it is static or discoverable), or expose it as a connection parameter.

Types

Struct (Permalink)

Currency_Amount — (ius)

An amount of money in a specified currency. For example, 3.21 British pounds would conventionally be represented by (Amount = 321, Scale = 2, Currency = "GBP"), but could be represented by (Amount = 3210, Scale = 3, Currency = "GBP") in a service that records balance in units of 0.001 pounds.

As a special case, if Amount = 0, Scale = 2**32 - 1 (i.e. the largest possible 32-bit unsigned integer) and Currency = "", this indicates an unknown amount.

  • Amount — i
  • The amount, expressed as a fixed-point number with decimal scale defined by the Scale field; for instance, an Amount value of 1234 with Scale of 2 represents 12.34 in the currency unit given by the Currency field.

  • Scale — u
  • The decimal scale for the fixed point value of the Amount field, defining the number of rightmost decimal digits from the integer value which form the fractional part of the resulting currency value.

    As well as defining the interpretation of Amount, user interfaces may use this value to determine the precision with which to display the amount.

  • Currency — s
  • The currency code represented by this amount, which SHOULD be an international currency code such as "EUR", "USD", or "JPY" if possible. An empty string can be used to indicate that the currency is not known.