app.model.games module

class app.model.games.Games(*, id=<factory>, created_at=<factory>, updated_at=<factory>, apiKey_used, oauth_user_id=None, externalGameId, strategyId, platform)[source]

Bases: BaseModel

Represents a game entity, identified by an external ID.

This model stores game information and integrates with SQLModel for ORM capabilities. It supports operations like creating, updating, and querying game entities based on their external IDs, strategies, and platforms.

Parameters:
  • id (Annotated[str, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=UUID(), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'primary_key': True, 'index': True})])

  • created_at (Annotated[datetime, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=DateTime(timezone=True), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'server_default': <sqlalchemy.sql.functions.now at 0x7fa8900484a0; now>})])

  • updated_at (Annotated[datetime, FieldInfoMetadata(primary_key=PydanticUndefined, nullable=PydanticUndefined, foreign_key=PydanticUndefined, ondelete=PydanticUndefined, unique=PydanticUndefined, index=PydanticUndefined, sa_type=DateTime(timezone=True), sa_column=PydanticUndefined, sa_column_args=PydanticUndefined, sa_column_kwargs={'server_default': <sqlalchemy.sql.functions.now at 0x7fa88fa2a840; now>, 'onupdate': <sqlalchemy.sql.functions.now at 0x7fa88fa2ad20; now>})])

id

Unique identifier, from BaseModel.

Type:

int

created_at

Creation timestamp, from BaseModel.

Type:

datetime

updated_at

Last update timestamp, from BaseModel.

Type:

datetime

externalGameId

Unique external game ID.

Type:

str

strategyId

Strategy identifier, defaults to “default”.

Type:

str

platform

Platform (e.g., PC, PlayStation).

Type:

str

__str__()[source]

Returns a string representation.

__repr__()[source]

For debug logs, similar to __str__.

__eq__()[source]

Equality based on externalGameId and platform.

__hash__()[source]

Hash based on externalGameId and platform.

Configuration:

orm_mode (bool): Enables ORM mode for Pydantic models.

model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'read_from_attributes': True, 'read_with_orm_mode': True, 'registry': PydanticUndefined, 'table': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].