-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
81 lines (66 loc) · 1.73 KB
/
models.py
File metadata and controls
81 lines (66 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
This file contains all models for the application.
"""
from pydantic import Field
from pydantic.dataclasses import dataclass
@dataclass
class IdAndImageLink:
"""
Template model class which use id and image link.
"""
id: int = Field(
description="Unique identifier for the model",
json_schema_extra={"example": 1},
)
image_link: str = Field(
description="Link to an image of the model",
json_schema_extra={"example": "https://example.com/model_image.png"},
)
@dataclass
class BlipColor(IdAndImageLink):
"""
Blip color model.
"""
@dataclass
class BlipModel(IdAndImageLink):
"""
Blip model model.
"""
@dataclass
class Marker(IdAndImageLink):
"""
Marker model.
"""
@dataclass
class PedModel:
"""
Ped model model.
"""
name: str = Field(
description="Name of the ped model",
)
hash: str = Field(
description="Hexadecimal hash of the ped model",
json_schema_extra={"example": "0x92A27487"},
)
image_link: str = Field(
description="Link to an image of the ped model",
json_schema_extra={"example": "https://example.com/ped_image.png"},
)
@dataclass
class Weapon:
"""
Weapon model.
"""
name: str = Field(
description="Name of the weapon",
json_schema_extra={"example": "WEAPON_DAGGER"},
)
hash: str = Field(
description="Hexadecimal hash of the weapon",
json_schema_extra={"example": "0x92A27487"},
)
type: str = Field(
description="Type of weapon (melee, handguns, smg, shotguns, assault rifles, machine guns, sniper rifles, heavy weapons, throwables, misc)",
json_schema_extra={"example": "melee"},
)