firebase_tools.BaseClasses
- class firebase_tools.BaseClasses.ConStrBase(*, value: str, min_length: int = 0, max_length: int = 100, pattern: str = None, strip_whitespace: bool = False, curtail_length: int = None)[source]
Bases:
BaseModel
- curtail_length: int
- max_length: int
- min_length: int
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'curtail_length': FieldInfo(annotation=int, required=False), 'max_length': FieldInfo(annotation=int, required=False, default=100), 'min_length': FieldInfo(annotation=int, required=False, default=0), 'pattern': FieldInfo(annotation=str, required=False), 'strip_whitespace': FieldInfo(annotation=bool, required=False, default=False), 'value': FieldInfo(annotation=str, required=True, validate_default=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- pattern: str
- strip_whitespace: bool
- value: str
- class firebase_tools.BaseClasses.CoreModel(*, id: FirestoreIDType = None, status: Literal['active', 'inactive', 'archived'] = 'inactive')[source]
Bases:
BaseModel
Core base model with basic fields and common validation. Models that inherit this class should implement their own set_id method.
- id
The ID of the model instance. By default, it’s
- Type:
str, optional
- status
The status of the model instance, which can be “active”, “inactive”, or “archived”. By default, it’s “inactive”.
- Type:
str, optional
- set_id() str:
Abstract method to get the ID of the model instance.
- class Config[source]
Bases:
object
Here so fields can be hidden from the OPENAPI schema if hidden=True. Value can still be used as normal.
- id: FirestoreIDType
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': <function CoreModel.Config.json_schema_extra>}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'id': FieldInfo(annotation=FirestoreIDType, required=False, json_schema_extra={'hidden': True}), 'status': FieldInfo(annotation=Literal['active', 'inactive', 'archived'], required=False, default='inactive', json_schema_extra={'hidden': True})}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- status: Literal['active', 'inactive', 'archived']
- class firebase_tools.BaseClasses.FirebaseAuthGoodResponse(*, status: str, error_message: str | None, token: str | None, refresh_token: str | None, user_id: str | None, email: str | None, expires_in: str | None)[source]
Bases:
BaseModel
- email: str | None
- error_message: str | None
- expires_in: str | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'email': FieldInfo(annotation=Union[str, NoneType], required=True), 'error_message': FieldInfo(annotation=Union[str, NoneType], required=True), 'expires_in': FieldInfo(annotation=Union[str, NoneType], required=True), 'refresh_token': FieldInfo(annotation=Union[str, NoneType], required=True), 'status': FieldInfo(annotation=str, required=True), 'token': FieldInfo(annotation=Union[str, NoneType], required=True), 'user_id': FieldInfo(annotation=Union[str, NoneType], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- refresh_token: str | None
- status: str
- token: str | None
- user_id: str | None
- class firebase_tools.BaseClasses.FirestoreIDType(*, value: str, min_length: int = 1, max_length: int = 100, pattern: str = None, strip_whitespace: bool = False, curtail_length: int = None)[source]
Bases:
ConStrBase
- max_length: int
- min_length: int
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'curtail_length': FieldInfo(annotation=int, required=False), 'max_length': FieldInfo(annotation=int, required=False, default=100), 'min_length': FieldInfo(annotation=int, required=False, default=1), 'pattern': FieldInfo(annotation=str, required=False), 'strip_whitespace': FieldInfo(annotation=bool, required=False, default=False), 'value': FieldInfo(annotation=str, required=True, validate_default=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- pattern: str
