Module genshin.models.genshin.transaction

Genshin transaction models.

Classes

class BaseTransaction (**data: Any)

Genshin transaction.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class BaseTransaction(APIModel, Unique):
    """Genshin transaction."""

    kind: TransactionKind

    id: int
    time: DateTimeField = Aliased("datetime")
    amount: int = Aliased("add_num")
    reason: str = Aliased("reason")

Ancestors

Subclasses

Class variables

var amount : int
var id : int
var kindTransactionKind
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var reason : str
var time : datetime.datetime
class ItemTransaction (**data: Any)

Genshin transaction of artifacts or weapons.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class ItemTransaction(BaseTransaction):
    """Genshin transaction of artifacts or weapons."""

    kind: typing.Literal[TransactionKind.ARTIFACT, TransactionKind.WEAPON]

    name: str
    rarity: int = Aliased("quality")

Ancestors

Class variables

var kind : Literal[<TransactionKind.ARTIFACT: 'artifact'>, <TransactionKind.WEAPON: 'weapon'>]
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
var name : str
var rarity : int
class Transaction (**data: Any)

Genshin transaction of currency.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Expand source code
class Transaction(BaseTransaction):
    """Genshin transaction of currency."""

    kind: typing.Literal[TransactionKind.PRIMOGEM, TransactionKind.CRYSTAL, TransactionKind.RESIN]

Ancestors

Class variables

var kind : Literal[<TransactionKind.PRIMOGEM: 'primogem'>, <TransactionKind.CRYSTAL: 'crystal'>, <TransactionKind.RESIN: 'resin'>]
var model_computed_fields
var model_config : pydantic.config.ConfigDict
var model_fields
class TransactionKind (value, names=None, *, module=None, qualname=None, type=None, start=1)

Possible kind of transaction.

Expand source code
class TransactionKind(str, enum.Enum):
    """Possible kind of transaction."""

    PRIMOGEM = "primogem"
    """Primogem currency."""

    CRYSTAL = "crystal"
    """Genesis crystal currency."""

    RESIN = "resin"
    """Resin currency."""

    ARTIFACT = "artifact"
    """Artifact items from domains."""

    WEAPON = "weapon"
    """Weapon items from domains and wishes."""

Ancestors

  • builtins.str
  • enum.Enum

Class variables

var ARTIFACT

Artifact items from domains.

var CRYSTAL

Genesis crystal currency.

var PRIMOGEM

Primogem currency.

var RESIN

Resin currency.

var WEAPON

Weapon items from domains and wishes.