ffbb-data-client 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ffbb_api_client_v3/__init__.py +25 -0
- ffbb_data_client/__init__.py +175 -0
- ffbb_data_client/clients/__init__.py +13 -0
- ffbb_data_client/clients/api_ffbb_app_client.py +2475 -0
- ffbb_data_client/clients/ffbb_data_client.py +2789 -0
- ffbb_data_client/clients/meilisearch_client.py +218 -0
- ffbb_data_client/clients/meilisearch_ffbb_client.py +647 -0
- ffbb_data_client/config.py +153 -0
- ffbb_data_client/data/__init__.py +25 -0
- ffbb_data_client/data/collections.json +1364 -0
- ffbb_data_client/data/endpoint_discovery.json +1875 -0
- ffbb_data_client/data/indexes.json +501 -0
- ffbb_data_client/data/openapi.json +35713 -0
- ffbb_data_client/data/openapi_full.json +37622 -0
- ffbb_data_client/helpers/__init__.py +27 -0
- ffbb_data_client/helpers/http_requests_helper.py +73 -0
- ffbb_data_client/helpers/http_requests_utils.py +502 -0
- ffbb_data_client/helpers/meilisearch_client_extension.py +153 -0
- ffbb_data_client/helpers/multi_search_query_helper.py +35 -0
- ffbb_data_client/models/__init__.py +241 -0
- ffbb_data_client/models/affiche.py +45 -0
- ffbb_data_client/models/cartographie.py +82 -0
- ffbb_data_client/models/categorie.py +55 -0
- ffbb_data_client/models/categorie_type.py +42 -0
- ffbb_data_client/models/clock.py +38 -0
- ffbb_data_client/models/club_contacts.py +77 -0
- ffbb_data_client/models/code.py +7 -0
- ffbb_data_client/models/commune.py +66 -0
- ffbb_data_client/models/competition_fields.py +309 -0
- ffbb_data_client/models/competition_id.py +116 -0
- ffbb_data_client/models/competition_id_categorie.py +31 -0
- ffbb_data_client/models/competition_id_sexe.py +31 -0
- ffbb_data_client/models/competition_id_type_competition.py +27 -0
- ffbb_data_client/models/competition_id_type_competition_generique.py +24 -0
- ffbb_data_client/models/competition_origine.py +69 -0
- ffbb_data_client/models/competition_origine_categorie.py +23 -0
- ffbb_data_client/models/competition_origine_type_competition.py +14 -0
- ffbb_data_client/models/competition_origine_type_competition_generique.py +24 -0
- ffbb_data_client/models/competition_type.py +6 -0
- ffbb_data_client/models/competitions_facet_distribution.py +65 -0
- ffbb_data_client/models/competitions_facet_stats.py +14 -0
- ffbb_data_client/models/competitions_hit.py +232 -0
- ffbb_data_client/models/competitions_multi_search_query.py +40 -0
- ffbb_data_client/models/competitions_query.py +11 -0
- ffbb_data_client/models/configuration_models.py +5 -0
- ffbb_data_client/models/contact_info.py +18 -0
- ffbb_data_client/models/content_multi_search_query.py +93 -0
- ffbb_data_client/models/coordonnees.py +27 -0
- ffbb_data_client/models/coordonnees_type.py +5 -0
- ffbb_data_client/models/document_flyer.py +205 -0
- ffbb_data_client/models/document_flyer_type.py +6 -0
- ffbb_data_client/models/engagement_contacts.py +97 -0
- ffbb_data_client/models/engagements_facet_distribution.py +59 -0
- ffbb_data_client/models/engagements_facet_stats.py +14 -0
- ffbb_data_client/models/engagements_hit.py +192 -0
- ffbb_data_client/models/engagements_multi_search_query.py +41 -0
- ffbb_data_client/models/etat.py +6 -0
- ffbb_data_client/models/external_competition_id.py +42 -0
- ffbb_data_client/models/external_id.py +72 -0
- ffbb_data_client/models/facet_distribution.py +13 -0
- ffbb_data_client/models/facet_stats.py +13 -0
- ffbb_data_client/models/field_set.py +10 -0
- ffbb_data_client/models/folder.py +35 -0
- ffbb_data_client/models/formation_session.py +60 -0
- ffbb_data_client/models/formations_facet_distribution.py +61 -0
- ffbb_data_client/models/formations_facet_stats.py +14 -0
- ffbb_data_client/models/formations_hit.py +277 -0
- ffbb_data_client/models/formations_multi_search_query.py +41 -0
- ffbb_data_client/models/game_stats_model.py +57 -0
- ffbb_data_client/models/game_stats_models.py +5 -0
- ffbb_data_client/models/generic_search.py +92 -0
- ffbb_data_client/models/geo.py +27 -0
- ffbb_data_client/models/geo_sort_order.py +6 -0
- ffbb_data_client/models/get_commune_response.py +18 -0
- ffbb_data_client/models/get_competition_response.py +523 -0
- ffbb_data_client/models/get_configuration_response.py +45 -0
- ffbb_data_client/models/get_engagement_response.py +23 -0
- ffbb_data_client/models/get_entraineur_response.py +18 -0
- ffbb_data_client/models/get_formation_response.py +28 -0
- ffbb_data_client/models/get_officiel_response.py +18 -0
- ffbb_data_client/models/get_organisme_response.py +476 -0
- ffbb_data_client/models/get_poule_response.py +68 -0
- ffbb_data_client/models/get_pratique_response.py +18 -0
- ffbb_data_client/models/get_rencontre_response.py +93 -0
- ffbb_data_client/models/get_saisons_response.py +56 -0
- ffbb_data_client/models/get_salle_response.py +20 -0
- ffbb_data_client/models/get_terrain_response.py +16 -0
- ffbb_data_client/models/get_tournoi_response.py +16 -0
- ffbb_data_client/models/gradient_color.py +27 -0
- ffbb_data_client/models/hit.py +16 -0
- ffbb_data_client/models/id_engagement_equipe.py +32 -0
- ffbb_data_client/models/id_organisme_equipe.py +51 -0
- ffbb_data_client/models/id_organisme_equipe1_logo.py +28 -0
- ffbb_data_client/models/id_poule.py +27 -0
- ffbb_data_client/models/jour.py +11 -0
- ffbb_data_client/models/label.py +15 -0
- ffbb_data_client/models/labellisation.py +30 -0
- ffbb_data_client/models/live.py +192 -0
- ffbb_data_client/models/lives.py +6 -0
- ffbb_data_client/models/logo.py +28 -0
- ffbb_data_client/models/multi_search_queries.py +24 -0
- ffbb_data_client/models/multi_search_query.py +96 -0
- ffbb_data_client/models/multi_search_result_competitions.py +14 -0
- ffbb_data_client/models/multi_search_result_engagements.py +14 -0
- ffbb_data_client/models/multi_search_result_formations.py +12 -0
- ffbb_data_client/models/multi_search_result_organismes.py +12 -0
- ffbb_data_client/models/multi_search_result_pratiques.py +12 -0
- ffbb_data_client/models/multi_search_result_rencontres.py +12 -0
- ffbb_data_client/models/multi_search_result_salles.py +12 -0
- ffbb_data_client/models/multi_search_result_terrains.py +12 -0
- ffbb_data_client/models/multi_search_result_tournois.py +12 -0
- ffbb_data_client/models/multi_search_results.py +103 -0
- ffbb_data_client/models/multi_search_results_class.py +96 -0
- ffbb_data_client/models/nature_sol.py +57 -0
- ffbb_data_client/models/niveau.py +10 -0
- ffbb_data_client/models/niveau_class.py +27 -0
- ffbb_data_client/models/niveau_extractor.py +214 -0
- ffbb_data_client/models/niveau_info.py +64 -0
- ffbb_data_client/models/niveau_models.py +14 -0
- ffbb_data_client/models/niveau_type.py +10 -0
- ffbb_data_client/models/objectif.py +7 -0
- ffbb_data_client/models/organisateur.py +197 -0
- ffbb_data_client/models/organisateur_type.py +6 -0
- ffbb_data_client/models/organisme_fields.py +327 -0
- ffbb_data_client/models/organisme_id_pere.py +177 -0
- ffbb_data_client/models/organismes_facet_distribution.py +46 -0
- ffbb_data_client/models/organismes_facet_stats.py +14 -0
- ffbb_data_client/models/organismes_hit.py +196 -0
- ffbb_data_client/models/organismes_multi_search_query.py +41 -0
- ffbb_data_client/models/organismes_query.py +8 -0
- ffbb_data_client/models/phase_code.py +23 -0
- ffbb_data_client/models/poule.py +35 -0
- ffbb_data_client/models/poule_fields.py +261 -0
- ffbb_data_client/models/poule_rencontre_item_model.py +69 -0
- ffbb_data_client/models/poules_models.py +6 -0
- ffbb_data_client/models/poules_query.py +9 -0
- ffbb_data_client/models/pratique.py +7 -0
- ffbb_data_client/models/pratiques_facet_distribution.py +29 -0
- ffbb_data_client/models/pratiques_facet_stats.py +14 -0
- ffbb_data_client/models/pratiques_hit.py +310 -0
- ffbb_data_client/models/pratiques_hit_type.py +9 -0
- ffbb_data_client/models/pratiques_multi_search_query.py +41 -0
- ffbb_data_client/models/pratiques_type_class.py +45 -0
- ffbb_data_client/models/publication_internet.py +6 -0
- ffbb_data_client/models/purple_logo.py +24 -0
- ffbb_data_client/models/query_fields_manager.py +75 -0
- ffbb_data_client/models/ranking_engagement.py +41 -0
- ffbb_data_client/models/rankings_models.py +6 -0
- ffbb_data_client/models/rencontres_engagement.py +23 -0
- ffbb_data_client/models/rencontres_facet_distribution.py +65 -0
- ffbb_data_client/models/rencontres_facet_stats.py +14 -0
- ffbb_data_client/models/rencontres_hit.py +271 -0
- ffbb_data_client/models/rencontres_multi_search_query.py +41 -0
- ffbb_data_client/models/saison.py +23 -0
- ffbb_data_client/models/saison_fields.py +36 -0
- ffbb_data_client/models/saisons_models.py +6 -0
- ffbb_data_client/models/saisons_query.py +9 -0
- ffbb_data_client/models/salle.py +56 -0
- ffbb_data_client/models/salles_facet_distribution.py +14 -0
- ffbb_data_client/models/salles_facet_stats.py +14 -0
- ffbb_data_client/models/salles_hit.py +153 -0
- ffbb_data_client/models/salles_multi_search_query.py +40 -0
- ffbb_data_client/models/sexe.py +9 -0
- ffbb_data_client/models/sexe_class.py +31 -0
- ffbb_data_client/models/source.py +5 -0
- ffbb_data_client/models/status.py +5 -0
- ffbb_data_client/models/team_engagement.py +56 -0
- ffbb_data_client/models/team_ranking.py +108 -0
- ffbb_data_client/models/terrains_categorie_championnat_3x3_libelle.py +5 -0
- ffbb_data_client/models/terrains_facet_distribution.py +41 -0
- ffbb_data_client/models/terrains_facet_stats.py +14 -0
- ffbb_data_client/models/terrains_hit.py +223 -0
- ffbb_data_client/models/terrains_multi_search_query.py +42 -0
- ffbb_data_client/models/terrains_name.py +5 -0
- ffbb_data_client/models/terrains_sexe_enum.py +7 -0
- ffbb_data_client/models/terrains_storage.py +5 -0
- ffbb_data_client/models/tournoi_type_class.py +35 -0
- ffbb_data_client/models/tournoi_type_enum.py +7 -0
- ffbb_data_client/models/tournoi_types_3x3.py +43 -0
- ffbb_data_client/models/tournoi_types_3x3_libelle.py +60 -0
- ffbb_data_client/models/tournoi_types_3x3_libelle_enum.py +10 -0
- ffbb_data_client/models/tournois_facet_distribution.py +41 -0
- ffbb_data_client/models/tournois_facet_stats.py +14 -0
- ffbb_data_client/models/tournois_hit.py +132 -0
- ffbb_data_client/models/tournois_hit_type.py +5 -0
- ffbb_data_client/models/tournois_libelle.py +7 -0
- ffbb_data_client/models/tournois_multi_search_query.py +40 -0
- ffbb_data_client/models/type_association.py +23 -0
- ffbb_data_client/models/type_association_libelle.py +30 -0
- ffbb_data_client/models/type_class.py +23 -0
- ffbb_data_client/models/type_competition.py +8 -0
- ffbb_data_client/models/type_competition_generique.py +31 -0
- ffbb_data_client/models/type_enum.py +7 -0
- ffbb_data_client/models/type_league.py +6 -0
- ffbb_data_client/py.typed +0 -0
- ffbb_data_client/utils/__init__.py +27 -0
- ffbb_data_client/utils/cache_manager.py +393 -0
- ffbb_data_client/utils/converter_utils.py +329 -0
- ffbb_data_client/utils/input_validation.py +360 -0
- ffbb_data_client/utils/retry_utils.py +478 -0
- ffbb_data_client/utils/secure_logging.py +153 -0
- ffbb_data_client/utils/token_manager.py +115 -0
- ffbb_data_client-2.0.0.dist-info/METADATA +339 -0
- ffbb_data_client-2.0.0.dist-info/RECORD +207 -0
- ffbb_data_client-2.0.0.dist-info/WHEEL +5 -0
- ffbb_data_client-2.0.0.dist-info/licenses/LICENSE.txt +201 -0
- ffbb_data_client-2.0.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class GetPratiqueResponse:
|
|
6
|
+
id: str
|
|
7
|
+
label: str | None = None
|
|
8
|
+
type: str | None = None
|
|
9
|
+
|
|
10
|
+
@classmethod
|
|
11
|
+
def from_dict(cls, data: dict) -> "GetPratiqueResponse | None":
|
|
12
|
+
if not data or not isinstance(data, dict):
|
|
13
|
+
return None
|
|
14
|
+
return cls(
|
|
15
|
+
id=str(data.get("id", "")),
|
|
16
|
+
label=data.get("label"),
|
|
17
|
+
type=data.get("type"),
|
|
18
|
+
)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class GetRencontreResponse:
|
|
8
|
+
id: str
|
|
9
|
+
numero: str | None = None
|
|
10
|
+
numeroJournee: str | None = None
|
|
11
|
+
date_rencontre: datetime | None = None
|
|
12
|
+
date: str | None = None
|
|
13
|
+
horaire: str | None = None
|
|
14
|
+
resultatEquipe1: str | None = None
|
|
15
|
+
resultatEquipe2: str | None = None
|
|
16
|
+
joue: int = 0
|
|
17
|
+
nomEquipe1: str | None = None
|
|
18
|
+
nomEquipe2: str | None = None
|
|
19
|
+
idPoule: str | None = None
|
|
20
|
+
competitionId: Any | None = None
|
|
21
|
+
idOrganismeEquipe1: Any | None = None
|
|
22
|
+
idOrganismeEquipe2: Any | None = None
|
|
23
|
+
idEngagementEquipe1: Any | None = None
|
|
24
|
+
idEngagementEquipe2: Any | None = None
|
|
25
|
+
salle: Any | None = None
|
|
26
|
+
officiels: list[Any] | None = None
|
|
27
|
+
rematch_videos: list[Any] | None = None
|
|
28
|
+
gsId: str | None = None
|
|
29
|
+
etat: str | None = None
|
|
30
|
+
handicap1: Any | None = None
|
|
31
|
+
handicap2: Any | None = None
|
|
32
|
+
pratique: str | None = None
|
|
33
|
+
uniqueKey: str | None = None
|
|
34
|
+
url_competition: str | None = None
|
|
35
|
+
validee: bool | None = None
|
|
36
|
+
remise: bool | None = None
|
|
37
|
+
defautEquipe1: bool | None = None
|
|
38
|
+
defautEquipe2: bool | None = None
|
|
39
|
+
forfaitEquipe1: bool | None = None
|
|
40
|
+
forfaitEquipe2: bool | None = None
|
|
41
|
+
penaliteEquipe1: bool | None = None
|
|
42
|
+
penaliteEquipe2: bool | None = None
|
|
43
|
+
raw_data: dict[str, Any] | None = None
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls, data: dict) -> "GetRencontreResponse | None":
|
|
47
|
+
if not data or not isinstance(data, dict):
|
|
48
|
+
return None
|
|
49
|
+
date_str = data.get("date_rencontre")
|
|
50
|
+
date = None
|
|
51
|
+
if date_str:
|
|
52
|
+
try:
|
|
53
|
+
date = datetime.fromisoformat(date_str.replace("Z", "+00:00"))
|
|
54
|
+
except (ValueError, AttributeError):
|
|
55
|
+
pass
|
|
56
|
+
return cls(
|
|
57
|
+
id=str(data.get("id", "")),
|
|
58
|
+
numero=data.get("numero"),
|
|
59
|
+
numeroJournee=data.get("numeroJournee"),
|
|
60
|
+
date_rencontre=date,
|
|
61
|
+
date=data.get("date"),
|
|
62
|
+
horaire=data.get("horaire"),
|
|
63
|
+
resultatEquipe1=data.get("resultatEquipe1"),
|
|
64
|
+
resultatEquipe2=data.get("resultatEquipe2"),
|
|
65
|
+
joue=int(data.get("joue", 0)),
|
|
66
|
+
nomEquipe1=data.get("nomEquipe1"),
|
|
67
|
+
nomEquipe2=data.get("nomEquipe2"),
|
|
68
|
+
idPoule=data.get("idPoule"),
|
|
69
|
+
competitionId=data.get("competitionId"),
|
|
70
|
+
idOrganismeEquipe1=data.get("idOrganismeEquipe1"),
|
|
71
|
+
idOrganismeEquipe2=data.get("idOrganismeEquipe2"),
|
|
72
|
+
idEngagementEquipe1=data.get("idEngagementEquipe1"),
|
|
73
|
+
idEngagementEquipe2=data.get("idEngagementEquipe2"),
|
|
74
|
+
salle=data.get("salle"),
|
|
75
|
+
officiels=data.get("officiels"),
|
|
76
|
+
rematch_videos=data.get("rematch_videos"),
|
|
77
|
+
gsId=data.get("gsId"),
|
|
78
|
+
etat=data.get("etat"),
|
|
79
|
+
handicap1=data.get("handicap1"),
|
|
80
|
+
handicap2=data.get("handicap2"),
|
|
81
|
+
pratique=data.get("pratique"),
|
|
82
|
+
uniqueKey=data.get("uniqueKey"),
|
|
83
|
+
url_competition=data.get("url_competition"),
|
|
84
|
+
validee=data.get("validee"),
|
|
85
|
+
remise=data.get("remise"),
|
|
86
|
+
defautEquipe1=data.get("defautEquipe1"),
|
|
87
|
+
defautEquipe2=data.get("defautEquipe2"),
|
|
88
|
+
forfaitEquipe1=data.get("forfaitEquipe1"),
|
|
89
|
+
forfaitEquipe2=data.get("forfaitEquipe2"),
|
|
90
|
+
penaliteEquipe1=data.get("penaliteEquipe1"),
|
|
91
|
+
penaliteEquipe2=data.get("penaliteEquipe2"),
|
|
92
|
+
raw_data=data,
|
|
93
|
+
)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass
|
|
8
|
+
class GetSaisonsResponse:
|
|
9
|
+
id: str
|
|
10
|
+
nom: str | None = None
|
|
11
|
+
actif: bool | None = None
|
|
12
|
+
debut: str | None = None
|
|
13
|
+
fin: str | None = None
|
|
14
|
+
code: str | None = None
|
|
15
|
+
libelle: str | None = None
|
|
16
|
+
enCours: bool | None = None
|
|
17
|
+
|
|
18
|
+
@classmethod
|
|
19
|
+
def from_dict(cls, data: dict[str, Any]) -> GetSaisonsResponse | None:
|
|
20
|
+
"""Convert dictionary to GetSaisonsResponse instance."""
|
|
21
|
+
if not data:
|
|
22
|
+
return None
|
|
23
|
+
|
|
24
|
+
# Handle case where data is not a dictionary
|
|
25
|
+
if not isinstance(data, dict):
|
|
26
|
+
return None
|
|
27
|
+
|
|
28
|
+
# Handle API error responses
|
|
29
|
+
if "errors" in data:
|
|
30
|
+
return None
|
|
31
|
+
|
|
32
|
+
return cls(
|
|
33
|
+
id=str(data.get("id", "")),
|
|
34
|
+
nom=str(data.get("nom", "")) if data.get("nom") else None,
|
|
35
|
+
actif=bool(data.get("actif", False)) if "actif" in data else None,
|
|
36
|
+
debut=str(data.get("debut", "")) if data.get("debut") else None,
|
|
37
|
+
fin=str(data.get("fin", "")) if data.get("fin") else None,
|
|
38
|
+
code=str(data.get("code", "")) if data.get("code") else None,
|
|
39
|
+
libelle=str(data.get("libelle", "")) if data.get("libelle") else None,
|
|
40
|
+
enCours=bool(data.get("enCours", False)) if "enCours" in data else None,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_list(cls, data_list: list[dict[str, Any]]) -> list[GetSaisonsResponse]:
|
|
45
|
+
"""Convert list of dictionaries to list of SaisonsModel instances."""
|
|
46
|
+
if not data_list:
|
|
47
|
+
return []
|
|
48
|
+
|
|
49
|
+
# Filter out None results from from_dict (invalid items)
|
|
50
|
+
return [
|
|
51
|
+
result
|
|
52
|
+
for item in data_list
|
|
53
|
+
if item
|
|
54
|
+
for result in [cls.from_dict(item)]
|
|
55
|
+
if result is not None
|
|
56
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class GetSalleResponse:
|
|
6
|
+
id: str
|
|
7
|
+
numero: str | None = None
|
|
8
|
+
libelle: str | None = None
|
|
9
|
+
adresse: str | None = None
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def from_dict(cls, data: dict) -> "GetSalleResponse | None":
|
|
13
|
+
if not data or not isinstance(data, dict):
|
|
14
|
+
return None
|
|
15
|
+
return cls(
|
|
16
|
+
id=str(data.get("id", "")),
|
|
17
|
+
numero=data.get("numero"),
|
|
18
|
+
libelle=data.get("libelle"),
|
|
19
|
+
adresse=data.get("adresse"),
|
|
20
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class GetTerrainResponse:
|
|
6
|
+
id: str
|
|
7
|
+
nom: str | None = None
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def from_dict(cls, data: dict) -> "GetTerrainResponse | None":
|
|
11
|
+
if not data or not isinstance(data, dict):
|
|
12
|
+
return None
|
|
13
|
+
return cls(
|
|
14
|
+
id=str(data.get("id", "")),
|
|
15
|
+
nom=data.get("nom"),
|
|
16
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass
|
|
5
|
+
class GetTournoiResponse:
|
|
6
|
+
id: str
|
|
7
|
+
libelle: str | None = None
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def from_dict(cls, data: dict) -> "GetTournoiResponse | None":
|
|
11
|
+
if not data or not isinstance(data, dict):
|
|
12
|
+
return None
|
|
13
|
+
return cls(
|
|
14
|
+
id=str(data.get("id", "")),
|
|
15
|
+
libelle=data.get("libelle"),
|
|
16
|
+
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class GradientColor(Enum):
|
|
5
|
+
A01_A17 = "#a01a17"
|
|
6
|
+
B1_B3_B3 = "#b1b3b3"
|
|
7
|
+
B3_B2_B2 = "#b3b2b2"
|
|
8
|
+
BCBCBB = "#bcbcbb"
|
|
9
|
+
BDBCBC = "#bdbcbc"
|
|
10
|
+
BEBEBE = "#bebebe"
|
|
11
|
+
BFCED9 = "#bfced9"
|
|
12
|
+
BFD8_EC = "#bfd8ec"
|
|
13
|
+
E30066 = "#e30066"
|
|
14
|
+
E30072 = "#e30072"
|
|
15
|
+
E50069 = "#e50069"
|
|
16
|
+
E5_C0_BF = "#e5c0bf"
|
|
17
|
+
E60066 = "#e60066"
|
|
18
|
+
F5_AEBB = "#f5aebb"
|
|
19
|
+
THE_00_BEF5 = "#00bef5"
|
|
20
|
+
THE_01_B5_EA = "#01b5ea"
|
|
21
|
+
THE_01_B6_E8 = "#01b6e8"
|
|
22
|
+
THE_01_B6_ED = "#01b6ed"
|
|
23
|
+
THE_23328_A = "#23328a"
|
|
24
|
+
THE_2_F2_A85 = "#2f2a85"
|
|
25
|
+
THE_401407 = "#401407"
|
|
26
|
+
THE_878888 = "#878888"
|
|
27
|
+
THE_9_D9_E9_E = "#9d9e9e"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Hit(ABC):
|
|
6
|
+
@staticmethod
|
|
7
|
+
def from_dict(obj: Any) -> "Hit":
|
|
8
|
+
raise NotImplementedError
|
|
9
|
+
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def to_dict(self) -> dict:
|
|
12
|
+
raise NotImplementedError
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def is_valid_for_query(self, query: str) -> bool:
|
|
16
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ..utils.converter_utils import from_obj, from_str
|
|
7
|
+
from .logo import Logo
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class IDEngagementEquipe:
|
|
12
|
+
id: str | None = None
|
|
13
|
+
nom_usuel: str | None = None
|
|
14
|
+
logo: Logo | None = None
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def from_dict(obj: Any) -> IDEngagementEquipe:
|
|
18
|
+
assert isinstance(obj, dict)
|
|
19
|
+
id = from_str(obj, "id")
|
|
20
|
+
nom_usuel = from_str(obj, "nomUsuel")
|
|
21
|
+
logo = from_obj(Logo.from_dict, obj, "logo")
|
|
22
|
+
return IDEngagementEquipe(id=id, nom_usuel=nom_usuel, logo=logo)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict:
|
|
25
|
+
result: dict = {}
|
|
26
|
+
if self.id is not None:
|
|
27
|
+
result["id"] = self.id
|
|
28
|
+
if self.nom_usuel is not None:
|
|
29
|
+
result["nomUsuel"] = self.nom_usuel
|
|
30
|
+
if self.logo is not None:
|
|
31
|
+
result["logo"] = self.logo.to_dict()
|
|
32
|
+
return result
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ..utils.converter_utils import from_obj, from_str
|
|
7
|
+
from .id_organisme_equipe1_logo import IDOrganismeEquipe1Logo
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class IDOrganismeEquipe:
|
|
12
|
+
id: str | None = None
|
|
13
|
+
nom: str | None = None
|
|
14
|
+
nom_simple: str | None = None
|
|
15
|
+
code: str | None = None
|
|
16
|
+
nom_club_pro: str | None = None
|
|
17
|
+
logo: IDOrganismeEquipe1Logo | None = None
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def from_dict(obj: Any) -> IDOrganismeEquipe:
|
|
21
|
+
assert isinstance(obj, dict)
|
|
22
|
+
id = from_str(obj, "id")
|
|
23
|
+
nom = from_str(obj, "nom")
|
|
24
|
+
nom_simple = from_str(obj, "nom_simple")
|
|
25
|
+
code = from_str(obj, "code")
|
|
26
|
+
nom_club_pro = from_str(obj, "nomClubPro")
|
|
27
|
+
logo = from_obj(IDOrganismeEquipe1Logo.from_dict, obj, "logo")
|
|
28
|
+
return IDOrganismeEquipe(
|
|
29
|
+
id=id,
|
|
30
|
+
nom=nom,
|
|
31
|
+
nom_simple=nom_simple,
|
|
32
|
+
code=code,
|
|
33
|
+
nom_club_pro=nom_club_pro,
|
|
34
|
+
logo=logo,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict:
|
|
38
|
+
result: dict = {}
|
|
39
|
+
if self.id is not None:
|
|
40
|
+
result["id"] = self.id
|
|
41
|
+
if self.nom is not None:
|
|
42
|
+
result["nom"] = self.nom
|
|
43
|
+
if self.nom_simple is not None:
|
|
44
|
+
result["nom_simple"] = self.nom_simple
|
|
45
|
+
if self.code is not None:
|
|
46
|
+
result["code"] = self.code
|
|
47
|
+
if self.nom_club_pro is not None:
|
|
48
|
+
result["nomClubPro"] = self.nom_club_pro
|
|
49
|
+
if self.logo is not None:
|
|
50
|
+
result["logo"] = self.logo.to_dict()
|
|
51
|
+
return result
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
from uuid import UUID
|
|
6
|
+
|
|
7
|
+
from ..utils.converter_utils import from_str, from_uuid
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class IDOrganismeEquipe1Logo:
|
|
12
|
+
id: UUID | None = None
|
|
13
|
+
gradient_color: str | None = None
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def from_dict(obj: Any) -> IDOrganismeEquipe1Logo:
|
|
17
|
+
assert isinstance(obj, dict)
|
|
18
|
+
id = from_uuid(obj, "id")
|
|
19
|
+
gradient_color = from_str(obj, "gradient_color")
|
|
20
|
+
return IDOrganismeEquipe1Logo(id=id, gradient_color=gradient_color)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict:
|
|
23
|
+
result: dict = {}
|
|
24
|
+
if self.id is not None:
|
|
25
|
+
result["id"] = str(self.id)
|
|
26
|
+
if self.gradient_color is not None:
|
|
27
|
+
result["gradient_color"] = self.gradient_color
|
|
28
|
+
return result
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ..utils.converter_utils import from_str
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class IDPoule:
|
|
11
|
+
id: str | None = None
|
|
12
|
+
nom: str | None = None
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def from_dict(obj: Any) -> IDPoule:
|
|
16
|
+
assert isinstance(obj, dict)
|
|
17
|
+
id = from_str(obj, "id")
|
|
18
|
+
nom = from_str(obj, "nom")
|
|
19
|
+
return IDPoule(id=id, nom=nom)
|
|
20
|
+
|
|
21
|
+
def to_dict(self) -> dict:
|
|
22
|
+
result: dict = {}
|
|
23
|
+
if self.id is not None:
|
|
24
|
+
result["id"] = self.id
|
|
25
|
+
if self.nom is not None:
|
|
26
|
+
result["nom"] = self.nom
|
|
27
|
+
return result
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Label(Enum):
|
|
5
|
+
BASKET_INCLUSIF = "Basket Inclusif"
|
|
6
|
+
BASKET_SANTÉ_CONFORT = "Basket Santé Confort"
|
|
7
|
+
BASKET_SANTÉ_DÉCOUVERTE = "Basket Santé Découverte"
|
|
8
|
+
BASKET_SANTÉ_RÉSOLUTIONS = "Basket Santé Résolutions"
|
|
9
|
+
BASKE_TONIK = "BaskeTonik"
|
|
10
|
+
BASKE_TONIK_FORME = "BaskeTonik forme"
|
|
11
|
+
DÉCOUVERTE_BASKET_INCLUSIF = "Découverte Basket Inclusif"
|
|
12
|
+
DÉCOUVERTE_BASKE_TONIK = "Découverte BaskeTonik"
|
|
13
|
+
DÉCOUVERTE_MICRO_BASKET = "Découverte Micro Basket"
|
|
14
|
+
EMPTY = ""
|
|
15
|
+
MICRO_BASKET = "Micro Basket"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from ..utils.converter_utils import from_int
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class Labellisation:
|
|
11
|
+
basket_santé_résolutions: int | None = None
|
|
12
|
+
micro_basket: int | None = None
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def from_dict(obj: Any) -> Labellisation:
|
|
16
|
+
assert isinstance(obj, dict)
|
|
17
|
+
basket_santé_résolutions = from_int(obj, "Basket Santé / Résolutions")
|
|
18
|
+
micro_basket = from_int(obj, "Micro Basket")
|
|
19
|
+
return Labellisation(
|
|
20
|
+
basket_santé_résolutions=basket_santé_résolutions,
|
|
21
|
+
micro_basket=micro_basket,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict:
|
|
25
|
+
result: dict = {}
|
|
26
|
+
if self.basket_santé_résolutions is not None:
|
|
27
|
+
result["Basket Santé / Résolutions"] = self.basket_santé_résolutions
|
|
28
|
+
if self.micro_basket is not None:
|
|
29
|
+
result["Micro Basket"] = self.micro_basket
|
|
30
|
+
return result
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from ..utils.converter_utils import (
|
|
8
|
+
from_datetime,
|
|
9
|
+
from_int,
|
|
10
|
+
from_obj,
|
|
11
|
+
from_str,
|
|
12
|
+
)
|
|
13
|
+
from .clock import Clock
|
|
14
|
+
from .external_id import ExternalID
|
|
15
|
+
from .team_engagement import TeamEngagement
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass
|
|
19
|
+
class Live:
|
|
20
|
+
match_id: int | None = None
|
|
21
|
+
match_time: datetime | None = None
|
|
22
|
+
competition_abg_name: str | None = None
|
|
23
|
+
score_q1_home: int | None = None
|
|
24
|
+
score_q2_home: int | None = None
|
|
25
|
+
score_q3_home: int | None = None
|
|
26
|
+
score_q4_home: int | None = None
|
|
27
|
+
score_q1_out: int | None = None
|
|
28
|
+
score_q2_out: int | None = None
|
|
29
|
+
score_q3_out: int | None = None
|
|
30
|
+
score_q4_out: int | None = None
|
|
31
|
+
score_ot1_home: int | None = None
|
|
32
|
+
score_ot2_home: int | None = None
|
|
33
|
+
score_ot1_out: int | None = None
|
|
34
|
+
score_ot2_out: int | None = None
|
|
35
|
+
score_home: int | None = None
|
|
36
|
+
score_out: int | None = None
|
|
37
|
+
clock: Clock | None = None
|
|
38
|
+
competition_name: str | None = None
|
|
39
|
+
current_status: str | None = None
|
|
40
|
+
current_period: str | None = None
|
|
41
|
+
match_status: str | None = None
|
|
42
|
+
team_name_home: str | None = None
|
|
43
|
+
team_name_out: str | None = None
|
|
44
|
+
external_id: ExternalID | None = None
|
|
45
|
+
team_engagement_home: TeamEngagement | None = None
|
|
46
|
+
team_engagement_out: TeamEngagement | None = None
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
def from_dict(obj: Any) -> Live:
|
|
50
|
+
assert isinstance(obj, dict)
|
|
51
|
+
match_id = from_int(obj, "matchId")
|
|
52
|
+
match_time = from_datetime(obj, "matchTime")
|
|
53
|
+
competition_abg_name = from_str(obj, "competitionAbgName")
|
|
54
|
+
score_q1_home = from_int(obj, "score_q1_home")
|
|
55
|
+
score_q2_home = from_int(obj, "score_q2_home")
|
|
56
|
+
score_q3_home = from_int(obj, "score_q3_home")
|
|
57
|
+
score_q4_home = from_int(obj, "score_q4_home")
|
|
58
|
+
score_q1_out = from_int(obj, "score_q1_out")
|
|
59
|
+
score_q2_out = from_int(obj, "score_q2_out")
|
|
60
|
+
score_q3_out = from_int(obj, "score_q3_out")
|
|
61
|
+
score_q4_out = from_int(obj, "score_q4_out")
|
|
62
|
+
score_ot1_home = from_int(obj, "score_ot1_home")
|
|
63
|
+
score_ot2_home = from_int(obj, "score_ot2_home")
|
|
64
|
+
score_ot1_out = from_int(obj, "score_ot1_out")
|
|
65
|
+
score_ot2_out = from_int(obj, "score_ot2_out")
|
|
66
|
+
score_home = from_int(obj, "score_home")
|
|
67
|
+
score_out = from_int(obj, "score_out")
|
|
68
|
+
clock_val = obj.get("clock")
|
|
69
|
+
clock = Clock.from_str(clock_val) if clock_val is not None else None
|
|
70
|
+
competition_name = from_str(obj, "competitionName")
|
|
71
|
+
current_status = from_str(obj, "currentStatus")
|
|
72
|
+
current_period = from_str(obj, "currentPeriod")
|
|
73
|
+
match_status = from_str(obj, "matchStatus")
|
|
74
|
+
team_name_home = from_str(obj, "teamName_home")
|
|
75
|
+
team_name_out = from_str(obj, "teamName_out")
|
|
76
|
+
external_id = from_obj(ExternalID.from_dict, obj, "externalId")
|
|
77
|
+
team_engagement_home = from_obj(
|
|
78
|
+
TeamEngagement.from_dict, obj, "teamEngagement_home"
|
|
79
|
+
)
|
|
80
|
+
team_engagement_out = from_obj(
|
|
81
|
+
TeamEngagement.from_dict, obj, "teamEngagement_out"
|
|
82
|
+
)
|
|
83
|
+
return Live(
|
|
84
|
+
match_id=match_id,
|
|
85
|
+
match_time=match_time,
|
|
86
|
+
competition_abg_name=competition_abg_name,
|
|
87
|
+
score_q1_home=score_q1_home,
|
|
88
|
+
score_q2_home=score_q2_home,
|
|
89
|
+
score_q3_home=score_q3_home,
|
|
90
|
+
score_q4_home=score_q4_home,
|
|
91
|
+
score_q1_out=score_q1_out,
|
|
92
|
+
score_q2_out=score_q2_out,
|
|
93
|
+
score_q3_out=score_q3_out,
|
|
94
|
+
score_q4_out=score_q4_out,
|
|
95
|
+
score_ot1_home=score_ot1_home,
|
|
96
|
+
score_ot2_home=score_ot2_home,
|
|
97
|
+
score_ot1_out=score_ot1_out,
|
|
98
|
+
score_ot2_out=score_ot2_out,
|
|
99
|
+
score_home=score_home,
|
|
100
|
+
score_out=score_out,
|
|
101
|
+
clock=clock,
|
|
102
|
+
competition_name=competition_name,
|
|
103
|
+
current_status=current_status,
|
|
104
|
+
current_period=current_period,
|
|
105
|
+
match_status=match_status,
|
|
106
|
+
team_name_home=team_name_home,
|
|
107
|
+
team_name_out=team_name_out,
|
|
108
|
+
external_id=external_id,
|
|
109
|
+
team_engagement_home=team_engagement_home,
|
|
110
|
+
team_engagement_out=team_engagement_out,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def __get_pydantic_core_schema__(cls, _source_type: Any, handler: Any) -> Any:
|
|
115
|
+
from pydantic_core import core_schema
|
|
116
|
+
|
|
117
|
+
return core_schema.no_info_before_validator_function(
|
|
118
|
+
cls._parse_pydantic,
|
|
119
|
+
handler(_source_type),
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
@classmethod
|
|
123
|
+
def _parse_pydantic(cls, value: Any) -> Any:
|
|
124
|
+
if isinstance(value, dict):
|
|
125
|
+
try:
|
|
126
|
+
# Use our own custom dict logic so key mappings apply naturally
|
|
127
|
+
return cls.from_dict(value)
|
|
128
|
+
except Exception:
|
|
129
|
+
pass
|
|
130
|
+
return value
|
|
131
|
+
|
|
132
|
+
def to_dict(self) -> dict:
|
|
133
|
+
result: dict = {}
|
|
134
|
+
if self.match_id is not None:
|
|
135
|
+
result["matchId"] = str(self.match_id)
|
|
136
|
+
if self.match_time is not None:
|
|
137
|
+
result["matchTime"] = self.match_time.isoformat()
|
|
138
|
+
if self.competition_abg_name is not None:
|
|
139
|
+
result["competitionAbgName"] = self.competition_abg_name
|
|
140
|
+
if self.score_q1_home is not None:
|
|
141
|
+
result["score_q1_home"] = self.score_q1_home
|
|
142
|
+
if self.score_q2_home is not None:
|
|
143
|
+
result["score_q2_home"] = self.score_q2_home
|
|
144
|
+
if self.score_q3_home is not None:
|
|
145
|
+
result["score_q3_home"] = self.score_q3_home
|
|
146
|
+
if self.score_q4_home is not None:
|
|
147
|
+
result["score_q4_home"] = self.score_q4_home
|
|
148
|
+
if self.score_q1_out is not None:
|
|
149
|
+
result["score_q1_out"] = self.score_q1_out
|
|
150
|
+
if self.score_q2_out is not None:
|
|
151
|
+
result["score_q2_out"] = self.score_q2_out
|
|
152
|
+
if self.score_q3_out is not None:
|
|
153
|
+
result["score_q3_out"] = self.score_q3_out
|
|
154
|
+
if self.score_q4_out is not None:
|
|
155
|
+
result["score_q4_out"] = self.score_q4_out
|
|
156
|
+
if self.score_ot1_home is not None:
|
|
157
|
+
result["score_ot1_home"] = self.score_ot1_home
|
|
158
|
+
if self.score_ot2_home is not None:
|
|
159
|
+
result["score_ot2_home"] = self.score_ot2_home
|
|
160
|
+
if self.score_ot1_out is not None:
|
|
161
|
+
result["score_ot1_out"] = self.score_ot1_out
|
|
162
|
+
if self.score_ot2_out is not None:
|
|
163
|
+
result["score_ot2_out"] = self.score_ot2_out
|
|
164
|
+
if self.score_home is not None:
|
|
165
|
+
result["score_home"] = self.score_home
|
|
166
|
+
if self.score_out is not None:
|
|
167
|
+
result["score_out"] = self.score_out
|
|
168
|
+
if self.clock is not None:
|
|
169
|
+
result["clock"] = self.clock.to_str()
|
|
170
|
+
if self.competition_name is not None:
|
|
171
|
+
result["competitionName"] = self.competition_name
|
|
172
|
+
if self.current_status is not None:
|
|
173
|
+
result["currentStatus"] = self.current_status
|
|
174
|
+
if self.current_period is not None:
|
|
175
|
+
result["currentPeriod"] = self.current_period
|
|
176
|
+
if self.match_status is not None:
|
|
177
|
+
result["matchStatus"] = self.match_status
|
|
178
|
+
if self.team_name_home is not None:
|
|
179
|
+
result["teamName_home"] = self.team_name_home
|
|
180
|
+
if self.team_name_out is not None:
|
|
181
|
+
result["teamName_out"] = self.team_name_out
|
|
182
|
+
if self.external_id is not None:
|
|
183
|
+
result["externalId"] = self.external_id.to_dict()
|
|
184
|
+
if self.team_engagement_home is not None:
|
|
185
|
+
result["teamEngagement_home"] = self.team_engagement_home.to_dict()
|
|
186
|
+
if self.team_engagement_out is not None:
|
|
187
|
+
result["teamEngagement_out"] = self.team_engagement_out.to_dict()
|
|
188
|
+
return result
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def lives_from_dict(s: Any) -> list[Live]:
|
|
192
|
+
return [Live.from_dict(item) for item in s]
|